antlr
Class RuleBlock

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

public class RuleBlock
extends antlr.AlternativeBlock

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
           
static int AUTO_GEN_BANG
           
static int AUTO_GEN_CARET
           
static int AUTO_GEN_NONE
           
protected  int autoGenType
           
protected  Lookahead[] cache
           
protected  int column
           
protected  boolean defaultErrorHandler
           
protected  boolean doAutoGen
           
protected  String enclosingRuleName
           
protected  antlr.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, boolean doAutoGen_)
          Construct a named rule with line number information
 
Method Summary
 void addAlternative(antlr.Alternative alt)
           
 void addExceptionSpec(antlr.ExceptionSpec ex)
           
 antlr.ExceptionSpec findExceptionSpec(String label)
           
 antlr.ExceptionSpec findExceptionSpec(Token label)
           
 void generate()
           
 antlr.Alternative getAlternativeAt(int i)
           
 Vector getAlternatives()
           
 boolean getAutoGen()
           
 int getAutoGenType()
           
 int getColumn()
           
 boolean getDefaultErrorHandler()
           
 antlr.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 setAutoGenType(int a)
           
 void setDefaultErrorHandler(boolean value)
           
 void setEndElement(antlr.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 antlr.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

autoGenType

protected int autoGenType

enclosingRuleName

protected String enclosingRuleName

AUTO_GEN_NONE

public static final int AUTO_GEN_NONE
See Also:
Constant Field Values

AUTO_GEN_CARET

public static final int AUTO_GEN_CARET
See Also:
Constant Field Values

AUTO_GEN_BANG

public static final int AUTO_GEN_BANG
See Also:
Constant Field Values

grammar

protected Grammar grammar

line

protected int line

column

protected int column
Constructor Detail

RuleBlock

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


RuleBlock

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

Method Detail

addExceptionSpec

public void addExceptionSpec(antlr.ExceptionSpec ex)

findExceptionSpec

public antlr.ExceptionSpec findExceptionSpec(Token label)

findExceptionSpec

public antlr.ExceptionSpec findExceptionSpec(String label)

generate

public void generate()
Overrides:
generate in class antlr.AlternativeBlock

getDefaultErrorHandler

public boolean getDefaultErrorHandler()

getEndElement

public antlr.RuleEndElement getEndElement()

getIgnoreRule

public String getIgnoreRule()

getRuleName

public String getRuleName()

getTestLiterals

public boolean getTestLiterals()

isLexerAutoGenRule

public boolean isLexerAutoGenRule()

look

public Lookahead look(int k)
Overrides:
look in class antlr.AlternativeBlock

prepareForAnalysis

public void prepareForAnalysis()
Overrides:
prepareForAnalysis in class antlr.AlternativeBlock

setDefaultErrorHandler

public void setDefaultErrorHandler(boolean value)

setEndElement

public void setEndElement(antlr.RuleEndElement re)

setOption

public void setOption(Token key,
                      Token value)
Overrides:
setOption in class antlr.AlternativeBlock

toString

public String toString()
Overrides:
toString in class antlr.AlternativeBlock

addAlternative

public void addAlternative(antlr.Alternative alt)

getAlternativeAt

public antlr.Alternative getAlternativeAt(int i)

getAlternatives

public Vector getAlternatives()

getAutoGen

public boolean getAutoGen()

getInitAction

public String getInitAction()

getLabel

public String getLabel()
Overrides:
getLabel in class antlr.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 antlr.AlternativeElement

getAutoGenType

public int getAutoGenType()

setAutoGenType

public void setAutoGenType(int a)

getLine

public int getLine()

getColumn

public int getColumn()


Copyright 1999-2003 Oliver Zeigermann. All Rights Reserved.