Documentation ¶
Index ¶
Constants ¶
View Source
const ( AcceptRule = "#accept" StartMarker = "^" EndMarker = "$" Wildcard = "*" )
View Source
const (
Generic = "Generic_"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Grammar ¶
type Item ¶
type Item struct { *Term *Clause Dot int LookAhead string IsReduce bool IsKernel bool Key string Next *Item Core *Item Pool *itemPool }
LR(1) production item of the form: A -> [a B] . [c] , x
func (*Item) Compare ¶
sort order:
kernel items before non-kernel items clause sort id dot position lookahead string
func (*Item) ReplaceLookAhead ¶
type LRStates ¶
type LRStates struct { *Grammar FirstTerms map[string]*firstTermsEntry ItemPool *itemPool States map[string]*ItemSet OrderedStates []*ItemSet ShiftReduceConflictsCount int ReduceReduceConflictsCount int }
func NewLRStates ¶
type Term ¶
type Term struct { Name string parser.LRLocation SymbolId parser.LRSymbolId IsTerminal bool ValueType string RuleLocation parser.LRLocation Clauses []*Clause Reachable bool CodeGenSymbolConst string // Temp variable populated by code generator. The generated type is // language specific. CodeGenType interface{} }
Click to show internal directories.
Click to hide internal directories.