class Grammar extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
alreadyExpanded |
protected Tool |
antlrTool |
protected String |
exportVocab |
protected String |
fileName |
protected Hierarchy |
hier |
protected String |
importVocab |
protected String |
memberAction |
protected String |
name |
protected IndexedVector |
options |
protected String |
preambleAction |
protected boolean |
predefined |
protected IndexedVector |
rules |
protected boolean |
specifiedVocabulary |
protected String |
superClass
if not derived from another grammar, might still specify a non-ANTLR
class to derive from like this "class T extends Parser(MyParserClass);"
|
protected String |
superGrammar |
protected String |
tokenSection |
protected String |
type |
Constructor and Description |
---|
Grammar(Tool tool,
String name,
String superGrammar,
IndexedVector rules) |
Modifier and Type | Method and Description |
---|---|
void |
addOption(Option o) |
void |
addRule(Rule r) |
void |
expandInPlace()
Copy all nonoverridden rules, vocabulary, and options into this grammar from
supergrammar chain.
|
String |
getFileName() |
String |
getName() |
IndexedVector |
getOptions() |
IndexedVector |
getRules() |
Grammar |
getSuperGrammar() |
String |
getSuperGrammarName() |
String |
getType() |
void |
inherit(Option o,
Grammar superG) |
void |
inherit(Rule r,
Grammar superG) |
void |
inherit(String memberAction,
Grammar superG) |
boolean |
isPredefined() |
void |
setFileName(String f) |
void |
setHierarchy(Hierarchy hier) |
void |
setMemberAction(String a) |
void |
setOptions(IndexedVector options) |
void |
setPreambleAction(String a) |
void |
setPredefined(boolean b) |
void |
setTokenSection(String tk) |
void |
setType(String t) |
String |
toString() |
protected String name
protected String fileName
protected String superGrammar
protected String type
protected IndexedVector rules
protected IndexedVector options
protected String tokenSection
protected String preambleAction
protected String memberAction
protected Hierarchy hier
protected boolean predefined
protected boolean alreadyExpanded
protected boolean specifiedVocabulary
protected String superClass
protected String importVocab
protected String exportVocab
protected Tool antlrTool
public Grammar(Tool tool, String name, String superGrammar, IndexedVector rules)
public void addOption(Option o)
public void addRule(Rule r)
public void expandInPlace()
public String getFileName()
public String getName()
public IndexedVector getOptions()
public IndexedVector getRules()
public Grammar getSuperGrammar()
public String getSuperGrammarName()
public String getType()
public boolean isPredefined()
public void setFileName(String f)
public void setHierarchy(Hierarchy hier)
public void setMemberAction(String a)
public void setOptions(IndexedVector options)
public void setPreambleAction(String a)
public void setPredefined(boolean b)
public void setTokenSection(String tk)
public void setType(String t)