add edit warnings + fix chrome location + make locations relative

This commit is contained in:
ericvergnaud 2014-11-23 15:50:31 +08:00
parent 2f15f1cce0
commit 78027ed0f0
16 changed files with 363 additions and 20 deletions

View File

@ -1,7 +1,5 @@
package org.antlr.v4.test.rt.gen;
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@ -55,39 +53,31 @@ public class Generator {
}
private static File readCSharpDir() {
// TODO Auto-generated method stub
// TODO fix these are hardcoded paths
return new File("/Users/ericvergnaud/Development/antlr4/antlr/antlr4-csharp/tool/test/org/antlr/v4/test/rt/csharp");
return new File("../../antlr4-csharp/tool/test/org/antlr/v4/test/rt/csharp");
}
private static File readPython2Dir() {
// TODO Auto-generated method stub
return new File("/Users/ericvergnaud/Development/antlr4/antlr/antlr4-python2/tool/test/org/antlr/v4/test/rt/py2");
return new File("../../antlr4-python2/tool/test/org/antlr/v4/test/rt/py2");
}
private static File readPython3Dir() {
// TODO Auto-generated method stub
return new File("/Users/ericvergnaud/Development/antlr4/antlr/antlr4-python3/tool/test/org/antlr/v4/test/rt/py3");
return new File("../../antlr4-python3/tool/test/org/antlr/v4/test/rt/py3");
}
private static File readNodeJSDir() {
// TODO Auto-generated method stub
return new File("/Users/ericvergnaud/Development/antlr4/antlr/antlr4-javascript/tool/test/org/antlr/v4/test/rt/js/node");
return new File("../../antlr4-javascript/tool/test/org/antlr/v4/test/rt/js/node");
}
private static File readSafariDir() {
// TODO read from env variable
return new File("/Users/ericvergnaud/Development/antlr4/antlr/antlr4-javascript/tool/test/org/antlr/v4/test/rt/js/safari");
return new File("../../antlr4-javascript/tool/test/org/antlr/v4/test/rt/js/safari");
}
private static File readFirefoxDir() {
// TODO read from env variable
return new File("/Users/ericvergnaud/Development/antlr4/antlr/antlr4-javascript/tool/test/org/antlr/v4/test/rt/js/firefox");
return new File("../..//antlr4-javascript/tool/test/org/antlr/v4/test/rt/js/firefox");
}
private static File readChromeDir() {
// TODO read from env variable
return new File("/Users/ericvergnaud/Development/antlr4/antlr/antlr4-javascript/tool/test/org/antlr/v4/test/rt/js/firefox");
return new File("../..//antlr4-javascript/tool/test/org/antlr/v4/test/rt/js/chrome");
}
private static File readGrammarDir() throws Exception {

View File

@ -655,10 +655,14 @@ public abstract class BaseTest {
}
public Class<?> loadClassFromTempDir(String name) throws Exception {
ClassLoader loader =
URLClassLoader loader =
new URLClassLoader(new URL[] { new File(tmpdir).toURI().toURL() },
ClassLoader.getSystemClassLoader());
return loader.loadClass(name);
try {
return loader.loadClass(name);
} finally {
loader.close();
}
}
public Class<? extends Lexer> loadLexerClassFromTempDir(String name) throws Exception {
@ -775,8 +779,9 @@ public abstract class BaseTest {
public String execClass(String className) {
if (TEST_IN_SAME_PROCESS) {
URLClassLoader loader = null;
try {
ClassLoader loader = new URLClassLoader(new URL[] { new File(tmpdir).toURI().toURL() }, ClassLoader.getSystemClassLoader());
loader = new URLClassLoader(new URL[] { new File(tmpdir).toURI().toURL() }, ClassLoader.getSystemClassLoader());
final Class<?> mainClass = (Class<?>)loader.loadClass(className);
final Method mainMethod = mainClass.getDeclaredMethod("main", String[].class);
PipedInputStream stdoutIn = new PipedInputStream();
@ -841,6 +846,12 @@ public abstract class BaseTest {
} catch (ClassNotFoundException ex) {
LOGGER.log(Level.SEVERE, null, ex);
throw new RuntimeException(ex);
} finally {
if(loader!=null) try {
loader.close();
} catch(IOException e) {
LOGGER.log(Level.WARNING, null, e);
}
}
}

View File

@ -19,6 +19,7 @@ public class Test<file.name> extends BaseTest {
>>
LexerTestMethod(test) ::= <<
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void test<test.name>() throws Exception {
<test.slaveGrammars:{ grammar |
@ -47,6 +48,7 @@ CompositeLexerTestMethod(test) ::= <<
ParserTestMethod(test) ::= <<
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void test<test.name>() throws Exception {
<test.slaveGrammars:{ grammar |
@ -76,6 +78,7 @@ CompositeParserTestMethod(test) ::= <<
>>
AbstractParserTestMethod(test) ::= <<
/* this file and method are generated, any edit will be overwritten by the next generation */
String test<test.name>(String input) throws Exception {
String grammar = <test.grammar.lines:{ line | "<line>};separator="\\n\" +\n", wrap, anchor>";
return execParser("<test.grammar.grammarName>.g4", grammar, "<test.grammar.grammarName>Parser", "<test.grammar.grammarName>Lexer", "<test.startRule>", input, <test.debug>);
@ -84,6 +87,7 @@ String test<test.name>(String input) throws Exception {
>>
ConcreteParserTestMethod(test) ::= <<
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void test<test.name>() throws Exception {
String found = test<test.baseName>("<test.input>");

View File

@ -5,6 +5,7 @@ import static org.junit.Assert.*;
public class TestCompositeLexers extends BaseTest {
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLexerDelegatorInvokesDelegateRule() throws Exception {
String slave_S = "lexer grammar S;\n" +
@ -28,6 +29,7 @@ public class TestCompositeLexers extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLexerDelegatorRuleOverridesDelegate() throws Exception {
String slave_S = "lexer grammar S;\n" +

View File

@ -8,6 +8,7 @@ import org.antlr.v4.tool.Grammar;
public class TestCompositeParsers extends BaseTest {
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDelegatorInvokesDelegateRule() throws Exception {
String slave_S = "parser grammar S;\n" +
@ -25,6 +26,7 @@ public class TestCompositeParsers extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testBringInLiteralsFromDelegate() throws Exception {
String slave_S = "parser grammar S;\n" +
@ -41,6 +43,7 @@ public class TestCompositeParsers extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDelegatorInvokesDelegateRuleWithArgs() throws Exception {
String slave_S = "parser grammar S;\n" +
@ -58,6 +61,7 @@ public class TestCompositeParsers extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDelegatorInvokesDelegateRuleWithReturnStruct() throws Exception {
String slave_S = "parser grammar S;\n" +
@ -75,6 +79,7 @@ public class TestCompositeParsers extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDelegatorAccessesDelegateMembers() throws Exception {
String slave_S = "parser grammar S;\n" +
@ -94,6 +99,7 @@ public class TestCompositeParsers extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDelegatorInvokesFirstVersionOfDelegateRule() throws Exception {
String slave_S = "parser grammar S;\n" +
@ -117,6 +123,7 @@ public class TestCompositeParsers extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDelegatesSeeSameTokenType() throws Exception {
String slave_S = "parser grammar S;\n" +
@ -164,6 +171,7 @@ public class TestCompositeParsers extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCombinedImportsCombined() throws Exception {
String slave_S = "parser grammar S;\n" +
@ -187,6 +195,7 @@ public class TestCompositeParsers extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDelegatorRuleOverridesDelegate() throws Exception {
String slave_S = "parser grammar S;\n" +
@ -204,6 +213,7 @@ public class TestCompositeParsers extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDelegatorRuleOverridesLookaheadInDelegate() throws Exception {
String slave_S = "parser grammar S;\n" +
@ -226,6 +236,7 @@ public class TestCompositeParsers extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDelegatorRuleOverridesDelegates() throws Exception {
String slave_S = "parser grammar S;\n" +
@ -250,6 +261,7 @@ public class TestCompositeParsers extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testKeywordVSIDOrder() throws Exception {
String slave_S = "lexer grammar S;\n" +
@ -267,6 +279,7 @@ public class TestCompositeParsers extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testImportedRuleWithAction() throws Exception {
String slave_S = "parser grammar S;\n" +
@ -284,6 +297,7 @@ public class TestCompositeParsers extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testImportedGrammarWithEmptyOptions() throws Exception {
String slave_S = "parser grammar S;\n" +
@ -302,6 +316,7 @@ public class TestCompositeParsers extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testImportLexerWithOnlyFragmentRules() throws Exception {
String slave_S = "lexer grammar S;\n" +

View File

@ -5,6 +5,7 @@ import static org.junit.Assert.*;
public class TestFullContextParsing extends BaseTest {
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAmbigYieldsCtxSensitiveDFA() throws Exception {
String grammar = "grammar T;\n" +
@ -17,6 +18,7 @@ public class TestFullContextParsing extends BaseTest {
assertEquals("line 1:0 reportAttemptingFullContext d=0 (s), input='abc'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testCtxSensitiveDFA(String input) throws Exception {
String grammar = "grammar T;\n" +
"s @after {this.dumpDFA();}\n" +
@ -30,6 +32,7 @@ public class TestFullContextParsing extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, true);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCtxSensitiveDFA_1() throws Exception {
String found = testCtxSensitiveDFA("$ 34 abc");
@ -37,6 +40,7 @@ public class TestFullContextParsing extends BaseTest {
assertEquals("line 1:5 reportAttemptingFullContext d=1 (e), input='34abc'\nline 1:2 reportContextSensitivity d=1 (e), input='34'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCtxSensitiveDFA_2() throws Exception {
String found = testCtxSensitiveDFA("@ 34 abc");
@ -44,6 +48,7 @@ public class TestFullContextParsing extends BaseTest {
assertEquals("line 1:5 reportAttemptingFullContext d=1 (e), input='34abc'\nline 1:5 reportContextSensitivity d=1 (e), input='34abc'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCtxSensitiveDFATwoDiffInput() throws Exception {
String grammar = "grammar T;\n" +
@ -60,6 +65,7 @@ public class TestFullContextParsing extends BaseTest {
assertEquals("line 1:5 reportAttemptingFullContext d=2 (e), input='34abc'\nline 1:2 reportContextSensitivity d=2 (e), input='34'\nline 1:14 reportAttemptingFullContext d=2 (e), input='34abc'\nline 1:14 reportContextSensitivity d=2 (e), input='34abc'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSLLSeesEOFInLLGrammar() throws Exception {
String grammar = "grammar T;\n" +
@ -76,6 +82,7 @@ public class TestFullContextParsing extends BaseTest {
assertEquals("line 1:3 reportAttemptingFullContext d=0 (e), input='34abc'\nline 1:0 reportContextSensitivity d=0 (e), input='34'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testFullContextIF_THEN_ELSEParse(String input) throws Exception {
String grammar = "grammar T;\n" +
"s \n" +
@ -90,6 +97,7 @@ public class TestFullContextParsing extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, true);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testFullContextIF_THEN_ELSEParse_1() throws Exception {
String found = testFullContextIF_THEN_ELSEParse("{ if x then return }");
@ -97,6 +105,7 @@ public class TestFullContextParsing extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testFullContextIF_THEN_ELSEParse_2() throws Exception {
String found = testFullContextIF_THEN_ELSEParse("{ if x then return else foo }");
@ -104,6 +113,7 @@ public class TestFullContextParsing extends BaseTest {
assertEquals("line 1:19 reportAttemptingFullContext d=1 (stat), input='else'\nline 1:19 reportContextSensitivity d=1 (stat), input='else'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testFullContextIF_THEN_ELSEParse_3() throws Exception {
String found = testFullContextIF_THEN_ELSEParse("{ if x then if y then return else foo }");
@ -111,6 +121,7 @@ public class TestFullContextParsing extends BaseTest {
assertEquals("line 1:29 reportAttemptingFullContext d=1 (stat), input='else'\nline 1:38 reportAmbiguity d=1 (stat): ambigAlts={1, 2}, input='elsefoo}'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testFullContextIF_THEN_ELSEParse_4() throws Exception {
String found = testFullContextIF_THEN_ELSEParse("{ if x then if y then return else foo else bar }");
@ -118,6 +129,7 @@ public class TestFullContextParsing extends BaseTest {
assertEquals("line 1:29 reportAttemptingFullContext d=1 (stat), input='else'\nline 1:38 reportContextSensitivity d=1 (stat), input='elsefooelse'\nline 1:38 reportAttemptingFullContext d=1 (stat), input='else'\nline 1:38 reportContextSensitivity d=1 (stat), input='else'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testFullContextIF_THEN_ELSEParse_5() throws Exception {
String found = testFullContextIF_THEN_ELSEParse("{ if x then return else foo\nif x then if y then return else foo }");
@ -125,6 +137,7 @@ public class TestFullContextParsing extends BaseTest {
assertEquals("line 1:19 reportAttemptingFullContext d=1 (stat), input='else'\nline 1:19 reportContextSensitivity d=1 (stat), input='else'\nline 2:27 reportAttemptingFullContext d=1 (stat), input='else'\nline 2:36 reportAmbiguity d=1 (stat): ambigAlts={1, 2}, input='elsefoo}'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testFullContextIF_THEN_ELSEParse_6() throws Exception {
String found = testFullContextIF_THEN_ELSEParse("{ if x then return else foo\nif x then if y then return else foo }");
@ -132,6 +145,7 @@ public class TestFullContextParsing extends BaseTest {
assertEquals("line 1:19 reportAttemptingFullContext d=1 (stat), input='else'\nline 1:19 reportContextSensitivity d=1 (stat), input='else'\nline 2:27 reportAttemptingFullContext d=1 (stat), input='else'\nline 2:36 reportAmbiguity d=1 (stat): ambigAlts={1, 2}, input='elsefoo}'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLoopsSimulateTailRecursion() throws Exception {
String grammar = "grammar T;\n" +
@ -154,6 +168,7 @@ public class TestFullContextParsing extends BaseTest {
assertEquals("line 1:3 reportAttemptingFullContext d=3 (expr_primary), input='a(i)'\nline 1:7 reportAmbiguity d=3 (expr_primary): ambigAlts={2, 3}, input='a(i)<-x'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAmbiguityNoLoop() throws Exception {
String grammar = "grammar T;\n" +
@ -173,6 +188,7 @@ public class TestFullContextParsing extends BaseTest {
assertEquals("line 1:2 reportAttemptingFullContext d=0 (prog), input='a@'\nline 1:2 reportAmbiguity d=0 (prog): ambigAlts={1, 2}, input='a@'\nline 1:2 reportAttemptingFullContext d=1 (expr), input='a@'\nline 1:2 reportContextSensitivity d=1 (expr), input='a@'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testExprAmbiguity(String input) throws Exception {
String grammar = "grammar T;\n" +
"s\n" +
@ -190,6 +206,7 @@ public class TestFullContextParsing extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, true);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testExprAmbiguity_1() throws Exception {
String found = testExprAmbiguity("a+b");
@ -197,6 +214,7 @@ public class TestFullContextParsing extends BaseTest {
assertEquals("line 1:1 reportAttemptingFullContext d=1 (expr), input='+'\nline 1:2 reportContextSensitivity d=1 (expr), input='+b'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testExprAmbiguity_2() throws Exception {
String found = testExprAmbiguity("a+b*c");

View File

@ -5,6 +5,7 @@ import static org.junit.Assert.*;
public class TestLeftRecursion extends BaseTest {
/* this file and method are generated, any edit will be overwritten by the next generation */
String testSimple(String input) throws Exception {
String grammar = "grammar T;\n" +
"s @after {System.out.println($ctx.toStringTree(this));} : a ;\n" +
@ -16,6 +17,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSimple_1() throws Exception {
String found = testSimple("x");
@ -23,6 +25,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSimple_2() throws Exception {
String found = testSimple("x y");
@ -30,6 +33,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSimple_3() throws Exception {
String found = testSimple("x y z");
@ -37,6 +41,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testDirectCallToLeftRecursiveRule(String input) throws Exception {
String grammar = "grammar T;\n" +
"a @after {System.out.println($ctx.toStringTree(this));} : a ID\n" +
@ -47,6 +52,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "a", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDirectCallToLeftRecursiveRule_1() throws Exception {
String found = testDirectCallToLeftRecursiveRule("x");
@ -54,6 +60,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDirectCallToLeftRecursiveRule_2() throws Exception {
String found = testDirectCallToLeftRecursiveRule("x y");
@ -61,6 +68,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDirectCallToLeftRecursiveRule_3() throws Exception {
String found = testDirectCallToLeftRecursiveRule("x y z");
@ -68,6 +76,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSemPred() throws Exception {
String grammar = "grammar T;\n" +
@ -82,6 +91,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testTernaryExpr(String input) throws Exception {
String grammar = "grammar T;\n" +
"s @after {System.out.println($ctx.toStringTree(this));} : e EOF ; // must indicate EOF can follow or 'a<EOF>' won't match\n" +
@ -96,6 +106,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExpr_1() throws Exception {
String found = testTernaryExpr("a");
@ -103,6 +114,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExpr_2() throws Exception {
String found = testTernaryExpr("a+b");
@ -110,6 +122,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExpr_3() throws Exception {
String found = testTernaryExpr("a*b");
@ -117,6 +130,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExpr_4() throws Exception {
String found = testTernaryExpr("a?b:c");
@ -124,6 +138,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExpr_5() throws Exception {
String found = testTernaryExpr("a=b=c");
@ -131,6 +146,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExpr_6() throws Exception {
String found = testTernaryExpr("a?b+c:d");
@ -138,6 +154,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExpr_7() throws Exception {
String found = testTernaryExpr("a?b=c:d");
@ -145,6 +162,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExpr_8() throws Exception {
String found = testTernaryExpr("a? b?c:d : e");
@ -152,6 +170,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExpr_9() throws Exception {
String found = testTernaryExpr("a?b: c?d:e");
@ -159,6 +178,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testExpressions(String input) throws Exception {
String grammar = "grammar T;\n" +
"s @after {System.out.println($ctx.toStringTree(this));} : e EOF ; // must indicate EOF can follow\n" +
@ -176,6 +196,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testExpressions_1() throws Exception {
String found = testExpressions("a");
@ -183,6 +204,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testExpressions_2() throws Exception {
String found = testExpressions("1");
@ -190,6 +212,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testExpressions_3() throws Exception {
String found = testExpressions("a-1");
@ -197,6 +220,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testExpressions_4() throws Exception {
String found = testExpressions("a.b");
@ -204,6 +228,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testExpressions_5() throws Exception {
String found = testExpressions("a.this");
@ -211,6 +236,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testExpressions_6() throws Exception {
String found = testExpressions("-a");
@ -218,6 +244,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testExpressions_7() throws Exception {
String found = testExpressions("-a+b");
@ -225,6 +252,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testJavaExpressions(String input) throws Exception {
String grammar = "grammar T;\n" +
"s @after {System.out.println($ctx.toStringTree(this));} : e EOF ; // must indicate EOF can follow\n" +
@ -285,6 +313,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testJavaExpressions_1() throws Exception {
String found = testJavaExpressions("a|b&c");
@ -292,6 +321,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testJavaExpressions_2() throws Exception {
String found = testJavaExpressions("(a|b)&c");
@ -299,6 +329,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testJavaExpressions_3() throws Exception {
String found = testJavaExpressions("a > b");
@ -306,6 +337,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testJavaExpressions_4() throws Exception {
String found = testJavaExpressions("a >> b");
@ -313,6 +345,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testJavaExpressions_5() throws Exception {
String found = testJavaExpressions("a=b=c");
@ -320,6 +353,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testJavaExpressions_6() throws Exception {
String found = testJavaExpressions("a^b^c");
@ -327,6 +361,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testJavaExpressions_7() throws Exception {
String found = testJavaExpressions("(T)x");
@ -334,6 +369,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testJavaExpressions_8() throws Exception {
String found = testJavaExpressions("new A().b");
@ -341,6 +377,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testJavaExpressions_9() throws Exception {
String found = testJavaExpressions("(T)t.f()");
@ -348,6 +385,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testJavaExpressions_10() throws Exception {
String found = testJavaExpressions("a.f(x)==T.c");
@ -355,6 +393,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testJavaExpressions_11() throws Exception {
String found = testJavaExpressions("a.f().g(x,1)");
@ -362,6 +401,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testJavaExpressions_12() throws Exception {
String found = testJavaExpressions("new T[((n-1) * x) + 1]");
@ -369,6 +409,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testDeclarations(String input) throws Exception {
String grammar = "grammar T;\n" +
"s @after {System.out.println($ctx.toStringTree(this));} : declarator EOF ; // must indicate EOF can follow\n" +
@ -387,6 +428,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDeclarations_1() throws Exception {
String found = testDeclarations("a");
@ -394,6 +436,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDeclarations_2() throws Exception {
String found = testDeclarations("*a");
@ -401,6 +444,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDeclarations_3() throws Exception {
String found = testDeclarations("**a");
@ -408,6 +452,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDeclarations_4() throws Exception {
String found = testDeclarations("a[3]");
@ -415,6 +460,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDeclarations_5() throws Exception {
String found = testDeclarations("b[]");
@ -422,6 +468,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDeclarations_6() throws Exception {
String found = testDeclarations("(a)");
@ -429,6 +476,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDeclarations_7() throws Exception {
String found = testDeclarations("a[]()");
@ -436,6 +484,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDeclarations_8() throws Exception {
String found = testDeclarations("a[][]");
@ -443,6 +492,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDeclarations_9() throws Exception {
String found = testDeclarations("*a[]");
@ -450,6 +500,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDeclarations_10() throws Exception {
String found = testDeclarations("(*a)[]");
@ -457,6 +508,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testReturnValueAndActions(String input) throws Exception {
String grammar = "grammar T;\n" +
"s : e {System.out.println($e.v);}; \n" +
@ -471,6 +523,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActions_1() throws Exception {
String found = testReturnValueAndActions("4");
@ -478,6 +531,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActions_2() throws Exception {
String found = testReturnValueAndActions("1+2");
@ -485,6 +539,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActions_3() throws Exception {
String found = testReturnValueAndActions("1+2*3");
@ -492,6 +547,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActions_4() throws Exception {
String found = testReturnValueAndActions("(1+2)*3");
@ -499,6 +555,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testLabelsOnOpSubrule(String input) throws Exception {
String grammar = "grammar T;\n" +
"s @after {System.out.println($ctx.toStringTree(this));} : e;\n" +
@ -511,6 +568,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLabelsOnOpSubrule_1() throws Exception {
String found = testLabelsOnOpSubrule("4");
@ -518,6 +576,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLabelsOnOpSubrule_2() throws Exception {
String found = testLabelsOnOpSubrule("1*2/3");
@ -525,6 +584,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLabelsOnOpSubrule_3() throws Exception {
String found = testLabelsOnOpSubrule("(1/2)*3");
@ -532,6 +592,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testReturnValueAndActionsAndLabels(String input) throws Exception {
String grammar = "grammar T;\n" +
"s : q=e {System.out.println($e.v);}; \n" +
@ -550,6 +611,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActionsAndLabels_1() throws Exception {
String found = testReturnValueAndActionsAndLabels("4");
@ -557,6 +619,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActionsAndLabels_2() throws Exception {
String found = testReturnValueAndActionsAndLabels("1+2");
@ -564,6 +627,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActionsAndLabels_3() throws Exception {
String found = testReturnValueAndActionsAndLabels("1+2*3");
@ -571,6 +635,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActionsAndLabels_4() throws Exception {
String found = testReturnValueAndActionsAndLabels("i++*3");
@ -578,6 +643,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testMultipleAlternativesWithCommonLabel(String input) throws Exception {
String grammar = "grammar T;\n" +
"s : e {System.out.println($e.v);}; \n" +
@ -598,6 +664,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testMultipleAlternativesWithCommonLabel_1() throws Exception {
String found = testMultipleAlternativesWithCommonLabel("4");
@ -605,6 +672,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testMultipleAlternativesWithCommonLabel_2() throws Exception {
String found = testMultipleAlternativesWithCommonLabel("1+2");
@ -612,6 +680,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testMultipleAlternativesWithCommonLabel_3() throws Exception {
String found = testMultipleAlternativesWithCommonLabel("1+2*3");
@ -619,6 +688,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testMultipleAlternativesWithCommonLabel_4() throws Exception {
String found = testMultipleAlternativesWithCommonLabel("i++*3");
@ -626,6 +696,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testPrefixOpWithActionAndLabel(String input) throws Exception {
String grammar = "grammar T;\n" +
"s : e {System.out.println($e.result);} ;\n" +
@ -640,6 +711,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPrefixOpWithActionAndLabel_1() throws Exception {
String found = testPrefixOpWithActionAndLabel("a");
@ -647,6 +719,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPrefixOpWithActionAndLabel_2() throws Exception {
String found = testPrefixOpWithActionAndLabel("a+b");
@ -654,6 +727,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPrefixOpWithActionAndLabel_3() throws Exception {
String found = testPrefixOpWithActionAndLabel("a=b+c");
@ -661,6 +735,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testAmbigLR(String input) throws Exception {
String grammar = "grammar Expr;\n" +
"prog: stat ;\n" +
@ -686,6 +761,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("Expr.g4", grammar, "ExprParser", "ExprLexer", "prog", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAmbigLR_1() throws Exception {
String found = testAmbigLR("1\n");
@ -693,6 +769,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAmbigLR_2() throws Exception {
String found = testAmbigLR("a = 5\n");
@ -700,6 +777,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAmbigLR_3() throws Exception {
String found = testAmbigLR("b = 6\n");
@ -707,6 +785,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAmbigLR_4() throws Exception {
String found = testAmbigLR("a+b*2\n");
@ -714,6 +793,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAmbigLR_5() throws Exception {
String found = testAmbigLR("(1+2)*3\n");
@ -721,6 +801,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testWhitespaceInfluence(String input) throws Exception {
String grammar = "grammar Expr;\n" +
"prog : expression EOF;\n" +
@ -774,6 +855,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("Expr.g4", grammar, "ExprParser", "ExprLexer", "prog", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testWhitespaceInfluence_1() throws Exception {
String found = testWhitespaceInfluence("Test(1,3)");
@ -781,6 +863,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testWhitespaceInfluence_2() throws Exception {
String found = testWhitespaceInfluence("Test(1, 3)");
@ -788,6 +871,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPrecedenceFilterConsidersContext() throws Exception {
String grammar = "grammar T;\n" +
@ -801,6 +885,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testMultipleActions(String input) throws Exception {
String grammar = "grammar T;\n" +
"s @after {System.out.println($ctx.toStringTree(this));} : e ;\n" +
@ -813,6 +898,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testMultipleActions_1() throws Exception {
String found = testMultipleActions("4");
@ -820,6 +906,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testMultipleActions_2() throws Exception {
String found = testMultipleActions("1*2/3");
@ -827,6 +914,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testMultipleActions_3() throws Exception {
String found = testMultipleActions("(1/2)*3");
@ -834,6 +922,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testMultipleActionsPredicatesOptions(String input) throws Exception {
String grammar = "grammar T;\n" +
"s @after {System.out.println($ctx.toStringTree(this));} : e ;\n" +
@ -847,6 +936,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testMultipleActionsPredicatesOptions_1() throws Exception {
String found = testMultipleActionsPredicatesOptions("4");
@ -854,6 +944,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testMultipleActionsPredicatesOptions_2() throws Exception {
String found = testMultipleActionsPredicatesOptions("1*2/3");
@ -861,6 +952,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testMultipleActionsPredicatesOptions_3() throws Exception {
String found = testMultipleActionsPredicatesOptions("(1/2)*3");
@ -868,6 +960,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSemPredFailOption() throws Exception {
String grammar = "grammar T;\n" +
@ -882,6 +975,7 @@ public class TestLeftRecursion extends BaseTest {
assertEquals("line 1:4 rule a custom message\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testTernaryExprExplicitAssociativity(String input) throws Exception {
String grammar = "grammar T;\n" +
"s @after {System.out.println($ctx.toStringTree(this));} : e EOF; // must indicate EOF can follow or 'a<EOF>' won't match\n" +
@ -896,6 +990,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExprExplicitAssociativity_1() throws Exception {
String found = testTernaryExprExplicitAssociativity("a");
@ -903,6 +998,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExprExplicitAssociativity_2() throws Exception {
String found = testTernaryExprExplicitAssociativity("a+b");
@ -910,6 +1006,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExprExplicitAssociativity_3() throws Exception {
String found = testTernaryExprExplicitAssociativity("a*b");
@ -917,6 +1014,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExprExplicitAssociativity_4() throws Exception {
String found = testTernaryExprExplicitAssociativity("a?b:c");
@ -924,6 +1022,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExprExplicitAssociativity_5() throws Exception {
String found = testTernaryExprExplicitAssociativity("a=b=c");
@ -931,6 +1030,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExprExplicitAssociativity_6() throws Exception {
String found = testTernaryExprExplicitAssociativity("a?b+c:d");
@ -938,6 +1038,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExprExplicitAssociativity_7() throws Exception {
String found = testTernaryExprExplicitAssociativity("a?b=c:d");
@ -945,6 +1046,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExprExplicitAssociativity_8() throws Exception {
String found = testTernaryExprExplicitAssociativity("a? b?c:d : e");
@ -952,6 +1054,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTernaryExprExplicitAssociativity_9() throws Exception {
String found = testTernaryExprExplicitAssociativity("a?b: c?d:e");
@ -959,6 +1062,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testReturnValueAndActionsList1(String input) throws Exception {
String grammar = "grammar T;\n" +
"s @after {System.out.println($ctx.toStringTree(this));} : expr EOF;\n" +
@ -976,6 +1080,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActionsList1_1() throws Exception {
String found = testReturnValueAndActionsList1("a*b");
@ -983,6 +1088,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActionsList1_2() throws Exception {
String found = testReturnValueAndActionsList1("a,c>>x");
@ -990,6 +1096,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActionsList1_3() throws Exception {
String found = testReturnValueAndActionsList1("x");
@ -997,6 +1104,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActionsList1_4() throws Exception {
String found = testReturnValueAndActionsList1("a*b,c,x*y>>r");
@ -1004,6 +1112,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testReturnValueAndActionsList2(String input) throws Exception {
String grammar = "grammar T;\n" +
"s @after {System.out.println($ctx.toStringTree(this));} : expr EOF;\n" +
@ -1020,6 +1129,7 @@ public class TestLeftRecursion extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActionsList2_1() throws Exception {
String found = testReturnValueAndActionsList2("a*b");
@ -1027,6 +1137,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActionsList2_2() throws Exception {
String found = testReturnValueAndActionsList2("a,c>>x");
@ -1034,6 +1145,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActionsList2_3() throws Exception {
String found = testReturnValueAndActionsList2("x");
@ -1041,6 +1153,7 @@ public class TestLeftRecursion extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReturnValueAndActionsList2_4() throws Exception {
String found = testReturnValueAndActionsList2("a*b,c,x*y>>r");

View File

@ -5,6 +5,7 @@ import static org.junit.Assert.*;
public class TestLexerErrors extends BaseTest {
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testInvalidCharAtStart() throws Exception {
StringBuilder sb = new StringBuilder();
@ -16,6 +17,7 @@ public class TestLexerErrors extends BaseTest {
assertEquals("line 1:0 token recognition error at: 'x'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testStringsEmbeddedInActions_1() throws Exception {
StringBuilder sb = new StringBuilder();
@ -30,6 +32,7 @@ public class TestLexerErrors extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testStringsEmbeddedInActions_2() throws Exception {
StringBuilder sb = new StringBuilder();
@ -43,6 +46,7 @@ public class TestLexerErrors extends BaseTest {
assertEquals("line 1:0 token recognition error at: '[\"foo]'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testEnforcedGreedyNestedBrances_1() throws Exception {
StringBuilder sb = new StringBuilder();
@ -56,6 +60,7 @@ public class TestLexerErrors extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testEnforcedGreedyNestedBrances_2() throws Exception {
StringBuilder sb = new StringBuilder();
@ -68,6 +73,7 @@ public class TestLexerErrors extends BaseTest {
assertEquals("line 1:0 token recognition error at: '{ { }'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testInvalidCharAtStartAfterDFACache() throws Exception {
StringBuilder sb = new StringBuilder();
@ -80,6 +86,7 @@ public class TestLexerErrors extends BaseTest {
assertEquals("line 1:2 token recognition error at: 'x'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testInvalidCharInToken() throws Exception {
StringBuilder sb = new StringBuilder();
@ -91,6 +98,7 @@ public class TestLexerErrors extends BaseTest {
assertEquals("line 1:0 token recognition error at: 'ax'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testInvalidCharInTokenAfterDFACache() throws Exception {
StringBuilder sb = new StringBuilder();
@ -103,6 +111,7 @@ public class TestLexerErrors extends BaseTest {
assertEquals("line 1:2 token recognition error at: 'ax'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDFAToATNThatFailsBackToDFA() throws Exception {
StringBuilder sb = new StringBuilder();
@ -117,6 +126,7 @@ public class TestLexerErrors extends BaseTest {
assertEquals("line 1:4 token recognition error at: 'x'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDFAToATNThatMatchesThenFailsInATN() throws Exception {
StringBuilder sb = new StringBuilder();
@ -132,6 +142,7 @@ public class TestLexerErrors extends BaseTest {
assertEquals("line 1:5 token recognition error at: 'x'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testErrorInMiddle() throws Exception {
StringBuilder sb = new StringBuilder();
@ -143,6 +154,7 @@ public class TestLexerErrors extends BaseTest {
assertEquals("line 1:0 token recognition error at: 'abx'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLexerExecDFA() throws Exception {
StringBuilder sb = new StringBuilder();

View File

@ -5,6 +5,7 @@ import static org.junit.Assert.*;
public class TestLexerExec extends BaseTest {
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testQuoteTranslation() throws Exception {
StringBuilder sb = new StringBuilder();
@ -17,6 +18,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testRefToRuleDoesNotSetTokenNorEmitAnother() throws Exception {
StringBuilder sb = new StringBuilder();
@ -33,6 +35,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSlashes() throws Exception {
StringBuilder sb = new StringBuilder();
@ -52,6 +55,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testParentheses() throws Exception {
StringBuilder sb = new StringBuilder();
@ -70,6 +74,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testNonGreedyTermination1() throws Exception {
StringBuilder sb = new StringBuilder();
@ -83,6 +88,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testNonGreedyTermination2() throws Exception {
StringBuilder sb = new StringBuilder();
@ -95,6 +101,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testGreedyOptional() throws Exception {
StringBuilder sb = new StringBuilder();
@ -108,6 +115,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testNonGreedyOptional() throws Exception {
StringBuilder sb = new StringBuilder();
@ -122,6 +130,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testGreedyClosure() throws Exception {
StringBuilder sb = new StringBuilder();
@ -135,6 +144,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testNonGreedyClosure() throws Exception {
StringBuilder sb = new StringBuilder();
@ -149,6 +159,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testGreedyPositiveClosure() throws Exception {
StringBuilder sb = new StringBuilder();
@ -162,6 +173,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testNonGreedyPositiveClosure() throws Exception {
StringBuilder sb = new StringBuilder();
@ -176,6 +188,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testRecursiveLexerRuleRefWithWildcardStar_1() throws Exception {
StringBuilder sb = new StringBuilder();
@ -192,6 +205,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testRecursiveLexerRuleRefWithWildcardStar_2() throws Exception {
StringBuilder sb = new StringBuilder();
@ -208,6 +222,7 @@ public class TestLexerExec extends BaseTest {
assertEquals("line 1:9 token recognition error at: 'x'\nline 3:16 token recognition error at: 'x'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testRecursiveLexerRuleRefWithWildcardPlus_1() throws Exception {
StringBuilder sb = new StringBuilder();
@ -224,6 +239,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testRecursiveLexerRuleRefWithWildcardPlus_2() throws Exception {
StringBuilder sb = new StringBuilder();
@ -240,6 +256,7 @@ public class TestLexerExec extends BaseTest {
assertEquals("line 1:9 token recognition error at: 'x'\nline 3:16 token recognition error at: 'x'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testActionPlacement() throws Exception {
StringBuilder sb = new StringBuilder();
@ -262,6 +279,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testGreedyConfigs() throws Exception {
StringBuilder sb = new StringBuilder();
@ -277,6 +295,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testNonGreedyConfigs() throws Exception {
StringBuilder sb = new StringBuilder();
@ -294,6 +313,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testKeywordID() throws Exception {
StringBuilder sb = new StringBuilder();
@ -314,6 +334,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testHexVsID() throws Exception {
StringBuilder sb = new StringBuilder();
@ -344,6 +365,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testEOFByItself() throws Exception {
StringBuilder sb = new StringBuilder();
@ -357,6 +379,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testEOFSuffixInFirstRule_1() throws Exception {
StringBuilder sb = new StringBuilder();
@ -370,6 +393,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testEOFSuffixInFirstRule_2() throws Exception {
StringBuilder sb = new StringBuilder();
@ -384,6 +408,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCharSet() throws Exception {
StringBuilder sb = new StringBuilder();
@ -400,6 +425,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCharSetPlus() throws Exception {
StringBuilder sb = new StringBuilder();
@ -416,6 +442,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCharSetNot() throws Exception {
StringBuilder sb = new StringBuilder();
@ -430,6 +457,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCharSetInSet() throws Exception {
StringBuilder sb = new StringBuilder();
@ -447,6 +475,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCharSetRange() throws Exception {
StringBuilder sb = new StringBuilder();
@ -468,6 +497,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCharSetWithMissingEndRange() throws Exception {
StringBuilder sb = new StringBuilder();
@ -482,6 +512,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCharSetWithMissingEscapeChar() throws Exception {
StringBuilder sb = new StringBuilder();
@ -496,6 +527,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCharSetWithEscapedChar() throws Exception {
StringBuilder sb = new StringBuilder();
@ -512,6 +544,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCharSetWithReversedRange() throws Exception {
StringBuilder sb = new StringBuilder();
@ -526,6 +559,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCharSetWithQuote1() throws Exception {
StringBuilder sb = new StringBuilder();
@ -540,6 +574,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCharSetWithQuote2() throws Exception {
StringBuilder sb = new StringBuilder();
@ -554,6 +589,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPositionAdjustingLexer() throws Exception {
StringBuilder sb = new StringBuilder();
@ -685,6 +721,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLargeLexer() throws Exception {
StringBuilder sb = new StringBuilder();
@ -4697,6 +4734,7 @@ public class TestLexerExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testZeroLengthToken() throws Exception {
StringBuilder sb = new StringBuilder();

View File

@ -5,6 +5,7 @@ import static org.junit.Assert.*;
public class TestListeners extends BaseTest {
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testBasic() throws Exception {
String grammar = "grammar T;\n" +
@ -39,6 +40,7 @@ public class TestListeners extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testTokenGetters(String input) throws Exception {
String grammar = "grammar T;\n" +
"@parser::header {\n" +
@ -74,6 +76,7 @@ public class TestListeners extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTokenGetters_1() throws Exception {
String found = testTokenGetters("1 2");
@ -81,6 +84,7 @@ public class TestListeners extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTokenGetters_2() throws Exception {
String found = testTokenGetters("abc");
@ -88,6 +92,7 @@ public class TestListeners extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testRuleGetters(String input) throws Exception {
String grammar = "grammar T;\n" +
"@parser::header {\n" +
@ -124,6 +129,7 @@ public class TestListeners extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "s", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testRuleGetters_1() throws Exception {
String found = testRuleGetters("1 2");
@ -131,6 +137,7 @@ public class TestListeners extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testRuleGetters_2() throws Exception {
String found = testRuleGetters("abc");
@ -138,6 +145,7 @@ public class TestListeners extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLR() throws Exception {
String grammar = "grammar T;\n" +
@ -177,6 +185,7 @@ public class TestListeners extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLRWithLabels() throws Exception {
String grammar = "grammar T;\n" +

View File

@ -5,6 +5,7 @@ import static org.junit.Assert.*;
public class TestParseTrees extends BaseTest {
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTokenAndRuleContextString() throws Exception {
String grammar = "grammar T;\n" +
@ -24,6 +25,7 @@ public class TestParseTrees extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testToken2() throws Exception {
String grammar = "grammar T;\n" +
@ -42,6 +44,7 @@ public class TestParseTrees extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void test2Alts() throws Exception {
String grammar = "grammar T;\n" +
@ -60,6 +63,7 @@ public class TestParseTrees extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void test2AltLoop() throws Exception {
String grammar = "grammar T;\n" +
@ -78,6 +82,7 @@ public class TestParseTrees extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testRuleRef() throws Exception {
String grammar = "grammar T;\n" +
@ -98,6 +103,7 @@ public class TestParseTrees extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testExtraToken() throws Exception {
String grammar = "grammar T;\n" +
@ -118,6 +124,7 @@ public class TestParseTrees extends BaseTest {
assertEquals("line 1:1 extraneous input 'z' expecting 'y'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testNoViableAlt() throws Exception {
String grammar = "grammar T;\n" +
@ -139,6 +146,7 @@ public class TestParseTrees extends BaseTest {
assertEquals("line 1:0 mismatched input 'z' expecting {'x', 'y'}\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSync() throws Exception {
String grammar = "grammar T;\n" +

View File

@ -5,6 +5,7 @@ import static org.junit.Assert.*;
public class TestParserErrors extends BaseTest {
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testTokenMismatch() throws Exception {
String grammar = "grammar T;\n" +
@ -14,6 +15,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:1 mismatched input 'a' expecting 'b'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSingleTokenDeletion() throws Exception {
String grammar = "grammar T;\n" +
@ -23,6 +25,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:1 extraneous input 'a' expecting 'b'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSingleTokenDeletionExpectingSet() throws Exception {
String grammar = "grammar T;\n" +
@ -32,6 +35,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:1 extraneous input 'a' expecting {'b', 'c'}\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSingleTokenInsertion() throws Exception {
String grammar = "grammar T;\n" +
@ -41,6 +45,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:1 missing 'b' at 'c'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testConjuringUpToken() throws Exception {
String grammar = "grammar T;\n" +
@ -50,6 +55,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:1 missing 'b' at 'c'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSingleSetInsertion() throws Exception {
String grammar = "grammar T;\n" +
@ -59,6 +65,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:1 missing {'b', 'c'} at 'd'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testConjuringUpTokenFromSet() throws Exception {
String grammar = "grammar T;\n" +
@ -68,6 +75,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:1 missing {'b', 'c'} at 'd'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLL2() throws Exception {
String grammar = "grammar T;\n" +
@ -80,6 +88,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:1 no viable alternative at input 'ae'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLL3() throws Exception {
String grammar = "grammar T;\n" +
@ -92,6 +101,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:2 no viable alternative at input 'abe'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLLStar() throws Exception {
String grammar = "grammar T;\n" +
@ -104,6 +114,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:3 no viable alternative at input 'aaae'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSingleTokenDeletionBeforeLoop() throws Exception {
String grammar = "grammar T;\n" +
@ -113,6 +124,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:1 extraneous input 'a' expecting {<EOF>, 'b'}\nline 1:3 token recognition error at: 'c'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testMultiTokenDeletionBeforeLoop() throws Exception {
String grammar = "grammar T;\n" +
@ -122,6 +134,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:1 extraneous input 'a' expecting {'b', 'c'}\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSingleTokenDeletionDuringLoop() throws Exception {
String grammar = "grammar T;\n" +
@ -131,6 +144,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:2 extraneous input 'a' expecting {'b', 'c'}\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testMultiTokenDeletionDuringLoop() throws Exception {
String grammar = "grammar T;\n" +
@ -140,6 +154,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:2 extraneous input 'a' expecting {'b', 'c'}\nline 1:6 extraneous input 'a' expecting {'b', 'c'}\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSingleTokenDeletionBeforeLoop2() throws Exception {
String grammar = "grammar T;\n" +
@ -149,6 +164,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:1 extraneous input 'a' expecting {<EOF>, 'b', 'z'}\nline 1:3 token recognition error at: 'c'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testMultiTokenDeletionBeforeLoop2() throws Exception {
String grammar = "grammar T;\n" +
@ -158,6 +174,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:1 extraneous input 'a' expecting {'b', 'z', 'c'}\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSingleTokenDeletionDuringLoop2() throws Exception {
String grammar = "grammar T;\n" +
@ -167,6 +184,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:2 extraneous input 'a' expecting {'b', 'z', 'c'}\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testMultiTokenDeletionDuringLoop2() throws Exception {
String grammar = "grammar T;\n" +
@ -176,6 +194,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:2 extraneous input 'a' expecting {'b', 'z', 'c'}\nline 1:6 extraneous input 'a' expecting {'b', 'z', 'c'}\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLL1ErrorInfo() throws Exception {
String grammar = "grammar T;\n" +
@ -197,6 +216,7 @@ public class TestParserErrors extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testInvalidEmptyInput() throws Exception {
String grammar = "grammar T;\n" +
@ -207,6 +227,7 @@ public class TestParserErrors extends BaseTest {
assertEquals("line 1:0 missing ID at '<EOF>'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testContextListGetters() throws Exception {
String grammar = "grammar T;\n" +
@ -225,6 +246,7 @@ public class TestParserErrors extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testDuplicatedLeftRecursiveCall(String input) throws Exception {
String grammar = "grammar T;\n" +
"start : expr EOF;\n" +
@ -234,6 +256,7 @@ public class TestParserErrors extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "start", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDuplicatedLeftRecursiveCall_1() throws Exception {
String found = testDuplicatedLeftRecursiveCall("xx");
@ -241,6 +264,7 @@ public class TestParserErrors extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDuplicatedLeftRecursiveCall_2() throws Exception {
String found = testDuplicatedLeftRecursiveCall("xxx");
@ -248,6 +272,7 @@ public class TestParserErrors extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDuplicatedLeftRecursiveCall_3() throws Exception {
String found = testDuplicatedLeftRecursiveCall("xxxx");
@ -255,6 +280,7 @@ public class TestParserErrors extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testInvalidATNStateRemoval() throws Exception {
String grammar = "grammar T;\n" +
@ -267,6 +293,7 @@ public class TestParserErrors extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testNoViableAltAvoidance() throws Exception {
String grammar = "grammar T;\n" +

View File

@ -5,6 +5,7 @@ import static org.junit.Assert.*;
public class TestParserExec extends BaseTest {
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLabels() throws Exception {
String grammar = "grammar T;\n" +
@ -18,6 +19,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testListLabelsOnSet() throws Exception {
String grammar = "grammar T;\n" +
@ -32,6 +34,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAorB() throws Exception {
String grammar = "grammar T;\n" +
@ -48,6 +51,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testBasic() throws Exception {
String grammar = "grammar T;\n" +
@ -62,6 +66,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAPlus() throws Exception {
String grammar = "grammar T;\n" +
@ -75,6 +80,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAorAPlus() throws Exception {
String grammar = "grammar T;\n" +
@ -88,6 +94,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testIfIfElseGreedyBinding1() throws Exception {
String grammar = "grammar T;\n" +
@ -103,6 +110,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testIfIfElseGreedyBinding2() throws Exception {
String grammar = "grammar T;\n" +
@ -118,6 +126,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testIfIfElseNonGreedyBinding1() throws Exception {
String grammar = "grammar T;\n" +
@ -133,6 +142,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testIfIfElseNonGreedyBinding2() throws Exception {
String grammar = "grammar T;\n" +
@ -148,6 +158,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testAStar(String input) throws Exception {
String grammar = "grammar T;\n" +
"a : ID* {\n" +
@ -158,6 +169,7 @@ public class TestParserExec extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "a", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAStar_1() throws Exception {
String found = testAStar("");
@ -165,6 +177,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAStar_2() throws Exception {
String found = testAStar("a b c");
@ -172,6 +185,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testLL1OptionalBlock(String input) throws Exception {
String grammar = "grammar T;\n" +
"a : (ID|{}INT)? {\n" +
@ -183,6 +197,7 @@ public class TestParserExec extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "a", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLL1OptionalBlock_1() throws Exception {
String found = testLL1OptionalBlock("");
@ -190,6 +205,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLL1OptionalBlock_2() throws Exception {
String found = testLL1OptionalBlock("a");
@ -197,6 +213,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testAorAStar(String input) throws Exception {
String grammar = "grammar T;\n" +
"a : (ID|ID)* {\n" +
@ -207,6 +224,7 @@ public class TestParserExec extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "a", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAorAStar_1() throws Exception {
String found = testAorAStar("");
@ -214,6 +232,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAorAStar_2() throws Exception {
String found = testAorAStar("a b c");
@ -221,6 +240,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAorBPlus() throws Exception {
String grammar = "grammar T;\n" +
@ -236,6 +256,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testAorBStar(String input) throws Exception {
String grammar = "grammar T;\n" +
"a : (ID|INT{\n" +
@ -248,6 +269,7 @@ public class TestParserExec extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "a", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAorBStar_1() throws Exception {
String found = testAorBStar("");
@ -255,6 +277,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAorBStar_2() throws Exception {
String found = testAorBStar("a 34 c");
@ -262,6 +285,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testOptional(String input) throws Exception {
String grammar = "grammar T;\n" +
"stat : ifstat | 'x';\n" +
@ -270,6 +294,7 @@ public class TestParserExec extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "stat", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testOptional_1() throws Exception {
String found = testOptional("x");
@ -277,6 +302,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testOptional_2() throws Exception {
String found = testOptional("if x");
@ -284,6 +310,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testOptional_3() throws Exception {
String found = testOptional("if x else x");
@ -291,6 +318,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testOptional_4() throws Exception {
String found = testOptional("if if x else x");
@ -298,6 +326,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPredicatedIfIfElse() throws Exception {
String grammar = "grammar T;\n" +
@ -312,6 +341,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLabelAliasingAcrossLabeledAlternatives() throws Exception {
String grammar = "grammar T;\n" +
@ -327,6 +357,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPredictionIssue334() throws Exception {
String grammar = "grammar T;\n" +
@ -347,6 +378,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testListLabelForClosureContext() throws Exception {
String grammar = "grammar T;\n" +
@ -374,6 +406,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testMultipleEOFHandling() throws Exception {
String grammar = "grammar T;\n" +
@ -383,6 +416,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testEOFInClosure() throws Exception {
String grammar = "grammar T;\n" +
@ -393,6 +427,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testReferenceToATN(String input) throws Exception {
String grammar = "grammar T;\n" +
"a : (ID|ATN_)* ATN_? {System.out.println($text);} ;\n" +
@ -402,6 +437,7 @@ public class TestParserExec extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "a", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReferenceToATN_1() throws Exception {
String found = testReferenceToATN("");
@ -409,6 +445,7 @@ public class TestParserExec extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testReferenceToATN_2() throws Exception {
String found = testReferenceToATN("a 34 c");

View File

@ -5,6 +5,7 @@ import static org.junit.Assert.*;
public class TestSemPredEvalLexer extends BaseTest {
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDisableRule() throws Exception {
StringBuilder sb = new StringBuilder();
@ -28,6 +29,7 @@ public class TestSemPredEvalLexer extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testIDvsEnum() throws Exception {
StringBuilder sb = new StringBuilder();
@ -51,6 +53,7 @@ public class TestSemPredEvalLexer extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testIDnotEnum() throws Exception {
StringBuilder sb = new StringBuilder();
@ -68,6 +71,7 @@ public class TestSemPredEvalLexer extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testEnumNotID() throws Exception {
StringBuilder sb = new StringBuilder();
@ -85,6 +89,7 @@ public class TestSemPredEvalLexer extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testIndent() throws Exception {
StringBuilder sb = new StringBuilder();
@ -115,6 +120,7 @@ public class TestSemPredEvalLexer extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLexerInputPositionSensitivePredicates() throws Exception {
StringBuilder sb = new StringBuilder();
@ -138,6 +144,7 @@ public class TestSemPredEvalLexer extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPredicatedKeywords() throws Exception {
StringBuilder sb = new StringBuilder();

View File

@ -5,6 +5,7 @@ import static org.junit.Assert.*;
public class TestSemPredEvalParser extends BaseTest {
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSimpleValidate() throws Exception {
String grammar = "grammar T;\n" +
@ -20,6 +21,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertEquals("line 1:0 no viable alternative at input 'x'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSimpleValidate2() throws Exception {
String grammar = "grammar T;\n" +
@ -35,6 +37,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertEquals("line 1:4 no viable alternative at input 'x'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testAtomWithClosureInTranslatedLRRule() throws Exception {
String grammar = "grammar T;\n" +
@ -47,6 +50,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testValidateInDFA() throws Exception {
String grammar = "grammar T;\n" +
@ -65,6 +69,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertEquals("line 1:0 no viable alternative at input 'x'\nline 1:4 no viable alternative at input 'y'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSimple() throws Exception {
String grammar = "grammar T;\n" +
@ -81,6 +86,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testOrder() throws Exception {
String grammar = "grammar T;\n" +
@ -98,6 +104,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void test2UnpredicatedAlts() throws Exception {
String grammar = "grammar T;\n" +
@ -114,6 +121,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertEquals("line 1:0 reportAttemptingFullContext d=0 (a), input='x'\nline 1:0 reportAmbiguity d=0 (a): ambigAlts={1, 2}, input='x'\nline 1:3 reportAttemptingFullContext d=0 (a), input='y'\nline 1:3 reportAmbiguity d=0 (a): ambigAlts={1, 2}, input='y'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void test2UnpredicatedAltsAndOneOrthogonalAlt() throws Exception {
String grammar = "grammar T;\n" +
@ -131,6 +139,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertEquals("line 1:4 reportAttemptingFullContext d=0 (a), input='x'\nline 1:4 reportAmbiguity d=0 (a): ambigAlts={2, 3}, input='x'\nline 1:7 reportAttemptingFullContext d=0 (a), input='y'\nline 1:7 reportAmbiguity d=0 (a): ambigAlts={2, 3}, input='y'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testRewindBeforePredEval() throws Exception {
String grammar = "grammar T;\n" +
@ -146,6 +155,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testNoTruePredsThrowsNoViableAlt() throws Exception {
String grammar = "grammar T;\n" +
@ -161,6 +171,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertEquals("line 1:0 no viable alternative at input 'y'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testToLeft() throws Exception {
String grammar = "grammar T;\n" +
@ -176,6 +187,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testUnpredicatedPathsInAlt() throws Exception {
String grammar = "grammar T;\n" +
@ -195,6 +207,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testActionHidesPreds() throws Exception {
String grammar = "grammar T;\n" +
@ -211,6 +224,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testToLeftWithVaryingPredicate() throws Exception {
String grammar = "grammar T;\n" +
@ -228,6 +242,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPredicateDependentOnArg() throws Exception {
String grammar = "grammar T;\n" +
@ -245,6 +260,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPredicateDependentOnArg2() throws Exception {
String grammar = "grammar T;\n" +
@ -262,6 +278,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDependentPredNotInOuterCtxShouldBeIgnored() throws Exception {
String grammar = "grammar T;\n" +
@ -279,6 +296,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testIndependentPredNotPassedOuterCtxToAvoidCastException() throws Exception {
String grammar = "grammar T;\n" +
@ -296,6 +314,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPredsInGlobalFOLLOW() throws Exception {
String grammar = "grammar T;\n" +
@ -316,6 +335,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDepedentPredsInGlobalFOLLOW() throws Exception {
String grammar = "grammar T;\n" +
@ -337,6 +357,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testActionsHidePredsInGlobalFOLLOW() throws Exception {
String grammar = "grammar T;\n" +
@ -357,6 +378,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testPredTestedEvenWhenUnAmbig(String input) throws Exception {
String grammar = "grammar T;\n" +
"@members {boolean enumKeyword = true;}\n" +
@ -369,6 +391,7 @@ public class TestSemPredEvalParser extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "primary", input, true);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPredTestedEvenWhenUnAmbig_1() throws Exception {
String found = testPredTestedEvenWhenUnAmbig("abc");
@ -376,6 +399,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPredTestedEvenWhenUnAmbig_2() throws Exception {
String found = testPredTestedEvenWhenUnAmbig("enum");
@ -383,6 +407,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertEquals("line 1:0 no viable alternative at input 'enum'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testDisabledAlternative() throws Exception {
String grammar = "grammar T;\n" +
@ -395,6 +420,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testPredFromAltTestedInLoopBack(String input) throws Exception {
String grammar = "grammar T;\n" +
"file_\n" +
@ -408,6 +434,7 @@ public class TestSemPredEvalParser extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "file_", input, true);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPredFromAltTestedInLoopBack_1() throws Exception {
String found = testPredFromAltTestedInLoopBack("s\n\n\nx\n");
@ -415,6 +442,7 @@ public class TestSemPredEvalParser extends BaseTest {
assertEquals("line 5:0 mismatched input '<EOF>' expecting '\n'\n", this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPredFromAltTestedInLoopBack_2() throws Exception {
String found = testPredFromAltTestedInLoopBack("s\n\n\nx\n\n");

View File

@ -5,6 +5,7 @@ import static org.junit.Assert.*;
public class TestSets extends BaseTest {
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testSeqDoesNotBecomeSet() throws Exception {
String grammar = "grammar T;\n" +
@ -17,6 +18,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testParserSet() throws Exception {
String grammar = "grammar T;\n" +
@ -26,6 +28,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testParserNotSet() throws Exception {
String grammar = "grammar T;\n" +
@ -35,6 +38,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testParserNotToken() throws Exception {
String grammar = "grammar T;\n" +
@ -44,6 +48,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testParserNotTokenWithLabel() throws Exception {
String grammar = "grammar T;\n" +
@ -53,6 +58,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testRuleAsSet() throws Exception {
String grammar = "grammar T;\n" +
@ -62,6 +68,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testNotChar() throws Exception {
String grammar = "grammar T;\n" +
@ -72,6 +79,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testOptionalSingleElement() throws Exception {
String grammar = "grammar T;\n" +
@ -82,6 +90,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testOptionalLexerSingleElement() throws Exception {
String grammar = "grammar T;\n" +
@ -92,6 +101,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
String testStarLexerSingleElement(String input) throws Exception {
String grammar = "grammar T;\n" +
"a : A {System.out.println(this._input.getText());} ;\n" +
@ -99,6 +109,7 @@ public class TestSets extends BaseTest {
return execParser("T.g4", grammar, "TParser", "TLexer", "a", input, false);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testStarLexerSingleElement_1() throws Exception {
String found = testStarLexerSingleElement("bbbbc");
@ -106,6 +117,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testStarLexerSingleElement_2() throws Exception {
String found = testStarLexerSingleElement("c");
@ -113,6 +125,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPlusLexerSingleElement() throws Exception {
String grammar = "grammar T;\n" +
@ -123,6 +136,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testOptionalSet() throws Exception {
String grammar = "grammar T;\n" +
@ -132,6 +146,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testStarSet() throws Exception {
String grammar = "grammar T;\n" +
@ -141,6 +156,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testPlusSet() throws Exception {
String grammar = "grammar T;\n" +
@ -150,6 +166,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLexerOptionalSet() throws Exception {
String grammar = "grammar T;\n" +
@ -160,6 +177,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLexerStarSet() throws Exception {
String grammar = "grammar T;\n" +
@ -170,6 +188,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testLexerPlusSet() throws Exception {
String grammar = "grammar T;\n" +
@ -180,6 +199,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testNotCharSet() throws Exception {
String grammar = "grammar T;\n" +
@ -190,6 +210,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testNotCharSetWithLabel() throws Exception {
String grammar = "grammar T;\n" +
@ -200,6 +221,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testNotCharSetWithRuleRef3() throws Exception {
String grammar = "grammar T;\n" +
@ -212,6 +234,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testCharSetLiteral() throws Exception {
String grammar = "grammar T;\n" +
@ -223,6 +246,7 @@ public class TestSets extends BaseTest {
assertNull(this.stderrDuringParse);
}
/* this file and method are generated, any edit will be overwritten by the next generation */
@Test
public void testComplementSet() throws Exception {
String grammar = "grammar T;\n" +