Package EDU.purdue.jtb.parser
Class Expansion_
java.lang.Object
EDU.purdue.jtb.parser.Expansion_
- Direct Known Subclasses:
Action
,Choice
,Lookahead
,NonTerminal
,OneOrMore
,RegularExpression_
,Sequence
,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.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
The OS line separatorboolean
This flag is used for bookkeeping by the minimumSize method in classUnusedParseEngine
.long
To avoid right-recursive loops when calculating follow sets, we use a generation number which indicates if this expansion was visited byinvalid reference
UnusedLookaheadWalk#genFollowSet(List, Expansion_, long)
static long
To avoid right-recursive loops when calculating follow sets, we use a generation number which indicates if this expansion was visited byinvalid reference
UnusedLookaheadWalk#genFollowSet(List, Expansion_, long)
The parent of this expansion node. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringBuilder
dumpPrefix
(int indent) toString()
-
Field Details
-
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. -
nextGenerationIndex
public static long nextGenerationIndexTo avoid right-recursive loops when calculating follow sets, we use a generation number which indicates if this expansion was visited byinvalid reference
UnusedLookaheadWalk#genFollowSet(List, Expansion_, long)
nextGenerationIndex
, and the current generation is stored in the non-static variablemyGeneration
. -
myGeneration
public long myGenerationTo avoid right-recursive loops when calculating follow sets, we use a generation number which indicates if this expansion was visited byinvalid reference
UnusedLookaheadWalk#genFollowSet(List, Expansion_, long)
nextGenerationIndex
, and the current generation is stored in the non-static variablemyGeneration
. -
inMinimumSize
public boolean inMinimumSizeThis flag is used for bookkeeping by the minimumSize method in classUnusedParseEngine
. -
EOL
The OS line separator
-
-
Constructor Details
-
Expansion_
public Expansion_()
-
-
Method Details
-
toString
-
dumpPrefix
- Parameters:
indent
- - the number of indentation level- Returns:
- a
StringBuilder
with twice the number of spaces given by the parameter
-
dump
- Parameters:
indent
- - the number of spaces for indentingalreadyDumped
- - a Set of objects already dumped (unused)- Returns:
- the formatted string dumping the class
-