Documentation
¶
Overview ¶
Package symbols is a static reposistory of the symbols of generated parser. It is used by all code generation modules
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNonTerminalSymbols ¶
func GetNonTerminalSymbols() []string
GetNonTerminalSymbols returns the list of non-terminals used by code generation modules
func GetSymbols ¶
func GetSymbols() []string
GetSymbols returns the code strings of all the NT and T symbols
func GetTerminalSymbols ¶
func GetTerminalSymbols() []string
GetTerminalSymbols returns the list of symbol strings used by code generation modules of the terminals
func GetTerminalTypeStrings ¶
func GetTerminalTypeStrings() []string
GetTerminalTypeStrings returns the type strings of the terminals in order of their types.
func IsNonTerminal ¶
Types ¶
type NT ¶
type NT int
NT is the type of a non-terminal symbol
func GetNonTerminals ¶
func GetNonTerminals() []NT
GetNonTerminals returns the list of non-terminals used by code generation modules
func (NT) IsNonTerminal ¶
IsNonTerminal always returns true if the symbol is a non-terminal
type Symbol ¶
type Symbol interface { // IsNonTerminal returns true iff this symbol is a non-terminal IsNonTerminal() bool // Literal returns the literal value of the symbol in the grammar Literal() string // GoString returns the Go representation of the symbol that is used // for code generation GoString() string // String returns the string representation of the symbol that is used // for code generation String() string // contains filtered or unexported methods }
Symbol is T or NT
func FromASTString ¶
FromASTString translates an AST symbol string to Symbol
type Symbols ¶
type Symbols []Symbol
Symbols is a list of Symbol
type T ¶
type T int
T is the type of a terminal symbol
func GetTerminals ¶
func GetTerminals() []T
GetTerminals returns the list of terminals used by code generation modules
func TerminalLiteralToType ¶
TerminalLiteralToType returns the T corresponding to the terminal litral s
func (T) IsNonTerminal ¶
IsNonTerminal always returns false if the symbol is a terminal
func (T) TypeString ¶
TypeString returns the Go representation of t used by code generation modules