public class LL1Analyzer extends Object
Modifier and Type | Field and Description |
---|---|
ATN |
atn |
static int |
HIT_PRED
Special value added to the lookahead sets to indicate that we hit
a predicate during analysis if seeThruPreds==false.
|
Constructor and Description |
---|
LL1Analyzer(ATN atn) |
Modifier and Type | Method and Description |
---|---|
protected void |
_LOOK(ATNState s,
PredictionContext ctx,
IntervalSet look,
Set<ATNConfig> lookBusy,
boolean seeThruPreds,
boolean addEOF)
Compute set of tokens that can come next.
|
IntervalSet[] |
getDecisionLookahead(ATNState s)
From an ATN state,
s , find the set of all labels reachable from
s at depth k. |
IntervalSet |
LOOK(ATNState s,
RuleContext ctx)
Get lookahead, using
ctx if we reach end of rule. |
public static final int HIT_PRED
@Nullable public IntervalSet[] getDecisionLookahead(@Nullable ATNState s)
s
, find the set of all labels reachable from
s
at depth k. Only for DecisionStates.@NotNull public IntervalSet LOOK(@NotNull ATNState s, @Nullable RuleContext ctx)
protected void _LOOK(@NotNull ATNState s, @Nullable PredictionContext ctx, @NotNull IntervalSet look, @NotNull Set<ATNConfig> lookBusy, boolean seeThruPreds, boolean addEOF)
ctx
is PredictionContext.EMPTY
,
then we don't go anywhere when we hit the end of the rule. We have
the correct set. If ctx
is null, that means that we did not want
any tokens following this rule--just the tokens that could be found within this
rule. Add Token.EPSILON
to the set indicating we reached the end of the ruled out having
to match a token.Copyright © 1992-2013 ANTLR. All Rights Reserved.