Class Expansion
java.lang.Object
org.javacc.parser.Expansion
- Direct Known Subclasses:
Action, CharacterRange, Choice, Lookahead, NonTerminal, NormalProduction, OneOrMore, RegularExpression, Sequence, SingleCharacter, TryBlock, ZeroOrMore, ZeroOrOne
Describes expansions - entities that may occur on the right hand sides of
productions. This is the base class of a bunch of other more specific
classes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprotected static final StringbooleanThis flag is used for bookkeeping by the minimumSize method in class ParseEngine.private intThe line and column number of the construct that corresponds most closely to this node.(package private) longTo avoid right-recursive loops when calculating follow sets, we use a generation number which indicates if this expansion was visited by LookaheadWalk.genFollowSet in the same generation.(package private) intThe ordinal of this node with respect to its parent.The parent of this expansion node. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringBufferdumpPrefix(int indent) final intfinal intgetLine()private StringinthashCode()A reimplementing of Object.hashCode() to be deterministic.(package private) final voidsetColumn(int column) (package private) final voidsetLine(int line) toString()
-
Field Details
-
eol
-
line
private int lineThe line and column number of the construct that corresponds most closely to this node. -
column
private int column -
parent
The parent of this expansion node. In case this is the top level expansion of the production it is a reference to the production node otherwise it is a reference to another Expansion node. In case this is the top level of a lookahead expansion,then the parent is null. -
ordinal
int ordinalThe ordinal of this node with respect to its parent. -
myGeneration
long myGenerationTo avoid right-recursive loops when calculating follow sets, we use a generation number which indicates if this expansion was visited by LookaheadWalk.genFollowSet in the same generation. New generations are obtained by incrementing the static counter below, and the current generation is stored in the non-static variable below. -
inMinimumSize
public boolean inMinimumSizeThis flag is used for bookkeeping by the minimumSize method in class ParseEngine.
-
-
Constructor Details
-
Expansion
public Expansion()
-
-
Method Details
-
hashCode
-
getLine
public final int getLine()- Returns:
- the line
-
getColumn
public final int getColumn()- Returns:
- the column
-
setLine
final void setLine(int line) - Parameters:
line- the line to set
-
setColumn
final void setColumn(int column) - Parameters:
column- the column to set
-
dumpPrefix
-
dump
-
getProductionName
-
getSimpleName
-
toString
-