public interface ATNFactory| Modifier and Type | Interface and Description |
|---|---|
static class |
ATNFactory
A pair of states pointing to the left/right (start and end) states of a state submachine.
|
| Modifier and Type | Method and Description |
|---|---|
ATNFactory |
action(ActionAST
Build what amounts to an epsilon transition with an action.
|
ATNFactory |
action(String
|
ATNFactory |
alt(List
|
ATNFactory |
block(BlockAST
From A|B|..|Z alternative block build o->o-A->o->o (last ATNState is blockEndATNState pointed to by all alts) | ^ o->o-B->o--| | | ...
|
ATNFactory |
charSetLiteral(GrammarAST
|
ATN |
createATN()
|
ATNFactory |
epsilon(GrammarAST
From an empty alternative build Grip o-e->o
|
ATNFactory |
label(ATNFactory
|
ATNFactory |
lexerAltCommands(ATNFactory
|
ATNFactory |
lexerCallCommand(GrammarAST
|
ATNFactory |
lexerCommand(GrammarAST
|
ATNFactory |
listLabel(ATNFactory
|
ATNState |
newState()
|
ATNFactory |
optional(GrammarAST
From (A)? build either: o--A->o | ^ o---->| or, if A is a block, just add an empty alt to the end of the block
|
ATNFactory |
plus(GrammarAST
From (A)+ build |---| (Transition 2 from A.right points at alt 1) v | (follow of loop is Transition 1) o->o-A-o->o Meaning that the last ATNState in A points back to A's left Transition ATNState and we add a new begin/end ATNState.
|
ATNFactory |
range(GrammarAST
|
ATNFactory |
rule(GrammarAST
|
ATNFactory |
ruleRef(GrammarAST
For reference to rule r, build o-e->(r) o where (r) is the start of rule r and the trailing o is not linked to from rule ref state directly (it's done thru the transition(0) RuleClosureTransition.
|
ATNFactory |
sempred(PredAST
Build what amounts to an epsilon transition with a semantic predicate action.
|
ATNFactory |
set(GrammarAST
|
void |
setCurrentOuterAlt(int alt)
|
void |
setCurrentRuleName(String
|
ATNFactory |
star(GrammarAST
From (A)* build |---| v | o->o-A-o--o (Transition 2 from block end points at alt 1; follow is Transition 1) | ^ o---------| (optional branch is 2nd alt of optional block containing A+) Meaning that the last (end) ATNState in A points back to A's left side ATNState and we add 3 new ATNStates (the optional branch is built just like an optional subrule).
|
ATNFactory |
stringLiteral(TerminalAST
For a non-lexer, just build a simple token reference atom.
|
ATNFactory |
tokenRef(TerminalAST
|
ATNFactory |
wildcard(GrammarAST
Build an atom with all possible values in its label
|
ATN createATN()
void setCurrentRuleName(Stringname)
void setCurrentOuterAlt(int alt)
ATNFactory.Handle rule(GrammarAST ruleAST, String name, ATNFactory .Handle blk)
ATNState newState()
ATNFactory.Handle label(ATNFactory .Handle t)
ATNFactory.Handle listLabel(ATNFactory .Handle t)
ATNFactory.Handle tokenRef(TerminalAST node)
ATNFactory.Handle set(GrammarAST associatedAST, List <GrammarAST > alts, boolean invert)
ATNFactory.Handle charSetLiteral(GrammarAST charSetAST)
ATNFactory.Handle range(GrammarAST a, GrammarAST b)
ATNFactory.Handle stringLiteral(TerminalAST stringLiteralAST)
ATNFactory.Handle ruleRef(GrammarAST node)
node -
ATNFactory.Handle epsilon(GrammarAST node)
ATNFactory.Handle sempred(PredAST pred)
ATNFactory.Handle action(ActionAST action)
ATNFactory.Handle action(String action)
ATNFactory.Handle alt(List <ATNFactory .Handle > els)
ATNFactory.Handle block(BlockAST blockAST, GrammarAST ebnfRoot, List <ATNFactory .Handle > alternativeGrips)
ATNFactory.Handle optional(GrammarAST optAST, ATNFactory .Handle blk)
ATNFactory.Handle plus(GrammarAST plusAST, ATNFactory .Handle blk)
ATNFactory.Handle star(GrammarAST starAST, ATNFactory .Handle blk)
ATNFactory.Handle wildcard(GrammarAST associatedAST)
ATNFactory.Handle lexerAltCommands(ATNFactory .Handle alt, ATNFactory .Handle cmds)
ATNFactory.Handle lexerCallCommand(GrammarAST ID, GrammarAST arg)
ATNFactory.Handle lexerCommand(GrammarAST ID)