From 8c8d4d754ee1952c8ea229543823d1e33da60c10 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Tue, 1 Apr 2014 21:09:36 -0500 Subject: [PATCH] Remove incorrectly generated call to adaptivePredict This particular call to adaptivePredict did not correctly match the decision number to the preceding setState() call. In addition, since this code is generated only for a positive closure, the only possible alternative is the one that enters the loop; error handling is deferred to the alternative(s) within the body of the closure. --- .../resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg index c3431d8bd..d90097224 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg @@ -548,7 +548,7 @@ while ( _alt!= && _alt!=-1 ) { PlusBlock(choice, alts, error) ::= << setState(); _errHandler.sync(this); -_alt = getInterpreter().adaptivePredict(_input,,_ctx); +_alt = 1+1; do { switch (_alt) {