public class LL1Analyzer extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DETECT_PRED_EOR
0 if we hit end of rule and invoker should keep going (epsilon)
|
static int |
DETECT_PRED_FOUND
1 if we found a nonautobacktracking pred
|
static int |
DETECT_PRED_NOT_FOUND
2 if we didn't find such a pred
|
Map<NFAState,LookaheadSet> |
FIRSTCache |
Map<Rule,LookaheadSet> |
FOLLOWCache |
Grammar |
grammar |
protected Set<NFAState> |
lookBusy
Used during LOOK to detect computation cycles
|
Constructor and Description |
---|
LL1Analyzer(Grammar grammar) |
Modifier and Type | Method and Description |
---|---|
protected int |
_detectConfoundingPredicates(NFAState s,
Rule enclosingRule,
boolean chaseFollowTransitions) |
protected LookaheadSet |
_FIRST(NFAState s,
boolean chaseFollowTransitions) |
protected SemanticContext |
_getPredicates(NFAState s,
NFAState altStartState) |
boolean |
detectConfoundingPredicates(NFAState s)
Is there a non-syn-pred predicate visible from s that is not in
the rule enclosing s? This accounts for most predicate situations
and lets ANTLR do a simple LL(1)+pred computation.
|
LookaheadSet |
FIRST(NFAState s)
From an NFA state, s, find the set of all labels reachable from s.
|
LookaheadSet |
FOLLOW(Rule r) |
SemanticContext |
getPredicates(NFAState altStartState)
Return predicate expression found via epsilon edges from s.
|
LookaheadSet |
LOOK(NFAState s) |
public static final int DETECT_PRED_EOR
public static final int DETECT_PRED_FOUND
public static final int DETECT_PRED_NOT_FOUND
public Grammar grammar
public Map<NFAState,LookaheadSet> FIRSTCache
public Map<Rule,LookaheadSet> FOLLOWCache
public LL1Analyzer(Grammar grammar)
public LookaheadSet FIRST(NFAState s)
public LookaheadSet FOLLOW(Rule r)
public LookaheadSet LOOK(NFAState s)
protected LookaheadSet _FIRST(NFAState s, boolean chaseFollowTransitions)
public boolean detectConfoundingPredicates(NFAState s)
protected int _detectConfoundingPredicates(NFAState s, Rule enclosingRule, boolean chaseFollowTransitions)
public SemanticContext getPredicates(NFAState altStartState)
protected SemanticContext _getPredicates(NFAState s, NFAState altStartState)
Copyright © 1992–2015 ANTLR. All rights reserved.