From 28e29e39dc8370db27a1693a0d217ad4820d084a Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Sat, 3 Nov 2012 15:44:11 -0500 Subject: [PATCH] Remove code to explicitly add EOF transitions to rule stop states with no outgoing edges --- .../src/org/antlr/v4/runtime/atn/ATNSimulator.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSimulator.java b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSimulator.java index 224cad6f6..39a3c3833 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSimulator.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSimulator.java @@ -103,9 +103,6 @@ public abstract class ATNSimulator { atn.grammarType = toInt(data[p++]); atn.maxTokenType = toInt(data[p++]); - // Set up target of all EOF edges emanating from rule stop states - ATNState eofTarget = new ATNState(); - // // STATES // @@ -237,14 +234,6 @@ public abstract class ATNSimulator { } } - // If no edges out of stop state, add EOF transition - for (RuleStopState ruleStopState : atn.ruleToStopState) { - if ( ruleStopState.getNumberOfTransitions()==0 ) { - Transition t = new AtomTransition(eofTarget, Token.EOF); - ruleStopState.addTransition(t); - } - } - for (ATNState state : atn.states) { if (state instanceof BlockStartState) { // we need to know the end state to set its start state