| Modifier and Type | Field and Description |
|---|---|
| public static final int | DETECT_PRED_EOR
0 if we hit end of rule and invoker should keep going (epsilon) |
| public static final int | DETECT_PRED_FOUND
1 if we found a nonautobacktracking pred |
| public static final int | DETECT_PRED_NOT_FOUND
2 if we didn't find such a pred |
| public Map | |
| public Map | |
| public Grammar | |
| protected Set | lookBusy
Used during LOOK to detect computation cycles |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected int | |
| protected LookaheadSet | |
| protected SemanticContext | |
| public boolean | detectConfoundingPredicates(NFAState s)
Is there a non-syn-pred predicate visible from s that is not in the rule enclosing s? |
| public LookaheadSet | |
| public LookaheadSet | |
| public SemanticContext | |
| public LookaheadSet |
| DETECT_PRED_EOR | back to summary |
|---|---|
| public static final int DETECT_PRED_EOR 0 if we hit end of rule and invoker should keep going (epsilon) | |
| DETECT_PRED_FOUND | back to summary |
|---|---|
| public static final int DETECT_PRED_FOUND 1 if we found a nonautobacktracking pred | |
| DETECT_PRED_NOT_FOUND | back to summary |
|---|---|
| public static final int DETECT_PRED_NOT_FOUND 2 if we didn't find such a pred | |
| FIRSTCache | back to summary |
|---|---|
| public Map<NFAState, LookaheadSet> FIRSTCache | |
| FOLLOWCache | back to summary |
|---|---|
| public Map<Rule, LookaheadSet> FOLLOWCache | |
| grammar | back to summary |
|---|---|
| public Grammar grammar | |
| lookBusy | back to summary |
|---|---|
| protected Set<NFAState> lookBusy Used during LOOK to detect computation cycles | |
| LL1Analyzer | back to summary |
|---|---|
| public LL1Analyzer(Grammar grammar) | |
| _detectConfoundingPredicates | back to summary |
|---|---|
| protected int _detectConfoundingPredicates(NFAState s, Rule enclosingRule, boolean chaseFollowTransitions) | |
| _FIRST | back to summary |
|---|---|
| protected LookaheadSet _FIRST(NFAState s, boolean chaseFollowTransitions) | |
| _getPredicates | back to summary |
|---|---|
| protected SemanticContext _getPredicates(NFAState s, NFAState altStartState) | |
| detectConfoundingPredicates | back to summary |
|---|---|
| public 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. Todo what about gated vs regular preds? | |
| FIRST | back to summary |
|---|---|
| public LookaheadSet FIRST(NFAState s) From an NFA state, s, find the set of all labels reachable from s. Used to compute follow sets for error recovery. Never computes a FOLLOW operation. FIRST stops at end of rules, returning EOR, unless invoked from another rule. I.e., routine properly handles a : b A ; where b is nullable. We record with EOR_TOKEN_TYPE if we hit the end of a rule so we can know at runtime (when these sets are used) to start walking up the follow chain to compute the real, correct follow set (as opposed to the FOLLOW, which is a superset). This routine will only be used on parser and tree parser grammars. | |
| FOLLOW | back to summary |
|---|---|
| public LookaheadSet FOLLOW(Rule r) | |
| getPredicates | back to summary |
|---|---|
| public SemanticContext getPredicates(NFAState altStartState) Return predicate expression found via epsilon edges from s. Do not look into other rules for now. Do something simple. Include backtracking synpreds. | |
| LOOK | back to summary |
|---|---|
| public LookaheadSet LOOK(NFAState s) | |