Revert "add option -exact-ambiguities to TestRig"
This reverts commit 400b58d4a0
.
This commit is contained in:
parent
400b58d4a0
commit
d1795d205f
|
@ -1,9 +1,5 @@
|
||||||
ANTLR v4 Honey Badger
|
ANTLR v4 Honey Badger
|
||||||
|
|
||||||
November 3, 2012
|
|
||||||
|
|
||||||
* add option -exact-ambiguities to TestRig
|
|
||||||
|
|
||||||
October 29, 2012
|
October 29, 2012
|
||||||
|
|
||||||
* Sam fixes nongreedy more.
|
* Sam fixes nongreedy more.
|
||||||
|
|
|
@ -36,6 +36,7 @@ import org.antlr.v4.runtime.DiagnosticErrorListener;
|
||||||
import org.antlr.v4.runtime.Lexer;
|
import org.antlr.v4.runtime.Lexer;
|
||||||
import org.antlr.v4.runtime.Parser;
|
import org.antlr.v4.runtime.Parser;
|
||||||
import org.antlr.v4.runtime.ParserRuleContext;
|
import org.antlr.v4.runtime.ParserRuleContext;
|
||||||
|
import org.antlr.v4.runtime.Token;
|
||||||
import org.antlr.v4.runtime.TokenStream;
|
import org.antlr.v4.runtime.TokenStream;
|
||||||
import org.antlr.v4.runtime.atn.PredictionMode;
|
import org.antlr.v4.runtime.atn.PredictionMode;
|
||||||
|
|
||||||
|
@ -74,7 +75,6 @@ public class TestRig {
|
||||||
static boolean diagnostics = false;
|
static boolean diagnostics = false;
|
||||||
static String encoding = null;
|
static String encoding = null;
|
||||||
static boolean SLL = false;
|
static boolean SLL = false;
|
||||||
static boolean exactAmbigDetection = false;
|
|
||||||
|
|
||||||
public static final String LEXER_START_RULE_NAME = "tokens";
|
public static final String LEXER_START_RULE_NAME = "tokens";
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public class TestRig {
|
||||||
if ( args.length < 2 ) {
|
if ( args.length < 2 ) {
|
||||||
System.err.println("java org.antlr.v4.runtime.misc.TestRig GrammarName startRuleName\n" +
|
System.err.println("java org.antlr.v4.runtime.misc.TestRig GrammarName startRuleName\n" +
|
||||||
" [-tokens] [-tree] [-gui] [-ps file.ps] [-encoding encodingname]\n" +
|
" [-tokens] [-tree] [-gui] [-ps file.ps] [-encoding encodingname]\n" +
|
||||||
" [-trace] [-diagnostics] [-SLL] [-exact-ambiguities]\n"+
|
" [-trace] [-diagnostics] [-SLL]\n"+
|
||||||
" [input-filename(s)]");
|
" [input-filename(s)]");
|
||||||
System.err.println("Use startRuleName='tokens' if GrammarName is a lexer grammar.");
|
System.err.println("Use startRuleName='tokens' if GrammarName is a lexer grammar.");
|
||||||
System.err.println("Omitting input-filename makes rig read from stdin.");
|
System.err.println("Omitting input-filename makes rig read from stdin.");
|
||||||
|
@ -116,9 +116,6 @@ public class TestRig {
|
||||||
else if ( arg.equals("-SLL") ) {
|
else if ( arg.equals("-SLL") ) {
|
||||||
SLL = true;
|
SLL = true;
|
||||||
}
|
}
|
||||||
else if ( arg.equals("-exact-ambiguities") ) {
|
|
||||||
exactAmbigDetection = true;
|
|
||||||
}
|
|
||||||
else if ( arg.equals("-diagnostics") ) {
|
else if ( arg.equals("-diagnostics") ) {
|
||||||
diagnostics = true;
|
diagnostics = true;
|
||||||
}
|
}
|
||||||
|
@ -227,10 +224,7 @@ public class TestRig {
|
||||||
parser.setBuildParseTree(true);
|
parser.setBuildParseTree(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( exactAmbigDetection ) {
|
if ( SLL ) {
|
||||||
parser.getInterpreter().setPredictionMode(PredictionMode.LL_EXACT_AMBIG_DETECTION);
|
|
||||||
}
|
|
||||||
if ( SLL ) { // overrides exactAmbigDetection
|
|
||||||
parser.getInterpreter().setPredictionMode(PredictionMode.SLL);
|
parser.getInterpreter().setPredictionMode(PredictionMode.SLL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue