Documentation
¶
Overview ¶
This is a *generic* implementation of a lexer. gengen should be used to create a specific version of this lexer. If this file does not contain the gengen package, then it has already been generated by gengen. TODO: remove this hack if/when golang ever supports proper generics.
This is a *generic* implementation of a parser. gengen should be used to create a specific version of this parser. If this file does not contain the gengen package, then it has already been generated by gengen. TODO: remove this hack if/when golang ever supports proper generics.
Index ¶
Constants ¶
const EOFRUNE = -1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AstNode ¶
type AstNode interface {
// Connect connects this AstNode to another AstNode with the given predicate,
// and returns the same AstNode.
Connect(predicate string, other AstNode) AstNode
// Decorate decorates this AstNode with the given property and string value,
// and returns the same AstNode.
Decorate(property string, value string) AstNode
// Decorate decorates this AstNode with the given property and int value,
// and returns the same AstNode.
DecorateWithInt(property string, value int) AstNode
}
AstNode defines an interface for working with nodes created by this parser.
type NodeBuilder ¶
type NodeBuilder func(source compilercommon.InputSource, kind generic.U) AstNode
NodeBuilder is a function for building AST nodes.