ATN object and returns it.
| Modifier and Type | Field and Description |
|---|---|
| public final ATN | |
| public int | |
| public Rule | |
| public final Grammar | |
| protected final List | |
| protected final List |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public ATNFactory. | |
| public ATNFactory. | action(ActionAST action)
Implements org. |
| public ATNFactory. | |
| public int | addEOFTransitionToStartRules()
Add an EOF transition to any rule end ATNState that points to nothing (i.e., for all those rules not invoked by another rule). |
| public void | |
| public void | |
| public ATNFactory. | |
| public ATNFactory. | block(BlockAST blkAST, GrammarAST ebnfRoot, List<ATNFactory.
Implements org. A|B|..|Z alternative block build
o->o-A->o->o (last ATNState is BlockEndState pointed to by all alts) | ^ |->o-B->o--| | | ... |
| public static boolean | |
| public ATNFactory. | charSetLiteral(GrammarAST charSetAST)
Implements org. [Aa] char sets not allowed in parser
|
| protected void | |
| public ATN | |
| pack-priv void | createRuleStartAndStopATNStates()
Define all the rule begin/end ATNStates to solve forward reference issues. |
| public ATNFactory. | |
| public ATNFactory. | epsilon(GrammarAST node)
Implements org. o-e->o.
|
| protected void | |
| protected void | |
| public boolean | |
| protected int | |
| public ATNFactory. | |
| public ATNFactory. | lexerAltCommands(ATNFactory.
Implements org. |
| public ATNFactory. | lexerCallCommand(GrammarAST ID, GrammarAST arg)
Implements org. |
| public ATNFactory. | |
| public ATNFactory. | |
| protected ATNFactory. | |
| public <T extends ATNState> T | |
| public ATNState | |
| public ATNState | |
| public ATNFactory. | optional(GrammarAST optAST, ATNFactory.
Implements org. (A)?
|
| public ATNFactory. | plus(GrammarAST plusAST, ATNFactory.
Implements org. (blk)+ build
|---------| v | [o-blk-o]->o->o |
| public ATNFactory. | range(GrammarAST a, GrammarAST b)
Implements org. |
| public ATNFactory. | rule(GrammarAST ruleAST, String name, ATNFactory.
Implements org. |
| public ATNFactory. | ruleRef(GrammarAST node)
Implements org. r, build
o->(r) o |
| public ATNFactory. | sempred(PredAST pred)
Implements org. |
| public ATNFactory. | set(GrammarAST associatedAST, List<GrammarAST> terminals, boolean invert)
Implements org. o->o-set->o.
|
| public void | |
| public void | |
| public ATNFactory. | star(GrammarAST starAST, ATNFactory.
Implements org. (blk)* build ( blk+ )?
|
| public ATNFactory. | stringLiteral(TerminalAST stringLiteralAST)
Implements org. |
| public ATNFactory. | tokenRef(TerminalAST node)
Implements org. A build graph o-A->o.
|
| public ATNFactory. | wildcard(GrammarAST node)
Implements org. |
| atn | back to summary |
|---|---|
| public final ATN atn | |
| currentOuterAlt | back to summary |
|---|---|
| public int currentOuterAlt | |
| currentRule | back to summary |
|---|---|
| public Rule currentRule | |
| g | back to summary |
|---|---|
| public final Grammar g | |
| preventEpsilonClosureBlocks | back to summary |
|---|---|
| protected final List<Triple<Rule, ATNState, ATNState>> preventEpsilonClosureBlocks | |
| preventEpsilonOptionalBlocks | back to summary |
|---|---|
| protected final List<Triple<Rule, ATNState, ATNState>> preventEpsilonOptionalBlocks | |
| ParserATNFactory | back to summary |
|---|---|
| public ParserATNFactory(Grammar g) | |
| _createATN | back to summary |
|---|---|
| protected void _createATN(Collection<Rule> rules) | |
| _ruleRef | back to summary |
|---|---|
| public ATNFactory. | |
| action | back to summary |
|---|---|
| public ATNFactory. Implements org. Build what amounts to an epsilon transition with an action.
The action goes into ATN though it is ignored during prediction
if
| |
| action | back to summary |
|---|---|
| public ATNFactory. Implements org.
| |
| addEOFTransitionToStartRules | back to summary |
|---|---|
| public int addEOFTransitionToStartRules() Add an EOF transition to any rule end ATNState that points to nothing (i.e., for all those rules not invoked by another rule). These are start symbols then. Return the number of grammar entry points; i.e., how many rules are not invoked by another rule (they can only be invoked from outside). These are the start rules. | |
| addFollowLink | back to summary |
|---|---|
| public void addFollowLink(int ruleIndex, ATNState right) | |
| addRuleFollowLinks | back to summary |
|---|---|
| public void addRuleFollowLinks() | |
| alt | back to summary |
|---|---|
| public ATNFactory. Implements org.
| |
| block | back to summary |
|---|---|
| public ATNFactory. Implements org. From o->o-A->o->o (last ATNState is BlockEndState pointed to by all alts) | ^ |->o-B->o--| | | ... | | | |->o-Z->o--|So start node points at every alternative with epsilon transition and every alt right side points at a block end ATNState. Special case: only one alternative: don't make a block with alt begin/end. Special case: if just a list of tokens/chars/sets, then collapse to a single edged o-set->o graph. Todo Set alt number (1..n) in the states?
| |
| blockHasWildcardAlt | back to summary |
|---|---|
| public static boolean blockHasWildcardAlt(GrammarAST block)
| |
| charSetLiteral | back to summary |
|---|---|
| public ATNFactory. Implements org.
| |
| checkEpsilonClosure | back to summary |
|---|---|
| protected void checkEpsilonClosure() | |
| createATN | back to summary |
|---|---|
| public ATN createATN() Implements org.
| |
| createRuleStartAndStopATNStates | back to summary |
|---|---|
| pack-priv void createRuleStartAndStopATNStates() Define all the rule begin/end ATNStates to solve forward reference issues. | |
| elemList | back to summary |
|---|---|
| public ATNFactory. | |
| epsilon | back to summary |
|---|---|
| public ATNFactory. Implements org. From an empty alternative build
| |
| epsilon | back to summary |
|---|---|
| protected void epsilon(ATNState a, ATNState b) | |
| epsilon | back to summary |
|---|---|
| protected void epsilon(ATNState a, ATNState b, boolean prepend) | |
| expectNonGreedy | back to summary |
|---|---|
| public boolean expectNonGreedy(BlockAST blkAST) | |
| getTokenType | back to summary |
|---|---|
| protected int getTokenType(GrammarAST atom) | |
| label | back to summary |
|---|---|
| public ATNFactory. Implements org.
| |
| lexerAltCommands | back to summary |
|---|---|
| public ATNFactory. Implements org.
| |
| lexerCallCommand | back to summary |
|---|---|
| public ATNFactory. Implements org.
| |
| lexerCommand | back to summary |
|---|---|
| public ATNFactory. Implements org.
| |
| listLabel | back to summary |
|---|---|
| public ATNFactory. Implements org.
| |
| makeBlock | back to summary |
|---|---|
| protected ATNFactory. | |
| newState | back to summary |
|---|---|
| public <T extends ATNState> T newState(Class<T> nodeType, GrammarAST node) | |
| newState | back to summary |
|---|---|
| public ATNState newState(GrammarAST node) | |
| newState | back to summary |
|---|---|
| public ATNState newState() Implements org.
| |
| optional | back to summary |
|---|---|
| public ATNFactory. Implements org. From o--A->o | ^ o---->|or, if A is a block, just add an empty alt to the end of the
block
| |
| plus | back to summary |
|---|---|
| public ATNFactory. Implements org. From |---------| v | [o-blk-o]->o->oWe add a decision for loop back node to the existing one at blk
start.
| |
| range | back to summary |
|---|---|
| public ATNFactory. Implements org. Not valid for non-lexers.
| |
| rule | back to summary |
|---|---|
| public ATNFactory. Implements org.
| |
| ruleRef | back to summary |
|---|---|
| public ATNFactory. Implements org. For reference to rule o->(r) owhere (r) is the start of rule r and the trailing
o is not linked to from rule ref state directly (uses
RuleTransition#followState).
| |
| sempred | back to summary |
|---|---|
| public ATNFactory. Implements org. Build what amounts to an epsilon transition with a semantic
predicate action. The
| |
| set | back to summary |
|---|---|
| public ATNFactory. Implements org. From set build single edge graph
| |
| setCurrentOuterAlt | back to summary |
|---|---|
| public void setCurrentOuterAlt(int alt) Implements org.
| |
| setCurrentRuleName | back to summary |
|---|---|
| public void setCurrentRuleName(String name) Implements org.
| |
| star | back to summary |
|---|---|
| public ATNFactory. Implements org. From |-------------| v | o--[o-blk-o]->o o | ^ -----------------|Note that the optional bypass must jump outside the loop as (A|B)* is not the same thing as (A|B|)+.
| |
| stringLiteral | back to summary |
|---|---|
| public ATNFactory. Implements org. For a non-lexer, just build a simple token reference atom.
| |
| tokenRef | back to summary |
|---|---|
| public ATNFactory. Implements org. From label
| |
| wildcard | back to summary |
|---|---|
| public ATNFactory. Implements org. Build an atom with all possible values in its label.
| |