From 71e0c664770da4d3150fea1ecedc1371b77c84c4 Mon Sep 17 00:00:00 2001 From: sharwell Date: Wed, 8 Feb 2012 17:15:34 -0600 Subject: [PATCH] Rename NUM_EDGES to MAX_DFA_EDGE, reduce max value to 127 --- .../src/org/antlr/v4/runtime/atn/LexerATNSimulator.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java b/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java index 3367ba26d..816060d31 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java @@ -44,7 +44,7 @@ public class LexerATNSimulator extends ATNSimulator { public static boolean debug = false; public static boolean dfa_debug = false; - public static final int NUM_EDGES = 255; // forces unicode to stay in ATN + public static final int MAX_DFA_EDGE = 127; // forces unicode to stay in ATN private boolean trace = false; private OutputStream traceStream = null; @@ -574,7 +574,7 @@ public class LexerATNSimulator extends ATNSimulator { @NotNull ATNConfigSet q) { // even if we can add the states, we can't add an edge for labels out of range - if (t < 0 || t > NUM_EDGES) { + if (t < 0 || t > MAX_DFA_EDGE) { return; } @@ -593,10 +593,10 @@ public class LexerATNSimulator extends ATNSimulator { } protected void addDFAEdge(@NotNull DFAState p, int t, @NotNull DFAState q) { - if (t < 0 || t > NUM_EDGES) return; // Only track edges within the DFA bounds + if (t < 0 || t > MAX_DFA_EDGE) return; // Only track edges within the DFA bounds if ( p.edges==null ) { // make room for tokens 1..n and -1 masquerading as index 0 - p.edges = new DFAState[NUM_EDGES+1]; // TODO: make adaptive + p.edges = new DFAState[MAX_DFA_EDGE+1]; // TODO: make adaptive } // if ( t==Token.EOF ) { // System.out.println("state "+p+" has EOF edge");