Documentation
¶
Index ¶
- Variables
- func Lexer(text, filename string) (*lex.Scanner, error)
- type Consumer
- type FnConsumer
- type LexerContext
- func (self *LexerContext) Literal(scan *lex.Scanner, match *machines.Match) (interface{}, error)
- func (self *LexerContext) Skip(scan *lex.Scanner, match *machines.Match) (interface{}, error)
- func (self *LexerContext) Token(name string) lex.Action
- func (self *LexerContext) TokenValue(name string) lex.Action
- type Node
- func (self *Node) AddKid(kid *Node) *Node
- func (self *Node) Annotate(nodes []*Node) *Node
- func (self *Node) Get(idx int) *Node
- func (self *Node) Kid(label string) *Node
- func (self *Node) Leaf() bool
- func (self *Node) Location() *SourceLocation
- func (self *Node) PrependKid(kid *Node) *Node
- func (self *Node) Serialize(with_loc bool) string
- func (self *Node) String() string
- func (self *Node) WellTyped() bool
- type ParseError
- type SourceLocation
- type StringConsumer
- type Token
Constants ¶
This section is empty.
Variables ¶
View Source
var Literals []string
View Source
var TokMap map[string]int
View Source
var Tokens []string
Functions ¶
Types ¶
type FnConsumer ¶
type FnConsumer func(i int) (int, *Node, *ParseError)
func (FnConsumer) Consume ¶
func (self FnConsumer) Consume(i int) (int, *Node, *ParseError)
type LexerContext ¶
type LexerContext struct {
Filename string
}
func NewContext ¶
func NewContext(filename string) *LexerContext
func (*LexerContext) TokenValue ¶
func (self *LexerContext) TokenValue(name string) lex.Action
type Node ¶
type Node struct {
Label string
Value interface{}
Type types.Type
Children []*Node
// contains filtered or unexported fields
}
func NewTokenNode ¶
func NewValueNode ¶
func (*Node) Location ¶
func (self *Node) Location() *SourceLocation
func (*Node) PrependKid ¶
type ParseError ¶
func Error ¶
func Error(fmt string, t *Token) *ParseError
func (*ParseError) Error ¶
func (self *ParseError) Error() string
func (*ParseError) Less ¶
func (self *ParseError) Less(o *ParseError) bool
type SourceLocation ¶
func (*SourceLocation) Join ¶
func (self *SourceLocation) Join(others ...*SourceLocation) (*SourceLocation, error)
func (*SourceLocation) String ¶
func (self *SourceLocation) String() string
type StringConsumer ¶
type StringConsumer struct {
Productions map[string]Consumer
// contains filtered or unexported fields
}
func (StringConsumer) Consume ¶
func (self StringConsumer) Consume(i int) (int, *Node, *ParseError)
Click to show internal directories.
Click to hide internal directories.