antlr.preprocessor
Class Grammar

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

class Grammar
extends Object


Field Summary
protected  boolean alreadyExpanded
           
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 superGrammar
           
protected  String tokenSection
           
protected  String type
           
 
Constructor Summary
Grammar(String name, 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.
 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()
          Suppressed: Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected String name

fileName

protected String fileName

superGrammar

protected String superGrammar

type

protected String type

rules

protected IndexedVector rules

options

protected IndexedVector options

tokenSection

protected String tokenSection

preambleAction

protected String preambleAction

memberAction

protected String memberAction

hier

protected Hierarchy hier

predefined

protected boolean predefined

alreadyExpanded

protected boolean alreadyExpanded

specifiedVocabulary

protected boolean specifiedVocabulary

importVocab

protected String importVocab

exportVocab

protected String exportVocab
Constructor Detail

Grammar

public Grammar(String name,
               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 String getFileName()

getName

public String getName()

getOptions

public IndexedVector getOptions()

getRules

public IndexedVector getRules()

getSuperGrammar

public Grammar getSuperGrammar()

getSuperGrammarName

public String getSuperGrammarName()

getType

public String getType()

inherit

public void inherit(Option o,
                    Grammar superG)

inherit

public void inherit(Rule r,
                    Grammar superG)

inherit

public void inherit(String memberAction,
                    Grammar superG)

isPredefined

public boolean isPredefined()

setFileName

public void setFileName(String f)

setHierarchy

public void setHierarchy(Hierarchy hier)

setMemberAction

public void setMemberAction(String a)

setOptions

public void setOptions(IndexedVector options)

setPreambleAction

public void setPreambleAction(String a)

setPredefined

public void setPredefined(boolean b)

setTokenSection

public void setTokenSection(String tk)

setType

public void setType(String t)

toString

public String toString()
Description copied from class: Object
Suppressed: Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Overrides:
toString in class Object
Returns:
a string representation of the object.


comments?