at.dms.compiler.tools.antlr.compiler
Class RuleBlock

java.lang.Object
  extended by at.dms.compiler.tools.antlr.compiler.RuleBlock

public class RuleBlock
extends Object

A list of alternatives and info contained in the rule definition.


Field Summary
protected  Vector alternatives
           
protected  int alti
           
protected  int altj
           
protected  int analysisAlt
           
protected  String argAction
           
protected  Lookahead[] cache
           
protected  boolean defaultErrorHandler
           
protected  boolean doAutoGen
           
protected  String enclosingRuleName
           
protected  at.dms.compiler.tools.antlr.compiler.RuleEndElement endNode
           
protected  boolean generateAmbigWarnings
           
protected  Grammar grammar
           
protected  boolean hasAnAction
           
protected  boolean hasASynPred
           
protected  int ID
           
protected  String ignoreRule
           
protected  String initAction
           
protected  String label
           
protected  int line
           
protected  boolean[] lock
           
protected static int nblks
           
protected  String returnAction
           
protected  String ruleName
           
protected  boolean testLiterals
           
protected  String throwsSpec
           
protected  boolean warnWhenFollowAmbig
           
 
Constructor Summary
RuleBlock(Grammar g, String r)
          Construct a named rule.
RuleBlock(Grammar g, String r, int line)
          Construct a named rule with line number information
 
Method Summary
 void addAlternative(at.dms.compiler.tools.antlr.compiler.Alternative alt)
           
 void addExceptionSpec(at.dms.compiler.tools.antlr.compiler.ExceptionSpec ex)
           
 at.dms.compiler.tools.antlr.compiler.ExceptionSpec findExceptionSpec(String label)
           
 at.dms.compiler.tools.antlr.compiler.ExceptionSpec findExceptionSpec(Token label)
           
 void generate(JavaCodeGenerator generator)
           
 at.dms.compiler.tools.antlr.compiler.Alternative getAlternativeAt(int i)
           
 Vector getAlternatives()
           
 boolean getAutoGen()
           
 boolean getDefaultErrorHandler()
           
 at.dms.compiler.tools.antlr.compiler.RuleEndElement getEndElement()
           
 String getIgnoreRule()
           
 String getInitAction()
           
 String getLabel()
           
 int getLine()
           
 String getRuleName()
           
 boolean getTestLiterals()
           
 boolean isLexerAutoGenRule()
           
 Lookahead look(int k)
           
 void prepareForAnalysis()
           
 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)
           
 void setEndElement(at.dms.compiler.tools.antlr.compiler.RuleEndElement re)
           
 void setInitAction(String initAction_)
           
 void setLabel(String label_)
           
 void setOption(Token key, Token value)
           
 String toString()
           
 
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 at.dms.compiler.tools.antlr.compiler.RuleEndElement endNode

testLiterals

protected boolean testLiterals

lock

protected boolean[] lock

cache

protected Lookahead[] cache

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

doAutoGen

protected boolean doAutoGen

warnWhenFollowAmbig

protected boolean warnWhenFollowAmbig

generateAmbigWarnings

protected boolean generateAmbigWarnings

enclosingRuleName

protected String enclosingRuleName

grammar

protected Grammar grammar

line

protected int line
Constructor Detail

RuleBlock

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


RuleBlock

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

Method Detail

addExceptionSpec

public void addExceptionSpec(at.dms.compiler.tools.antlr.compiler.ExceptionSpec ex)

findExceptionSpec

public at.dms.compiler.tools.antlr.compiler.ExceptionSpec findExceptionSpec(Token label)

findExceptionSpec

public at.dms.compiler.tools.antlr.compiler.ExceptionSpec findExceptionSpec(String label)

generate

public void generate(JavaCodeGenerator generator)

getDefaultErrorHandler

public boolean getDefaultErrorHandler()

getEndElement

public at.dms.compiler.tools.antlr.compiler.RuleEndElement getEndElement()

getIgnoreRule

public String getIgnoreRule()

getRuleName

public String getRuleName()

getTestLiterals

public boolean getTestLiterals()

isLexerAutoGenRule

public boolean isLexerAutoGenRule()

look

public Lookahead look(int k)

prepareForAnalysis

public void prepareForAnalysis()

setDefaultErrorHandler

public void setDefaultErrorHandler(boolean value)

setEndElement

public void setEndElement(at.dms.compiler.tools.antlr.compiler.RuleEndElement re)

setOption

public void setOption(Token key,
                      Token value)

toString

public String toString()

addAlternative

public void addAlternative(at.dms.compiler.tools.antlr.compiler.Alternative alt)

getAlternativeAt

public at.dms.compiler.tools.antlr.compiler.Alternative getAlternativeAt(int i)

getAlternatives

public Vector getAlternatives()

getAutoGen

public boolean getAutoGen()

getInitAction

public String getInitAction()

getLabel

public String getLabel()

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_)

getLine

public int getLine()