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
public class Expansion_ extends java.lang.Object
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 Modifier and Type Class Description static class
Expansion_.EXP_TYPE
Subclasses enum type
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
EOL
The OS line separatorboolean
inMinimumSize
This flag is used for bookkeeping by the minimumSize method in classUnusedParseEngine
.long
myGeneration
To avoid right-recursive loops when calculating follow sets, we use a generation number which indicates if this expansion was visited byUnusedLookaheadWalk#genFollowSet(List, Expansion_, long)
in the same generation.static long
nextGenerationIndex
To avoid right-recursive loops when calculating follow sets, we use a generation number which indicates if this expansion was visited byUnusedLookaheadWalk#genFollowSet(List, Expansion_, long)
in the same generation.java.lang.Object
parent
The parent of this expansion node.
-
Constructor Summary
Constructors Constructor Description Expansion_()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringBuilder
dump(int indent, java.util.Set<java.lang.Object> alreadyDumped)
protected static java.lang.StringBuilder
dumpPrefix(int indent)
java.lang.String
toString()
-
-
-
Field Detail
-
parent
public java.lang.Object 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 nextGenerationIndex
To avoid right-recursive loops when calculating follow sets, we use a generation number which indicates if this expansion was visited byUnusedLookaheadWalk#genFollowSet(List, Expansion_, long)
in the same generation. New generations are obtained by incrementing the static counternextGenerationIndex
, and the current generation is stored in the non-static variablemyGeneration
.
-
myGeneration
public long myGeneration
To avoid right-recursive loops when calculating follow sets, we use a generation number which indicates if this expansion was visited byUnusedLookaheadWalk#genFollowSet(List, Expansion_, long)
in the same generation. New generations are obtained by incrementing the static counternextGenerationIndex
, and the current generation is stored in the non-static variablemyGeneration
.
-
inMinimumSize
public boolean inMinimumSize
This flag is used for bookkeeping by the minimumSize method in classUnusedParseEngine
.
-
EOL
protected static final java.lang.String EOL
The OS line separator
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
dumpPrefix
protected static java.lang.StringBuilder dumpPrefix(int indent)
- Parameters:
indent
- - the number of indentation level- Returns:
- a
StringBuilder
with twice the number of spaces given by the parameter
-
dump
public java.lang.StringBuilder dump(int indent, java.util.Set<java.lang.Object> alreadyDumped)
- Parameters:
indent
- - the number of spaces for indentingalreadyDumped
- - a Set of objects already dumped (unused)- Returns:
- the formatted string dumping the class
-
-