From a400163f23b29eb0b164ebc933c9201f7641a499 Mon Sep 17 00:00:00 2001 From: Ivan Kochurkin Date: Fri, 17 Jun 2022 22:07:53 +0300 Subject: [PATCH] Remove doubtful and not used static fields Signed-off-by: Ivan Kochurkin --- runtime/Java/src/org/antlr/v4/runtime/misc/Interval.java | 5 ----- .../test/org/antlr/v4/test/tool/TestATNParserPrediction.java | 1 - tool/src/org/antlr/v4/Tool.java | 5 ----- tool/src/org/antlr/v4/misc/Utils.java | 2 -- 4 files changed, 13 deletions(-) diff --git a/runtime/Java/src/org/antlr/v4/runtime/misc/Interval.java b/runtime/Java/src/org/antlr/v4/runtime/misc/Interval.java index 1dd949442f..a07d035407 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/misc/Interval.java +++ b/runtime/Java/src/org/antlr/v4/runtime/misc/Interval.java @@ -16,11 +16,6 @@ public class Interval { public int a; public int b; - public static int creates = 0; - public static int misses = 0; - public static int hits = 0; - public static int outOfRange = 0; - public Interval(int a, int b) { this.a=a; this.b=b; } /** Interval objects are used readonly so share all with the diff --git a/tool-testsuite/test/org/antlr/v4/test/tool/TestATNParserPrediction.java b/tool-testsuite/test/org/antlr/v4/test/tool/TestATNParserPrediction.java index 51a1f91859..6831287813 100644 --- a/tool-testsuite/test/org/antlr/v4/test/tool/TestATNParserPrediction.java +++ b/tool-testsuite/test/org/antlr/v4/test/tool/TestATNParserPrediction.java @@ -491,7 +491,6 @@ public class TestATNParserPrediction { public void checkPredictedAlt(LexerGrammar lg, Grammar g, int decision, String inputString, int expectedAlt) { - Tool.internalOption_ShowATNConfigsInDFA = true; ATN lexatn = createATN(lg, true); LexerATNSimulator lexInterp = new LexerATNSimulator(lexatn,new DFA[] { new DFA(lexatn.modeToStartState.get(Lexer.DEFAULT_MODE)) },new PredictionContextCache()); diff --git a/tool/src/org/antlr/v4/Tool.java b/tool/src/org/antlr/v4/Tool.java index 951f0ef6bb..1b7eea7535 100644 --- a/tool/src/org/antlr/v4/Tool.java +++ b/tool/src/org/antlr/v4/Tool.java @@ -139,10 +139,6 @@ public Option(String fieldName, String name, OptionArgType argType, String descr protected boolean haveOutputDir = false; protected boolean return_dont_exit = false; - // The internal options are for my use on the command line during dev - public static boolean internalOption_PrintGrammarTree = false; - public static boolean internalOption_ShowATNConfigsInDFA = false; - public final String[] args; @@ -365,7 +361,6 @@ public void process(Grammar g, boolean gencode) { public void processNonCombinedGrammar(Grammar g, boolean gencode) { if ( g.ast==null || g.ast.hasErrors ) return; - if ( internalOption_PrintGrammarTree ) System.out.println(g.ast.toStringTree()); boolean ruleFail = checkForRuleIssues(g); if ( ruleFail ) return; diff --git a/tool/src/org/antlr/v4/misc/Utils.java b/tool/src/org/antlr/v4/misc/Utils.java index 35d435bce8..06d8a6f48b 100644 --- a/tool/src/org/antlr/v4/misc/Utils.java +++ b/tool/src/org/antlr/v4/misc/Utils.java @@ -31,8 +31,6 @@ public interface Func1 { TResult exec(T1 arg1); } - static Integer[] ints = new Integer[INTEGER_POOL_MAX_VALUE+1]; - public static String stripFileExtension(String name) { if ( name==null ) return null; int lastDot = name.lastIndexOf('.');