| org.antlr.tool.ANTLRParser
ANTLRParser | public class ANTLRParser extends antlr.LLkParser implements ANTLRTokenTypes(Code) | | Read in an ANTLR grammar and build an AST. Try not to do
any actions, just build the tree.
The phases are:
antlr.g (this file)
assign.types.g
define.g
buildnfa.g
antlr.print.g (optional)
codegen.g
Terence Parr
University of San Francisco
2005
|
gtype | protected int gtype(Code) | | |
ANTLRParser | protected ANTLRParser(TokenBuffer tokenBuf, int k)(Code) | | |
ANTLRParser | public ANTLRParser(TokenBuffer tokenBuf)(Code) | | |
ANTLRParser | protected ANTLRParser(TokenStream lexer, int k)(Code) | | |
ANTLRParser | public ANTLRParser(TokenStream lexer)(Code) | | |
ANTLRParser | public ANTLRParser(ParserSharedInputState state)(Code) | | |
action | final public void action() throws RecognitionException, TokenStreamException(Code) | | Match stuff like @parser::members {int i;}
|
actionScopeName | final public void actionScopeName() throws RecognitionException, TokenStreamException(Code) | | Sometimes the scope names will collide with keywords; allow them as
ids for action scopes.
|
actions | final public void actions() throws RecognitionException, TokenStreamException(Code) | | |
altList | final public void altList(Map opts) throws RecognitionException, TokenStreamException(Code) | | |
alternative | final public void alternative() throws RecognitionException, TokenStreamException(Code) | | |
atom | final public void atom() throws RecognitionException, TokenStreamException(Code) | | |
attrScope | final public void attrScope() throws RecognitionException, TokenStreamException(Code) | | |
attrScopes | final public void attrScopes() throws RecognitionException, TokenStreamException(Code) | | |
block | final public void block() throws RecognitionException, TokenStreamException(Code) | | Build #(BLOCK ( #(ALT ...) EOB )+ )
|
buildTokenTypeASTClassMap | protected void buildTokenTypeASTClassMap()(Code) | | |
createBlockFromDupAlt | protected GrammarAST createBlockFromDupAlt(GrammarAST alt)(Code) | | Create a copy of the alt and make it into a BLOCK; all actions,
labels, tree operators, rewrites are removed.
|
ebnf | final public void ebnf() throws RecognitionException, TokenStreamException(Code) | | matches ENBF blocks (and sets via block rule)
|
ebnfSuffix | final public GrammarAST ebnfSuffix(GrammarAST elemAST, boolean inRewrite) throws RecognitionException, TokenStreamException(Code) | | |
element | final public void element() throws RecognitionException, TokenStreamException(Code) | | |
elementNoOptionSpec | final public void elementNoOptionSpec() throws RecognitionException, TokenStreamException(Code) | | |
exceptionGroup | final public void exceptionGroup() throws RecognitionException, TokenStreamException(Code) | | |
exceptionHandler | final public void exceptionHandler() throws RecognitionException, TokenStreamException(Code) | | |
finallyClause | final public void finallyClause() throws RecognitionException, TokenStreamException(Code) | | |
getLexerRuleNames | public List getLexerRuleNames()(Code) | | |
grammar | final public void grammar(Grammar g) throws RecognitionException, TokenStreamException(Code) | | |
grammarType | final public void grammarType() throws RecognitionException, TokenStreamException(Code) | | |
id | final public void id() throws RecognitionException, TokenStreamException(Code) | | |
idList | final public void idList() throws RecognitionException, TokenStreamException(Code) | | |
idToken | final public void idToken() throws RecognitionException, TokenStreamException(Code) | | Match anything that looks like an ID and return tree as token type ID
|
notSet | final public void notSet() throws RecognitionException, TokenStreamException(Code) | | |
notTerminal | final public void notTerminal() throws RecognitionException, TokenStreamException(Code) | | |
option | final public void option(Map opts) throws RecognitionException, TokenStreamException(Code) | | |
optionValue | final public Object optionValue() throws RecognitionException, TokenStreamException(Code) | | |
optionsSpec | final public Map optionsSpec() throws RecognitionException, TokenStreamException(Code) | | |
prefixWithSynPred | protected void prefixWithSynPred(GrammarAST alt)(Code) | | Rewrite alt to have a synpred as first element;
(xxx)=>xxx
but only if they didn't specify one manually.
|
range | final public void range() throws RecognitionException, TokenStreamException(Code) | | |
reportError | public void reportError(RecognitionException ex)(Code) | | |
rewrite | final public void rewrite() throws RecognitionException, TokenStreamException(Code) | | |
rewrite_alternative | final public void rewrite_alternative() throws RecognitionException, TokenStreamException(Code) | | |
rewrite_atom | final public void rewrite_atom() throws RecognitionException, TokenStreamException(Code) | | |
rewrite_block | final public void rewrite_block() throws RecognitionException, TokenStreamException(Code) | | |
rewrite_ebnf | final public void rewrite_ebnf() throws RecognitionException, TokenStreamException(Code) | | |
rewrite_element | final public void rewrite_element() throws RecognitionException, TokenStreamException(Code) | | |
rewrite_indirect_template_head | final public void rewrite_indirect_template_head() throws RecognitionException, TokenStreamException(Code) | | -> ({expr})(a={...}, ...)
|
rewrite_template | final public void rewrite_template() throws RecognitionException, TokenStreamException(Code) | | Build a tree for a template rewrite:
^(TEMPLATE (ID|ACTION) ^(ARGLIST ^(ARG ID ACTION) ...) )
where ARGLIST is always there even if no args exist.
ID can be "template" keyword. If first child is ACTION then it's
an indirect template ref
-> foo(a={...}, b={...})
-> ({string-e})(a={...}, b={...}) // e evaluates to template name
-> {%{$ID.text}} // create literal template from string (done in ActionTranslator)
-> {st-expr} // st-expr evaluates to ST
|
rewrite_template_arg | final public void rewrite_template_arg() throws RecognitionException, TokenStreamException(Code) | | |
rewrite_template_args | final public void rewrite_template_args() throws RecognitionException, TokenStreamException(Code) | | |
rewrite_template_head | final public void rewrite_template_head() throws RecognitionException, TokenStreamException(Code) | | -> foo(a={...}, ...)
|
rewrite_tree | final public void rewrite_tree() throws RecognitionException, TokenStreamException(Code) | | |
rule | final public void rule() throws RecognitionException, TokenStreamException(Code) | | |
ruleAction | final public void ruleAction() throws RecognitionException, TokenStreamException(Code) | | Match stuff like @init {int i;}
|
ruleActions | final public void ruleActions() throws RecognitionException, TokenStreamException(Code) | | |
ruleScopeSpec | final public void ruleScopeSpec() throws RecognitionException, TokenStreamException(Code) | | |
rules | final public void rules() throws RecognitionException, TokenStreamException(Code) | | |
terminal | final public void terminal() throws RecognitionException, TokenStreamException(Code) | | |
throwsSpec | final public void throwsSpec() throws RecognitionException, TokenStreamException(Code) | | |
tokenSpec | final public void tokenSpec() throws RecognitionException, TokenStreamException(Code) | | |
tokensSpec | final public void tokensSpec() throws RecognitionException, TokenStreamException(Code) | | |
tree | final public void tree() throws RecognitionException, TokenStreamException(Code) | | |
|
|