forked from jasder/antlr
update comments, rename var.
This commit is contained in:
parent
410fafb939
commit
d73e73a091
|
@ -42,9 +42,7 @@ package org.antlr.v4.runtime;
|
|||
* provide equivalent functionality.</p>
|
||||
*/
|
||||
public class InterpreterRuleContext extends ParserRuleContext {
|
||||
/**
|
||||
* This is the backing field for {@link #getRuleIndex}.
|
||||
*/
|
||||
/** This is the backing field for {@link #getRuleIndex}. */
|
||||
private int ruleIndex = -1;
|
||||
|
||||
public InterpreterRuleContext() { }
|
||||
|
|
|
@ -247,22 +247,22 @@ public class ParserInterpreter extends Parser {
|
|||
}
|
||||
|
||||
protected void visitState(ATNState p) {
|
||||
int edge;
|
||||
int altNum;
|
||||
if (p.getNumberOfTransitions() > 1) {
|
||||
getErrorHandler().sync(this);
|
||||
int decision = ((DecisionState) p).decision;
|
||||
if ( decision == overrideDecision && _input.index() == overrideDecisionInputIndex ) {
|
||||
edge = overrideDecisionAlt;
|
||||
altNum = overrideDecisionAlt;
|
||||
}
|
||||
else {
|
||||
edge = getInterpreter().adaptivePredict(_input, decision, _ctx);
|
||||
altNum = getInterpreter().adaptivePredict(_input, decision, _ctx);
|
||||
}
|
||||
}
|
||||
else {
|
||||
edge = 1;
|
||||
altNum = 1;
|
||||
}
|
||||
|
||||
Transition transition = p.transition(edge - 1);
|
||||
Transition transition = p.transition(altNum - 1);
|
||||
switch (transition.getSerializationType()) {
|
||||
case Transition.EPSILON:
|
||||
if ( statesNeedingLeftRecursionContext.get(p.stateNumber) &&
|
||||
|
|
|
@ -152,7 +152,6 @@ public class Trees {
|
|||
return t.getPayload().toString();
|
||||
}
|
||||
|
||||
|
||||
/** Return ordered list of all children of this node */
|
||||
public static List<Tree> getChildren(Tree t) {
|
||||
List<Tree> kids = new ArrayList<Tree>();
|
||||
|
|
|
@ -6,3 +6,7 @@ a
|
|||
;
|
||||
|
||||
b : 'x' | 'y' {} ;
|
||||
|
||||
e : e '*' e
|
||||
| 'foo'
|
||||
;
|
||||
|
|
|
@ -41,7 +41,7 @@ public class AltAST extends GrammarASTWithOptions {
|
|||
/** If we transformed this alt from a left-recursive one, need info on it */
|
||||
public LeftRecursiveRuleAltInfo leftRecursiveAltInfo;
|
||||
|
||||
/** If someone specified an outermost alternative label with -> foo.
|
||||
/** If someone specified an outermost alternative label with #foo.
|
||||
* Token type will be ID.
|
||||
*/
|
||||
public GrammarAST altLabel;
|
||||
|
|
Loading…
Reference in New Issue