Documentation ¶
Overview ¶
Package token provides generated internal tokenizing functions for DOT parsing.
Index ¶
- Variables
- type Context
- type Pos
- type Sourcer
- type Token
- func (t *Token) CharLiteralValue() string
- func (t *Token) Equals(rhs interface{}) bool
- func (t *Token) Float32Value() (float32, error)
- func (t *Token) Float64Value() (float64, error)
- func (t *Token) IDValue() string
- func (t *Token) Int32Value() (int32, error)
- func (t *Token) Int64Value() (int64, error)
- func (t *Token) StringValue() string
- func (t *Token) UTF8Rune() (rune, error)
- type TokenMap
- type Type
Constants ¶
This section is empty.
Variables ¶
var TokMap = TokenMap{ // contains filtered or unexported fields }
Functions ¶
This section is empty.
Types ¶
type Context ¶ added in v0.14.0
type Context interface{}
Context allows user-defined data to be associated with the lexer/scanner to be associated with each token that lexer produces.
type Sourcer ¶ added in v0.14.0
type Sourcer interface {
Source() string
}
Sourcer is a Context interface which presents a Source() method identifying e.g the filename for the current code.
type Token ¶
func (*Token) CharLiteralValue ¶ added in v0.14.0
CharLiteralValue returns the string value of the char literal.
func (*Token) Equals ¶ added in v0.14.0
Equals returns returns true if the token Type and Lit are matches.
func (*Token) Float32Value ¶ added in v0.14.0
Float32Value returns the float32 value of the token or an error if the token literal does not denote a valid float32.
func (*Token) Float64Value ¶ added in v0.14.0
Float64Value returns the float64 value of the token or an error if the token literal does not denote a valid float64.
func (*Token) IDValue ¶ added in v0.14.0
IDValue returns the string representation of an identifier token.
func (*Token) Int32Value ¶ added in v0.14.0
Int32Value returns the int32 value of the token or an error if the token literal does not denote a valid float64.
func (*Token) Int64Value ¶ added in v0.14.0
Int64Value returns the int64 value of the token or an error if the token literal does not denote a valid float64.
func (*Token) StringValue ¶ added in v0.14.0
StringValue returns the string value of the token literal.
type TokenMap ¶
type TokenMap struct {
// contains filtered or unexported fields
}