Documentation ¶
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 ¶
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 ¶
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 ¶
CharLiteralValue returns the string value of the char literal.
func (*Token) Float32Value ¶
Float32Value returns the float32 value of the token or an error if the token literal does not denote a valid float32.
func (*Token) Float64Value ¶
Float64Value returns the float64 value of the token or an error if the token literal does not denote a valid float64.
func (*Token) Int32Value ¶
Int32Value returns the int32 value of the token or an error if the token literal does not denote a valid float64.
func (*Token) Int64Value ¶
Int64Value returns the int64 value of the token or an error if the token literal does not denote a valid float64.
func (*Token) StringValue ¶
StringValue returns the string value of the token literal.
type TokenMap ¶
type TokenMap struct {
// contains filtered or unexported fields
}