forked from jasder/antlr
wasn't seeing thru some preds.
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9484]
This commit is contained in:
parent
0bf1aca47f
commit
2243cc2e81
|
@ -752,15 +752,16 @@ public class ParserATNSimulator<Symbol> extends ATNSimulator {
|
||||||
// RuleContext ctx = null;
|
// RuleContext ctx = null;
|
||||||
// if ( inContext ) ctx = outerContext;
|
// if ( inContext ) ctx = outerContext;
|
||||||
|
|
||||||
ATNConfig c = null;
|
ATNConfig c;
|
||||||
if ( parser==null || !collectPredicates ) {
|
if ( !pt.isCtxDependent || (pt.isCtxDependent&&inContext) ) {
|
||||||
c = new ATNConfig(config, pt.target);
|
|
||||||
}
|
|
||||||
else if ( !pt.isCtxDependent || (pt.isCtxDependent&&inContext) ) {
|
|
||||||
SemanticContext newSemCtx = new SemanticContext.AND(config.semanticContext, pt.getPredicate());
|
SemanticContext newSemCtx = new SemanticContext.AND(config.semanticContext, pt.getPredicate());
|
||||||
c = new ATNConfig(config, pt.target, newSemCtx);
|
c = new ATNConfig(config, pt.target, newSemCtx);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
c = new ATNConfig(config, pt.target);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( debug ) System.out.println("config from pred transition="+c);
|
||||||
return c;
|
return c;
|
||||||
|
|
||||||
// We see through the predicate if:
|
// We see through the predicate if:
|
||||||
|
|
Loading…
Reference in New Issue