antlr.preprocessor
Class Grammar
java.lang.Object
|
+--antlr.preprocessor.Grammar
- class Grammar
- extends java.lang.Object
Constructor Summary |
Grammar(java.lang.String name,
java.lang.String superGrammar,
IndexedVector rules)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
name
protected java.lang.String name
fileName
protected java.lang.String fileName
superGrammar
protected java.lang.String superGrammar
type
protected java.lang.String type
rules
protected IndexedVector rules
options
protected IndexedVector options
tokenSection
protected java.lang.String tokenSection
preambleAction
protected java.lang.String preambleAction
memberAction
protected java.lang.String memberAction
hier
protected Hierarchy hier
predefined
protected boolean predefined
alreadyExpanded
protected boolean alreadyExpanded
specifiedVocabulary
protected boolean specifiedVocabulary
importVocab
protected java.lang.String importVocab
exportVocab
protected java.lang.String exportVocab
Grammar
public Grammar(java.lang.String name,
java.lang.String superGrammar,
IndexedVector rules)
addOption
public void addOption(Option o)
addRule
public void addRule(Rule r)
expandInPlace
public void expandInPlace()
- Copy all nonoverridden rules, vocabulary, and options into this grammar from
supergrammar chain. The change is made in place; e.g., this grammar's vector
of rules gets bigger. This has side-effects: all grammars on path to
root of hierarchy are expanded also.
getFileName
public java.lang.String getFileName()
getName
public java.lang.String getName()
getOptions
public IndexedVector getOptions()
getRules
public IndexedVector getRules()
getSuperGrammar
public Grammar getSuperGrammar()
getSuperGrammarName
public java.lang.String getSuperGrammarName()
getType
public java.lang.String getType()
inherit
public void inherit(Option o,
Grammar superG)
inherit
public void inherit(Rule r,
Grammar superG)
inherit
public void inherit(java.lang.String memberAction,
Grammar superG)
isPredefined
public boolean isPredefined()
setFileName
public void setFileName(java.lang.String f)
setHierarchy
public void setHierarchy(Hierarchy hier)
setMemberAction
public void setMemberAction(java.lang.String a)
setOptions
public void setOptions(IndexedVector options)
setPreambleAction
public void setPreambleAction(java.lang.String a)
setPredefined
public void setPredefined(boolean b)
setTokenSection
public void setTokenSection(java.lang.String tk)
setType
public void setType(java.lang.String t)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object