update comments, rename var.

This commit is contained in:
parrt 2015-05-29 14:10:08 -07:00
parent 410fafb939
commit d73e73a091
5 changed files with 11 additions and 10 deletions

View File

@ -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() { }

View File

@ -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) &&

View File

@ -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>();

View File

@ -6,3 +6,7 @@ a
;
b : 'x' | 'y' {} ;
e : e '*' e
| 'foo'
;

View File

@ -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;