public class LexerATNFactory extends ParserATNFactory
ATNFactory.Handle | Modifier and Type | Field and Description |
|---|---|
protected Map |
actionToIndexMap
Maps from a
LexerAction object to the action index.
|
STGroup |
codegenTemplates
|
static Map |
COMMON_CONSTANTS
Provides a map of names of predefined constants which are likely to appear as the argument for lexer commands.
|
protected Map |
indexToActionMap
Maps from an action index to a
LexerAction object.
|
atn, currentOuterAlt, currentRule, g, preventEpsilonClosureBlocks, preventEpsilonOptionalBlocks| Constructor and Description |
|---|
LexerATNFactory(LexerGrammar
|
| Modifier and Type | Method and Description |
|---|---|
ATNFactory |
action(ActionAST
Build what amounts to an epsilon transition with an action.
|
protected ATNFactory |
action(GrammarAST
|
ATNFactory |
action(String
|
ATNFactory |
charSetLiteral(GrammarAST
[Aa\t ሴa-z\]\-] char sets
|
protected void |
checkChannel(String
|
protected void |
checkMode(String
|
protected void |
checkToken(String
|
ATN |
createATN()
|
protected LexerAction |
createLexerAction(GrammarAST
|
static Set |
getCommonConstants()
|
protected Integer |
getConstantValue(String
|
protected int |
getLexerActionIndex(LexerAction lexerAction)
|
IntervalSet |
getSetFromCharSetLiteral(GrammarAST
|
ATNFactory |
lexerAltCommands(ATNFactory
|
ATNFactory |
lexerCallCommand(GrammarAST
|
ATNFactory |
lexerCommand(GrammarAST
|
ATNFactory |
range(GrammarAST
Not valid for non-lexers.
|
ATNFactory |
set(GrammarAST
From set build single edge graph
o->o-set->o.
|
ATNFactory |
stringLiteral(TerminalAST
For a lexer, a string is a sequence of char to match.
|
ATNFactory |
tokenRef(TerminalAST
From label
A build graph
o-A->o.
|
_createATN, _ruleRef, addEOFTransitionToStartRules, addFollowLink, addRuleFollowLinks, alt, block, blockHasWildcardAlt, elemList, epsilon, epsilon, epsilon, expectNonGreedy, getTokenType, label, listLabel, makeBlock, newState, newState, newState, optional, plus, rule, ruleRef, sempred, setCurrentOuterAlt, setCurrentRuleName, star, wildcardpublic STGroup codegenTemplates
public static final Map<String ,Integer > COMMON_CONSTANTS
LexerAction instances that are usable by a lexer interpreter.
protected Map<Integer ,LexerAction > indexToActionMap
LexerAction object.
public LexerATNFactory(LexerGrammarg)
public ATN createATN()
public ATNFactory.Handle action(ActionAST action)
ParserATNFactory
actionIndex
<0.
protected int getLexerActionIndex(LexerAction lexerAction)
public ATNFactory.Handle action(String action)
protected ATNFactory.Handle action(GrammarAST node, LexerAction lexerAction)
public ATNFactory.Handle lexerAltCommands(ATNFactory .Handle alt, ATNFactory .Handle cmds)
public ATNFactory.Handle lexerCallCommand(GrammarAST ID, GrammarAST arg)
public ATNFactory.Handle lexerCommand(GrammarAST ID)
public ATNFactory.Handle range(GrammarAST a, GrammarAST b)
ParserATNFactory
public ATNFactory.Handle set(GrammarAST associatedAST, List <GrammarAST > alts, boolean invert)
ParserATNFactory
o->o-set->o. To conform to what an alt block looks like, must have extra state on left. This also handles
~A, converted to
~{A} set.
public ATNFactory.Handle stringLiteral(TerminalAST stringLiteralAST)
public ATNFactory.Handle charSetLiteral(GrammarAST charSetAST)
public IntervalSet getSetFromCharSetLiteral(GrammarASTcharSetAST)
public ATNFactory.Handle tokenRef(TerminalAST node)
ParserATNFactory
A build graph
o-A->o.
protected LexerAction createLexerAction(GrammarASTID, GrammarAST arg)
protected void checkMode(StringmodeName, Token token)
protected void checkToken(StringtokenName, Token token)
protected void checkChannel(StringchannelName, Token token)