Package org.javacc.parser
Class Lookahead
- java.lang.Object
-
- org.javacc.parser.Expansion
-
- org.javacc.parser.Lookahead
-
public class Lookahead extends Expansion
Describes lookahead rule for a particular expansion or expansion sequence (See Sequence.java). In case this describes the lookahead rule for a single expansion unit, then a sequence is created with this node as the first element, and the expansion unit as the second and last element.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Token>action_tokensContains the list of tokens that make up the semantic lookahead if any.private intamountThe lookahead amount.private booleanisExplicitIs set to true if this is an explicit lookahead specification.private Expansionla_expansionThe expansion used to determine whether or not to choose the corresponding parse option.-
Fields inherited from class org.javacc.parser.Expansion
eol, inMinimumSize, myGeneration, ordinal, parent
-
-
Constructor Summary
Constructors Constructor Description Lookahead()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringBufferdump(int indent, java.util.Set<Expansion> alreadyDumped)java.util.List<Token>getActionTokens()intgetAmount()ExpansiongetLaExpansion()booleanisExplicit()voidsetAmount(int amount)voidsetExplicit(boolean isExplicit)voidsetLaExpansion(Expansion la_expansion)-
Methods inherited from class org.javacc.parser.Expansion
dumpPrefix, getColumn, getLine, getProductionName, hashCode, setColumn, setLine, toString
-
-
-
-
Field Detail
-
action_tokens
private final java.util.List<Token> action_tokens
Contains the list of tokens that make up the semantic lookahead if any. If this node represents a different kind of lookahead (other than semantic lookahead), then this list contains nothing. If this list contains something, then it is the boolean expression that forms the semantic lookahead. In this case, the following fields "amount" and "la_expansion" are ignored.
-
amount
private int amount
The lookahead amount. Its default value essentially gives us infinite lookahead.
-
la_expansion
private Expansion la_expansion
The expansion used to determine whether or not to choose the corresponding parse option. This expansion is parsed upto "amount" tokens of lookahead or until a complete match for it is found. Usually, this is the same as the expansion to be parsed.
-
isExplicit
private boolean isExplicit
Is set to true if this is an explicit lookahead specification.
-
-
Method Detail
-
dump
public java.lang.StringBuffer dump(int indent, java.util.Set<Expansion> alreadyDumped)
-
getActionTokens
public java.util.List<Token> getActionTokens()
- Returns:
- the action_tokens
-
setAmount
public void setAmount(int amount)
- Parameters:
amount- the amount to set
-
getAmount
public int getAmount()
- Returns:
- the amount
-
setLaExpansion
public void setLaExpansion(Expansion la_expansion)
- Parameters:
la_expansion- the la_expansion to set
-
getLaExpansion
public Expansion getLaExpansion()
- Returns:
- the la_expansion
-
setExplicit
public void setExplicit(boolean isExplicit)
- Parameters:
isExplicit- the isExplicit to set
-
isExplicit
public boolean isExplicit()
- Returns:
- the isExplicit
-
-