Versions in this module Expand all Collapse all v0 v0.2.0-alpha.1 Dec 16, 2021 v0.1.0 Nov 13, 2021 Changes in this version + const AcceptAction + const EOFType + const EpsilonType + const NonTermType + const ShiftAction + var NullItem = Item + func ActionTableAsHTML(lrgen *TableGenerator, w io.Writer) + func Dump(iset *iteratable.Set) + func GotoTableAsHTML(lrgen *TableGenerator, w io.Writer) + func StartItem(r *Rule) (Item, *Symbol) + func T() tracing.Trace + type CFSM struct + S0 *CFSMState + func (c *CFSM) CFSM2GraphViz(filename string) + type CFSMState struct + Accept bool + ID int + func (s *CFSMState) Dump() + func (s *CFSMState) String() string + type Grammar struct + EOF *Symbol + Epsilon *Symbol + Name string + func (g *Grammar) Dump() + func (g *Grammar) EachNonTerminal(mapper func(sym *Symbol) interface{}) []interface{} + func (g *Grammar) EachSymbol(mapper func(sym *Symbol) interface{}) []interface{} + func (g *Grammar) EachTerminal(mapper func(sym *Symbol) interface{}) []interface{} + func (g *Grammar) FindNonTermRules(sym *Symbol, includeEpsRules bool) *iteratable.Set + func (g *Grammar) Rule(no int) *Rule + func (g *Grammar) Size() int + func (g *Grammar) SymbolByName(name string) *Symbol + func (g *Grammar) Terminal(tokval int) *Symbol + type GrammarBuilder struct + func NewGrammarBuilder(gname string) *GrammarBuilder + func (gb *GrammarBuilder) Grammar() (*Grammar, error) + func (gb *GrammarBuilder) LHS(s string) *RuleBuilder + func (gb *GrammarBuilder) SetTokenizerHook(hook TokenizerHook) + type Item struct + Origin uint64 + func (i Item) Advance() Item + func (i Item) PeekSymbol() *Symbol + func (i Item) Prefix() []*Symbol + func (i Item) Rule() *Rule + func (i Item) String() string + type LRAnalysis struct + func Analysis(g *Grammar) *LRAnalysis + func (ga *LRAnalysis) CleanUp() error + func (ga *LRAnalysis) DerivesEpsilon(sym *Symbol) bool + func (ga *LRAnalysis) First(sym *Symbol) *intsets.Sparse + func (ga *LRAnalysis) Follow(sym *Symbol) *intsets.Sparse + func (ga *LRAnalysis) Grammar() *Grammar + type Rule struct + LHS *Symbol + Serial int + func (r *Rule) IsEps() bool + func (r *Rule) RHS() []*Symbol + func (r *Rule) String() string + type RuleBuilder struct + func (rb *RuleBuilder) AppendSymbol(sym *Symbol) *RuleBuilder + func (rb *RuleBuilder) EOF() *Rule + func (rb *RuleBuilder) End() *Rule + func (rb *RuleBuilder) Epsilon() *Rule + func (rb *RuleBuilder) L(s string) *RuleBuilder + func (rb *RuleBuilder) N(s string) *RuleBuilder + func (rb *RuleBuilder) T(s string, tokval int) *RuleBuilder + type Span [2]uint64 + func (s *Span) From() uint64 + func (s *Span) Len() uint64 + func (s *Span) String() string + func (s *Span) To() uint64 + type Symbol struct + Name string + Value int + func (lrsym *Symbol) IsTerminal() bool + func (lrsym *Symbol) String() string + func (lrsym *Symbol) Token() int + type TableGenerator struct + HasConflicts bool + func NewTableGenerator(ga *LRAnalysis) *TableGenerator + func (lrgen *TableGenerator) AcceptingStates() []int + func (lrgen *TableGenerator) ActionTable() *sparse.IntMatrix + func (lrgen *TableGenerator) BuildGotoTable() *sparse.IntMatrix + func (lrgen *TableGenerator) BuildLR0ActionTable() (*sparse.IntMatrix, bool) + func (lrgen *TableGenerator) BuildSLR1ActionTable() (*sparse.IntMatrix, bool) + func (lrgen *TableGenerator) CFSM() *CFSM + func (lrgen *TableGenerator) CreateTables() + func (lrgen *TableGenerator) GotoTable() *sparse.IntMatrix + type TokenizerHook interface + NewToken func(string) (string, int)