antlr
Class RuleBlock

java.lang.Object
  |
  +--antlr.GrammarElement
        |
        +--antlr.AlternativeElement
              |
              +--antlr.AlternativeBlock
                    |
                    +--antlr.RuleBlock

public class RuleBlock
extends AlternativeBlock

Untamed:


Field Summary
protected  Vector alternatives
           
protected  int alti
           
protected  int altj
           
protected  int analysisAlt
           
protected  String argAction
           
static int AUTO_GEN_BANG
           
static int AUTO_GEN_CARET
           
static int AUTO_GEN_NONE
           
protected  int autoGenType
           
protected  Lookahead[] cache
           
protected  boolean defaultErrorHandler
           
protected  boolean doAutoGen
           
protected  String enclosingRuleName
           
protected  RuleEndElement endNode
           
(package private)  Hashtable exceptionSpecs
           
protected  boolean generateAmbigWarnings
           
protected  Grammar grammar
           
(package private)  boolean greedy
           
(package private)  boolean greedySet
           
protected  boolean hasAnAction
           
protected  boolean hasASynPred
           
protected  int ID
           
protected  String ignoreRule
           
protected  String initAction
           
protected  String label
           
(package private)  Vector labeledElements
           
protected  int line
           
protected  boolean[] lock
           
protected static int nblks
           
(package private)  AlternativeElement next
           
(package private)  boolean not
           
protected  String returnAction
           
protected  String ruleName
           
protected  boolean testLiterals
           
protected  String throwsSpec
           
protected  boolean warnWhenFollowAmbig
           
 
Constructor Summary
RuleBlock(Grammar g, String r)
          Enabled: Construct a named rule.
RuleBlock(Grammar g, String r, int line, boolean doAutoGen_)
          Enabled: Construct a named rule with line number information
 
Method Summary
 void addAlternative(Alternative alt)
           
 void addExceptionSpec(ExceptionSpec ex)
          Enabled:
 ExceptionSpec findExceptionSpec(String label)
          Enabled:
 ExceptionSpec findExceptionSpec(Token label)
          Enabled:
 void generate()
          Enabled:
 Alternative getAlternativeAt(int i)
           
 Vector getAlternatives()
           
 boolean getAutoGen()
           
 int getAutoGenType()
           
 boolean getDefaultErrorHandler()
          Enabled:
 RuleEndElement getEndElement()
          Enabled:
 String getIgnoreRule()
          Enabled:
 String getInitAction()
           
 String getLabel()
           
 int getLine()
           
 String getRuleName()
          Enabled:
 boolean getTestLiterals()
          Enabled:
 boolean isLexerAutoGenRule()
          Enabled:
 Lookahead look(int k)
          Enabled:
 void prepareForAnalysis()
          Enabled:
 void removeTrackingOfRuleRefs(Grammar g)
          Walk the syntactic predicate and, for a rule ref R, remove the ref from the list of FOLLOW references for R (stored in the symbol table.
 void setAlternatives(Vector v)
           
 void setAutoGen(boolean doAutoGen_)
           
 void setDefaultErrorHandler(boolean value)
          Enabled:
 void setEndElement(RuleEndElement re)
          Enabled:
 void setInitAction(String initAction_)
           
 void setLabel(String label_)
           
 void setOption(Token key, Token value)
          Enabled:
 String toString()
          Suppressed:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ruleName

protected String ruleName

argAction

protected String argAction

throwsSpec

protected String throwsSpec

returnAction

protected String returnAction

endNode

protected RuleEndElement endNode

testLiterals

protected boolean testLiterals

labeledElements

Vector labeledElements

lock

protected boolean[] lock

cache

protected Lookahead[] cache

exceptionSpecs

Hashtable exceptionSpecs

defaultErrorHandler

protected boolean defaultErrorHandler

ignoreRule

protected String ignoreRule

initAction

protected String initAction

alternatives

protected Vector alternatives

label

protected String label

alti

protected int alti

altj

protected int altj

analysisAlt

protected int analysisAlt

hasAnAction

protected boolean hasAnAction

hasASynPred

protected boolean hasASynPred

ID

protected int ID

nblks

protected static int nblks

not

boolean not

greedy

boolean greedy

greedySet

boolean greedySet

doAutoGen

protected boolean doAutoGen

warnWhenFollowAmbig

protected boolean warnWhenFollowAmbig

generateAmbigWarnings

protected boolean generateAmbigWarnings

next

AlternativeElement next

autoGenType

protected int autoGenType

enclosingRuleName

protected String enclosingRuleName

AUTO_GEN_NONE

public static final int AUTO_GEN_NONE

AUTO_GEN_CARET

public static final int AUTO_GEN_CARET

AUTO_GEN_BANG

public static final int AUTO_GEN_BANG

grammar

protected Grammar grammar

line

protected int line
Constructor Detail

RuleBlock

public RuleBlock(Grammar g,
                 String r)
Enabled: Construct a named rule.


RuleBlock

public RuleBlock(Grammar g,
                 String r,
                 int line,
                 boolean doAutoGen_)
Enabled: Construct a named rule with line number information

Method Detail

addExceptionSpec

public void addExceptionSpec(ExceptionSpec ex)
Enabled:


findExceptionSpec

public ExceptionSpec findExceptionSpec(Token label)
Enabled:


findExceptionSpec

public ExceptionSpec findExceptionSpec(String label)
Enabled:


generate

public void generate()
Enabled:

Overrides:
generate in class AlternativeBlock

getDefaultErrorHandler

public boolean getDefaultErrorHandler()
Enabled:


getEndElement

public RuleEndElement getEndElement()
Enabled:


getIgnoreRule

public String getIgnoreRule()
Enabled:


getRuleName

public String getRuleName()
Enabled:


getTestLiterals

public boolean getTestLiterals()
Enabled:


isLexerAutoGenRule

public boolean isLexerAutoGenRule()
Enabled:


look

public Lookahead look(int k)
Enabled:

Overrides:
look in class AlternativeBlock

prepareForAnalysis

public void prepareForAnalysis()
Enabled:

Overrides:
prepareForAnalysis in class AlternativeBlock

setDefaultErrorHandler

public void setDefaultErrorHandler(boolean value)
Enabled:


setEndElement

public void setEndElement(RuleEndElement re)
Enabled:


setOption

public void setOption(Token key,
                      Token value)
Enabled:

Overrides:
setOption in class AlternativeBlock

toString

public String toString()
Suppressed:

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

addAlternative

public void addAlternative(Alternative alt)

getAlternativeAt

public Alternative getAlternativeAt(int i)

getAlternatives

public Vector getAlternatives()

getAutoGen

public boolean getAutoGen()

getInitAction

public String getInitAction()

getLabel

public String getLabel()
Overrides:
getLabel in class AlternativeElement

removeTrackingOfRuleRefs

public void removeTrackingOfRuleRefs(Grammar g)
Walk the syntactic predicate and, for a rule ref R, remove the ref from the list of FOLLOW references for R (stored in the symbol table.


setAlternatives

public void setAlternatives(Vector v)

setAutoGen

public void setAutoGen(boolean doAutoGen_)

setInitAction

public void setInitAction(String initAction_)

setLabel

public void setLabel(String label_)
Overrides:
setLabel in class AlternativeElement

getAutoGenType

public int getAutoGenType()

getLine

public int getLine()


comments?