| Modifier and Type | Field and Description |
|---|---|
| public static final Set | |
| public GrammarRootAST | |
| public ATN | atn
The ATN that represents the grammar with edges labelled with tokens or epsilon. |
| public static final String | |
| public static final String | |
| public final Map | channelNameToValueMap
Map channel like |
| public final List | channelValueToNameList
Map a constant channel value to its name. |
| public Map | |
| public List | |
| public static final Set | |
| public String | |
| public static final String | |
| public static final Map | |
| public LexerGrammar | implicitLexer
Was this parser grammar created from a COMBINED grammar? |
| public List | |
| public LinkedHashMap | indexToPredMap
Map the other direction upon demand |
| public List | |
| public static final String | INVALID_RULE_NAME
This value is used as the name for elements in the array returned by
|
| public static final String | INVALID_TOKEN_NAME
This value is used in the following situations to indicate that a token type does not have an associated name which can be directly referenced in a grammar. |
| public LinkedHashMap | lexerActions
Tracks all user lexer actions in all alternatives of all rules. |
| public static final Set | |
| public static final Set | |
| public static final Set | |
| pack-priv int | maxChannelType
The maximum channel value which is assigned by this grammar. |
| pack-priv int | maxTokenType
Token names and literal tokens like "void" are uniquely indexed. |
| public String | |
| public Map | namedActions
Map a name to an action. |
| public Grammar | originalGrammar
If this is an extracted/implicit lexer, we point at original grammar |
| public TokenStream | originalTokenStream
If we transform grammar, track original unaltered token stream. |
| public Grammar | parent
If we're imported, who imported us? |
| public static final Set | |
| public static final Set | |
| public static final Set | |
| pack-priv int | |
| public static final Set | ruleRefOptions
Legal options for rule refs like id<key=value> |
| public OrderedHashMap | rules
All rules defined in this specific grammar, not imported. |
| public static final Set | |
| public LinkedHashMap | sempreds
All sempreds found in grammar; maps tree node to sempred index; sempred index is 0..n-1 |
| public Map | |
| pack-priv int | |
| public final Map | stringLiteralToTypeMap
Map token literals like |
| public String | |
| public final Map | tokenNameToTypeMap
Map token like |
| public static final Set | tokenOptions
Legal options for terminal refs like ID<assoc=right> |
| public final TokenStream | tokenStream
Track token stream used to create this grammar |
| public final Tool | |
| public final List | typeToStringLiteralList
Reverse index for |
| public final List | typeToTokenList
Map a token type to its token name. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public | |
| public | Grammar(String fileName, String grammarText, ANTLRToolListener listener)
For testing; builds trees, does sem anal |
| public | Grammar(String fileName, String grammarText, Grammar tokenVocabSource, ANTLRToolListener listener)
For testing; builds trees, does sem anal |
| Modifier and Type | Method and Description |
|---|---|
| public GrammarParserInterpreter | |
| public LexerInterpreter | |
| public ParserInterpreter | |
| protected static boolean | defAlias(GrammarAST r, String pattern, TreeWizard wiz, List<Pair<GrammarAST, GrammarAST>> lexerRuleToStringLiteral)
|
| public void | |
| public int | Returns: The constant channel value assigned to the channel.The channel name. name)Define a token channel with a specified name. |
| public int | Returns: The constant channel value assigned to the channel.The channel name. name, int value)Define a token channel with a specified name. |
| public boolean | Returns: true if the rule was added to the Grammar
instance; otherwise, false if a rule with this name already
existed in the grammar instance.The rule to define in the grammar. r)Define the specified rule in the grammar. |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public IntSet | |
| public List | |
| public ATN | |
| public int | Returns: The channel value, ifchannel is the name of a known
user-defined token channel; otherwise, -1.The channel name. channel)Gets the constant channel value for a user-defined channel. |
| public String | |
| public List | |
| public static String | |
| public LexerGrammar | |
| public Grammar | |
| public List | |
| public LinkedHashMap | |
| public String | |
| public int | |
| public int | |
| public int | |
| public int | |
| public String | |
| public Grammar | |
| public String | |
| public String | getRecognizerName()
Get the name of the generated recognizer; may or may not be same as grammar name. |
| public Rule | |
| public Rule | |
| public Rule | |
| public String[] | Returns: The names of all rules defined in the grammar.Gets an array of rule names for rules defined or imported by the grammar. |
| public String | getSemanticContextDisplayString(SemanticContext semctx)
Given an arbitrarily complex SemanticContext, walk the "tree" and get display string. |
| public Interval | getStateToGrammarRegion(int atnStateNumber)
Given an ATN state number, return the token index range within the grammar from which that ATN state was derived. |
| public static Map | |
| public static List | getStringLiteralAliasesFromLexerRules(GrammarRootAST ast)
Return list of (TOKEN_NAME node, 'literal' node) pairs |
| public String | |
| public Set | |
| public String | getTokenDisplayName(int ttype)
Given a token type, get a meaningful name for it such as the ID or string literal. |
| public String[] | Returns: The display names of all tokens defined in the grammar.Gets an array of display names for tokens defined or imported by the grammar. |
| public String[] | |
| public String | |
| public String | Returns: The name of the token with the specified type.The token type. ttype)Gets the name by which a token can be referenced in the generated code. |
| public String[] | Returns: The token names of all tokens defined in the grammar.Gets an array of token names for tokens defined or imported by the grammar. |
| public TokenStream | |
| public String[] | |
| public int | |
| public IntSet | |
| public int | |
| public String | |
| public Vocabulary | |
| public void | |
| public void | |
| protected void | |
| public boolean | |
| public boolean | |
| public boolean | |
| public static boolean | |
| public String | |
| public static Grammar | |
| public void | |
| private void | |
| public boolean | |
| public boolean | resolvesToLabel(String x, ActionAST node)
Implements org. |
| public boolean | resolvesToListLabel(String x, ActionAST node)
Implements org. |
| public boolean | resolvesToToken(String x, ActionAST node)
Implements org. |
| public Attribute | resolveToAttribute(String x, ActionAST node)
Implements org. |
| public Attribute | resolveToAttribute(String x, String y, ActionAST node)
Implements org. |
| public void | setChannelNameForValue(int
The constant value for the channel. channelValue, String The channel name. name)Sets the channel name associated with a particular channel value. |
| public void | |
| public static void | setNodeOptions(GrammarAST node, GrammarAST options)
Given ^(TOKEN_REF ^(OPTIONS ^(ELEMENT_OPTIONS (= assoc right)))) set option assoc=right in TOKEN_REF. |
| public void | |
| public boolean | Returns: true if the rule was removed from the Grammar
instance; otherwise, false if the specified rule was not defined
in the grammar.Undefine the specified rule from this |