Package org.antlr.tool
Class CompositeGrammarTree
- java.lang.Object
-
- org.antlr.tool.CompositeGrammarTree
-
public class CompositeGrammarTree extends Object
A tree of grammars
-
-
Field Summary
Fields Modifier and Type Field Description protected List<CompositeGrammarTree>
children
Grammar
grammar
CompositeGrammarTree
parent
Who is the parent node of this node; if null, implies node is root
-
Constructor Summary
Constructors Constructor Description CompositeGrammarTree(Grammar g)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_getPostOrderedGrammarList(List<Grammar> grammars)
work for getPostOrderedGrammarListprotected void
_getPreOrderedGrammarList(List<Grammar> grammars)
void
addChild(CompositeGrammarTree t)
CompositeGrammarTree
findNode(String grammarName)
CompositeGrammarTree
findNode(Grammar g)
Object
getOption(String key)
Find an option by looking up towards the root grammar rather than downList<Grammar>
getPostOrderedGrammarList()
Return a postorder list of grammars; root is last in listList<Grammar>
getPreOrderedGrammarList()
Return a preorder list of grammars; root is first in listRule
getRule(String ruleName)
Find a rule by looking in current grammar then down towards the delegate grammars.void
trimLexerImportsIntoCombined()
-
-
-
Field Detail
-
children
protected List<CompositeGrammarTree> children
-
grammar
public Grammar grammar
-
parent
public CompositeGrammarTree parent
Who is the parent node of this node; if null, implies node is root
-
-
Constructor Detail
-
CompositeGrammarTree
public CompositeGrammarTree(Grammar g)
-
-
Method Detail
-
addChild
public void addChild(CompositeGrammarTree t)
-
getRule
public Rule getRule(String ruleName)
Find a rule by looking in current grammar then down towards the delegate grammars.
-
getOption
public Object getOption(String key)
Find an option by looking up towards the root grammar rather than down
-
findNode
public CompositeGrammarTree findNode(Grammar g)
-
findNode
public CompositeGrammarTree findNode(String grammarName)
-
getPostOrderedGrammarList
public List<Grammar> getPostOrderedGrammarList()
Return a postorder list of grammars; root is last in list
-
_getPostOrderedGrammarList
protected void _getPostOrderedGrammarList(List<Grammar> grammars)
work for getPostOrderedGrammarList
-
getPreOrderedGrammarList
public List<Grammar> getPreOrderedGrammarList()
Return a preorder list of grammars; root is first in list
-
trimLexerImportsIntoCombined
public void trimLexerImportsIntoCombined()
-
-