public class ANTLRParser extends antlr.LLkParser implements ANTLRTokenTypes
Modifier and Type | Field and Description |
---|---|
static String[] |
_tokenNames |
static antlr.collections.impl.BitSet |
_tokenSet_0 |
static antlr.collections.impl.BitSet |
_tokenSet_1 |
static antlr.collections.impl.BitSet |
_tokenSet_10 |
static antlr.collections.impl.BitSet |
_tokenSet_11 |
static antlr.collections.impl.BitSet |
_tokenSet_12 |
static antlr.collections.impl.BitSet |
_tokenSet_13 |
static antlr.collections.impl.BitSet |
_tokenSet_14 |
static antlr.collections.impl.BitSet |
_tokenSet_15 |
static antlr.collections.impl.BitSet |
_tokenSet_16 |
static antlr.collections.impl.BitSet |
_tokenSet_17 |
static antlr.collections.impl.BitSet |
_tokenSet_18 |
static antlr.collections.impl.BitSet |
_tokenSet_19 |
static antlr.collections.impl.BitSet |
_tokenSet_2 |
static antlr.collections.impl.BitSet |
_tokenSet_20 |
static antlr.collections.impl.BitSet |
_tokenSet_21 |
static antlr.collections.impl.BitSet |
_tokenSet_22 |
static antlr.collections.impl.BitSet |
_tokenSet_23 |
static antlr.collections.impl.BitSet |
_tokenSet_24 |
static antlr.collections.impl.BitSet |
_tokenSet_25 |
static antlr.collections.impl.BitSet |
_tokenSet_26 |
static antlr.collections.impl.BitSet |
_tokenSet_27 |
static antlr.collections.impl.BitSet |
_tokenSet_28 |
static antlr.collections.impl.BitSet |
_tokenSet_29 |
static antlr.collections.impl.BitSet |
_tokenSet_3 |
static antlr.collections.impl.BitSet |
_tokenSet_30 |
static antlr.collections.impl.BitSet |
_tokenSet_31 |
static antlr.collections.impl.BitSet |
_tokenSet_32 |
static antlr.collections.impl.BitSet |
_tokenSet_33 |
static antlr.collections.impl.BitSet |
_tokenSet_34 |
static antlr.collections.impl.BitSet |
_tokenSet_35 |
static antlr.collections.impl.BitSet |
_tokenSet_36 |
static antlr.collections.impl.BitSet |
_tokenSet_37 |
static antlr.collections.impl.BitSet |
_tokenSet_38 |
static antlr.collections.impl.BitSet |
_tokenSet_39 |
static antlr.collections.impl.BitSet |
_tokenSet_4 |
static antlr.collections.impl.BitSet |
_tokenSet_40 |
static antlr.collections.impl.BitSet |
_tokenSet_41 |
static antlr.collections.impl.BitSet |
_tokenSet_42 |
static antlr.collections.impl.BitSet |
_tokenSet_43 |
static antlr.collections.impl.BitSet |
_tokenSet_44 |
static antlr.collections.impl.BitSet |
_tokenSet_45 |
static antlr.collections.impl.BitSet |
_tokenSet_46 |
static antlr.collections.impl.BitSet |
_tokenSet_47 |
static antlr.collections.impl.BitSet |
_tokenSet_48 |
static antlr.collections.impl.BitSet |
_tokenSet_49 |
static antlr.collections.impl.BitSet |
_tokenSet_5 |
static antlr.collections.impl.BitSet |
_tokenSet_50 |
static antlr.collections.impl.BitSet |
_tokenSet_51 |
static antlr.collections.impl.BitSet |
_tokenSet_6 |
static antlr.collections.impl.BitSet |
_tokenSet_7 |
static antlr.collections.impl.BitSet |
_tokenSet_8 |
static antlr.collections.impl.BitSet |
_tokenSet_9 |
protected boolean |
atTreeRoot |
protected GrammarAST |
currentBlockAST |
protected String |
currentRuleName |
protected Grammar |
grammar |
protected int |
gtype |
astFactory, inputState, returnAST, tokenNames, tokenTypeToASTClassMap, traceDepth
ACTION, ACTION_CHAR_LITERAL, ACTION_ESC, ACTION_STRING_LITERAL, ALT, AMPERSAND, ARG, ARG_ACTION, ARGLIST, ASSIGN, BACKTRACK_SEMPRED, BANG, BLOCK, CHAR_LITERAL, CHAR_RANGE, CLOSE_ELEMENT_OPTION, CLOSURE, COLON, COMBINED_GRAMMAR, COMMA, COMMENT, DIGIT, DOC_COMMENT, DOLLAR, DOT, DOUBLE_ANGLE_STRING_LITERAL, DOUBLE_QUOTE_STRING_LITERAL, EOA, EOB, EOF, EOR, EPSILON, ESC, ETC, FORCED_ACTION, FRAGMENT, GATED_SEMPRED, ID, IMPLIES, IMPORT, INITACTION, INT, INTERNAL_RULE_REF, LABEL, LEXER, LEXER_GRAMMAR, LITERAL_catch, LITERAL_finally, LITERAL_grammar, LITERAL_lexer, LITERAL_private, LITERAL_protected, LITERAL_public, LITERAL_returns, LITERAL_throws, LITERAL_tree, LPAREN, ML_COMMENT, NESTED_ACTION, NESTED_ARG_ACTION, NOT, NULL_TREE_LOOKAHEAD, OPEN_ELEMENT_OPTION, OPTIONAL, OPTIONS, OR, PARSER, PARSER_GRAMMAR, PLUS, PLUS_ASSIGN, POSITIVE_CLOSURE, QUESTION, RANGE, RCURLY, RET, REWRITE, ROOT, RPAREN, RULE, RULE_REF, SCOPE, SEMI, SEMPRED, SL_COMMENT, SRC, STAR, STRAY_BRACKET, STRING_LITERAL, SYN_SEMPRED, SYNPRED, TEMPLATE, TOKEN_REF, TOKENS, TREE_BEGIN, TREE_GRAMMAR, WILDCARD, WS, WS_LOOP, WS_OPT, XDIGIT
Modifier | Constructor and Description |
---|---|
|
ANTLRParser(antlr.ParserSharedInputState state) |
|
ANTLRParser(antlr.TokenBuffer tokenBuf) |
protected |
ANTLRParser(antlr.TokenBuffer tokenBuf,
int k) |
|
ANTLRParser(antlr.TokenStream lexer) |
protected |
ANTLRParser(antlr.TokenStream lexer,
int k) |
Modifier and Type | Method and Description |
---|---|
void |
action()
Match stuff like @parser::members {int i;}
|
void |
actions() |
void |
actionScopeName()
Sometimes the scope names will collide with keywords; allow them as
ids for action scopes.
|
void |
alternative() |
void |
altList(Map opts) |
void |
atom() |
void |
attrScope() |
void |
attrScopes() |
void |
block()
Build #(BLOCK ( #(ALT ...) EOB )+ )
|
protected void |
buildTokenTypeASTClassMap() |
void |
cleanup(GrammarAST root) |
protected GrammarAST |
createBlockFromDupAlt(GrammarAST alt)
Create a copy of the alt and make it into a BLOCK; all actions,
labels, tree operators, rewrites are removed.
|
GrammarAST |
createSimpleRuleAST(String name,
GrammarAST block,
boolean fragment) |
protected GrammarAST |
createSynSemPredFromBlock(GrammarAST synpredBlockAST,
int synpredTokenType) |
void |
defaultNodeOption(GrammarAST terminalAST) |
void |
delegateGrammar() |
void |
delegateGrammars() |
void |
ebnf()
matches ENBF blocks (and sets via block rule)
|
GrammarAST |
ebnfSuffix(GrammarAST elemAST,
boolean inRewrite) |
void |
element() |
void |
elementNoOptionSpec() |
void |
elementOption(GrammarAST terminalAST) |
void |
elementOptions(GrammarAST terminalAST) |
void |
exceptionGroup() |
void |
exceptionHandler() |
void |
finallyClause() |
Grammar |
getGrammar() |
int |
getGtype() |
void |
grammar(Grammar g) |
void |
grammarType() |
void |
id() |
void |
idList() |
void |
notSet() |
void |
notTerminal() |
void |
option(Map opts) |
Map |
optionsSpec() |
Object |
optionValue() |
protected void |
prefixWithSynPred(GrammarAST alt)
Rewrite alt to have a synpred as first element;
(xxx)=>xxx
but only if they didn't specify one manually.
|
void |
range() |
void |
reportError(antlr.RecognitionException ex) |
void |
rewrite_alternative() |
void |
rewrite_atom() |
void |
rewrite_block() |
void |
rewrite_ebnf() |
void |
rewrite_element() |
void |
rewrite_indirect_template_head()
-> ({expr})(a={...}, ...)
|
void |
rewrite_template_arg() |
void |
rewrite_template_args() |
void |
rewrite_template_head()
-> foo(a={...}, ...)
|
void |
rewrite_template()
Build a tree for a template rewrite:
^(TEMPLATE (ID|ACTION) ^(ARGLIST ^(ARG ID ACTION) ...) )
where ARGLIST is always there even if no args exist.
|
void |
rewrite_tree() |
void |
rewrite() |
void |
rule() |
void |
ruleAction()
Match stuff like @init {int i;}
|
void |
ruleActions() |
void |
ruleref() |
void |
rules() |
void |
ruleScopeSpec() |
void |
setGrammar(Grammar grammar) |
void |
setGtype(int gtype) |
protected GrammarAST |
setToBlockWithSet(GrammarAST b) |
void |
terminal() |
void |
throwsSpec() |
void |
tokenSpec() |
void |
tokensSpec() |
void |
tree() |
void |
treeRoot() |
addMessageListener, addParserListener, addParserMatchListener, addParserTokenListener, addSemanticPredicateListener, addSyntacticPredicateListener, addTraceListener, consumeUntil, consumeUntil, defaultDebuggingSetup, getAST, getASTFactory, getFilename, getInputState, getTokenName, getTokenNames, getTokenTypeToASTClassMap, isDebugMode, mark, match, match, matchNot, panic, recover, removeMessageListener, removeParserListener, removeParserMatchListener, removeParserTokenListener, removeSemanticPredicateListener, removeSyntacticPredicateListener, removeTraceListener, reportError, reportWarning, rewind, setASTFactory, setASTNodeClass, setASTNodeType, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIndent
protected Grammar grammar
protected int gtype
protected String currentRuleName
protected GrammarAST currentBlockAST
protected boolean atTreeRoot
public static final String[] _tokenNames
public static final antlr.collections.impl.BitSet _tokenSet_0
public static final antlr.collections.impl.BitSet _tokenSet_1
public static final antlr.collections.impl.BitSet _tokenSet_2
public static final antlr.collections.impl.BitSet _tokenSet_3
public static final antlr.collections.impl.BitSet _tokenSet_4
public static final antlr.collections.impl.BitSet _tokenSet_5
public static final antlr.collections.impl.BitSet _tokenSet_6
public static final antlr.collections.impl.BitSet _tokenSet_7
public static final antlr.collections.impl.BitSet _tokenSet_8
public static final antlr.collections.impl.BitSet _tokenSet_9
public static final antlr.collections.impl.BitSet _tokenSet_10
public static final antlr.collections.impl.BitSet _tokenSet_11
public static final antlr.collections.impl.BitSet _tokenSet_12
public static final antlr.collections.impl.BitSet _tokenSet_13
public static final antlr.collections.impl.BitSet _tokenSet_14
public static final antlr.collections.impl.BitSet _tokenSet_15
public static final antlr.collections.impl.BitSet _tokenSet_16
public static final antlr.collections.impl.BitSet _tokenSet_17
public static final antlr.collections.impl.BitSet _tokenSet_18
public static final antlr.collections.impl.BitSet _tokenSet_19
public static final antlr.collections.impl.BitSet _tokenSet_20
public static final antlr.collections.impl.BitSet _tokenSet_21
public static final antlr.collections.impl.BitSet _tokenSet_22
public static final antlr.collections.impl.BitSet _tokenSet_23
public static final antlr.collections.impl.BitSet _tokenSet_24
public static final antlr.collections.impl.BitSet _tokenSet_25
public static final antlr.collections.impl.BitSet _tokenSet_26
public static final antlr.collections.impl.BitSet _tokenSet_27
public static final antlr.collections.impl.BitSet _tokenSet_28
public static final antlr.collections.impl.BitSet _tokenSet_29
public static final antlr.collections.impl.BitSet _tokenSet_30
public static final antlr.collections.impl.BitSet _tokenSet_31
public static final antlr.collections.impl.BitSet _tokenSet_32
public static final antlr.collections.impl.BitSet _tokenSet_33
public static final antlr.collections.impl.BitSet _tokenSet_34
public static final antlr.collections.impl.BitSet _tokenSet_35
public static final antlr.collections.impl.BitSet _tokenSet_36
public static final antlr.collections.impl.BitSet _tokenSet_37
public static final antlr.collections.impl.BitSet _tokenSet_38
public static final antlr.collections.impl.BitSet _tokenSet_39
public static final antlr.collections.impl.BitSet _tokenSet_40
public static final antlr.collections.impl.BitSet _tokenSet_41
public static final antlr.collections.impl.BitSet _tokenSet_42
public static final antlr.collections.impl.BitSet _tokenSet_43
public static final antlr.collections.impl.BitSet _tokenSet_44
public static final antlr.collections.impl.BitSet _tokenSet_45
public static final antlr.collections.impl.BitSet _tokenSet_46
public static final antlr.collections.impl.BitSet _tokenSet_47
public static final antlr.collections.impl.BitSet _tokenSet_48
public static final antlr.collections.impl.BitSet _tokenSet_49
public static final antlr.collections.impl.BitSet _tokenSet_50
public static final antlr.collections.impl.BitSet _tokenSet_51
protected ANTLRParser(antlr.TokenBuffer tokenBuf, int k)
public ANTLRParser(antlr.TokenBuffer tokenBuf)
protected ANTLRParser(antlr.TokenStream lexer, int k)
public ANTLRParser(antlr.TokenStream lexer)
public ANTLRParser(antlr.ParserSharedInputState state)
public Grammar getGrammar()
public void setGrammar(Grammar grammar)
public int getGtype()
public void setGtype(int gtype)
protected GrammarAST setToBlockWithSet(GrammarAST b)
protected GrammarAST createBlockFromDupAlt(GrammarAST alt)
protected void prefixWithSynPred(GrammarAST alt)
protected GrammarAST createSynSemPredFromBlock(GrammarAST synpredBlockAST, int synpredTokenType)
public GrammarAST createSimpleRuleAST(String name, GrammarAST block, boolean fragment)
public void reportError(antlr.RecognitionException ex)
reportError
in class antlr.Parser
public void cleanup(GrammarAST root)
public final void grammar(Grammar g) throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void grammarType() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void id() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final Map optionsSpec() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void delegateGrammars() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void tokensSpec() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void attrScopes() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void actions() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void rules() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void action() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void actionScopeName() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void option(Map opts) throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final Object optionValue() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void delegateGrammar() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void tokenSpec() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void attrScope() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void rule() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void throwsSpec() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void ruleScopeSpec() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void ruleActions() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void altList(Map opts) throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void exceptionGroup() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void ruleAction() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void idList() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void block() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void alternative() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void rewrite() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void element() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void exceptionHandler() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void finallyClause() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void elementNoOptionSpec() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void atom() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final GrammarAST ebnfSuffix(GrammarAST elemAST, boolean inRewrite) throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void ebnf() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void tree() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void range() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void terminal() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void ruleref() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void notSet() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void notTerminal() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void treeRoot() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void elementOptions(GrammarAST terminalAST) throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void defaultNodeOption(GrammarAST terminalAST) throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void elementOption(GrammarAST terminalAST) throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void rewrite_alternative() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void rewrite_block() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void rewrite_template() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void rewrite_element() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void rewrite_atom() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void rewrite_ebnf() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void rewrite_tree() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void rewrite_template_head() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void rewrite_indirect_template_head() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void rewrite_template_args() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public final void rewrite_template_arg() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
protected void buildTokenTypeASTClassMap()
Copyright © 2020. All rights reserved.