antlr.preprocessor
Class Grammar

java.lang.Object
  |
  +--antlr.preprocessor.Grammar

class Grammar
extends java.lang.Object


Field Summary
protected  boolean alreadyExpanded
           
protected  java.lang.String exportVocab
           
protected  java.lang.String fileName
           
protected  Hierarchy hier
           
protected  java.lang.String importVocab
           
protected  java.lang.String memberAction
           
protected  java.lang.String name
           
protected  IndexedVector options
           
protected  java.lang.String preambleAction
           
protected  boolean predefined
           
protected  IndexedVector rules
           
protected  boolean specifiedVocabulary
           
protected  java.lang.String superGrammar
           
protected  java.lang.String tokenSection
           
protected  java.lang.String type
           
 
Constructor Summary
Grammar(java.lang.String name, java.lang.String superGrammar, IndexedVector rules)
           
 
Method Summary
 void addOption(Option o)
           
 void addRule(Rule r)
           
 void expandInPlace()
          Copy all nonoverridden rules, vocabulary, and options into this grammar from supergrammar chain.
 java.lang.String getFileName()
           
 java.lang.String getName()
           
 IndexedVector getOptions()
           
 IndexedVector getRules()
           
 Grammar getSuperGrammar()
           
 java.lang.String getSuperGrammarName()
           
 java.lang.String getType()
           
 void inherit(Option o, Grammar superG)
           
 void inherit(Rule r, Grammar superG)
           
 void inherit(java.lang.String memberAction, Grammar superG)
           
 boolean isPredefined()
           
 void setFileName(java.lang.String f)
           
 void setHierarchy(Hierarchy hier)
           
 void setMemberAction(java.lang.String a)
           
 void setOptions(IndexedVector options)
           
 void setPreambleAction(java.lang.String a)
           
 void setPredefined(boolean b)
           
 void setTokenSection(java.lang.String tk)
           
 void setType(java.lang.String t)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

Grammar

public Grammar(java.lang.String name,
               java.lang.String superGrammar,
               IndexedVector rules)
Method Detail

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