@@ -54,12 +54,12 @@ public class TestLeftRecursion extends BasePython2Test {
54
54
String expecting = "(s (a x))\n " ;
55
55
assertEquals (expecting , found );
56
56
57
- found = execParser ("T.g4" , grammar , "TParser" , "TLexer" , "TListener" , "TVisitor" ,
57
+ found = execParser ("T.g4" , grammar , "TParser" , "TLexer" , "TListener" , "TVisitor" ,
58
58
"s" , "x y" , debug );
59
59
expecting = "(s (a (a x) y))\n " ;
60
60
assertEquals (expecting , found );
61
61
62
- found = execParser ("T.g4" , grammar , "TParser" , "TLexer" , "TListener" , "TVisitor" ,
62
+ found = execParser ("T.g4" , grammar , "TParser" , "TLexer" , "TListener" , "TVisitor" ,
63
63
"s" , "x y z" , debug );
64
64
expecting = "(s (a (a (a x) y) z))\n " ;
65
65
assertEquals (expecting , found );
@@ -78,17 +78,17 @@ public class TestLeftRecursion extends BasePython2Test {
78
78
" ;\n " +
79
79
"ID : 'a'..'z'+ ;\n " +
80
80
"WS : (' '|'\\ n') -> skip ;\n " ;
81
- String found = execParser ("T.g4" , grammar , "TParser" , "TLexer" , "TListener" , "TVisitor" ,
81
+ String found = execParser ("T.g4" , grammar , "TParser" , "TLexer" , "TListener" , "TVisitor" ,
82
82
"a" , "x" , debug );
83
83
String expecting = "(a x)\n " ;
84
84
assertEquals (expecting , found );
85
85
86
- found = execParser ("T.g4" , grammar , "TParser" , "TLexer" , "TListener" , "TVisitor" ,
86
+ found = execParser ("T.g4" , grammar , "TParser" , "TLexer" , "TListener" , "TVisitor" ,
87
87
"a" , "x y" , debug );
88
88
expecting = "(a (a x) y)\n " ;
89
89
assertEquals (expecting , found );
90
90
91
- found = execParser ("T.g4" , grammar , "TParser" , "TLexer" , "TListener" , "TVisitor" ,
91
+ found = execParser ("T.g4" , grammar , "TParser" , "TLexer" , "TListener" , "TVisitor" ,
92
92
"a" , "x y z" , debug );
93
93
expecting = "(a (a (a x) y) z)\n " ;
94
94
assertEquals (expecting , found );
@@ -103,7 +103,7 @@ public class TestLeftRecursion extends BasePython2Test {
103
103
" ;\n " +
104
104
"ID : 'a'..'z'+ ;\n " +
105
105
"WS : (' '|'\\ n') -> skip ;\n " ;
106
- String found = execParser ("T.g4" , grammar , "TParser" , "TLexer" , "TListener" , "TVisitor" ,
106
+ String found = execParser ("T.g4" , grammar , "TParser" , "TLexer" , "TListener" , "TVisitor" ,
107
107
"s" , "x y z" , debug );
108
108
String expecting = "(s (a (a (a x) y) z))\n " ;
109
109
assertEquals (expecting , found );
@@ -226,7 +226,7 @@ public class TestLeftRecursion extends BasePython2Test {
226
226
"INT : '0'..'9'+ ;\n " +
227
227
"WS : (' '|'\\ n') -> skip ;\n " ;
228
228
String [] tests = {
229
- "a|b&c" , "(s (e (e a) | (e (e b) & (e c))) <EOF>)" ,
229
+ "a|b&c" , "(s (e (e a) | (e (e b) & (e c))) <EOF>)" ,
230
230
"(a|b)&c" , "(s (e (e ( (e (e a) | (e b)) )) & (e c)) <EOF>)" ,
231
231
"a > b" , "(s (e (e a) > (e b)) <EOF>)" ,
232
232
"a >> b" , "(s (e (e a) >> (e b)) <EOF>)" ,
@@ -237,7 +237,7 @@ public class TestLeftRecursion extends BasePython2Test {
237
237
"(T)t.f()" , "(s (e (e ( (type T) ) (e (e t) . f)) ( )) <EOF>)" ,
238
238
"a.f(x)==T.c" , "(s (e (e (e (e a) . f) ( (expressionList (e x)) )) == (e (e T) . c)) <EOF>)" ,
239
239
"a.f().g(x,1)" , "(s (e (e (e (e (e a) . f) ( )) . g) ( (expressionList (e x) , (e 1)) )) <EOF>)" ,
240
- "new T[((n-1) * x) + 1]" , "(s (e new (type T) [ (e (e ( (e (e ( (e (e n) - (e 1)) )) * (e x)) )) + (e 1)) ]) <EOF>)" ,
240
+ "new T[((n-1) * x) + 1]" , "(s (e new (type T) [ (e (e ( (e (e ( (e (e n) - (e 1)) )) * (e x)) )) + (e 1)) ]) <EOF>)" ,
241
241
};
242
242
runTests (grammar , tests , "s" );
243
243
}
@@ -305,9 +305,9 @@ public class TestLeftRecursion extends BasePython2Test {
305
305
"INT : '0'..'9'+ ;\n " +
306
306
"WS : (' '|'\\ n') -> skip ;\n " ;
307
307
String [] tests = {
308
- "4" , "(s (e 4))" ,
308
+ "4" , "(s (e 4))" ,
309
309
"1*2/3" , "(s (e (e (e 1) * (e 2)) / (e 3)))" ,
310
- "(1/2)*3" , "(s (e (e ( (e (e 1) / (e 2)) )) * (e 3)))" ,
310
+ "(1/2)*3" , "(s (e (e ( (e (e 1) / (e 2)) )) * (e 3)))" ,
311
311
};
312
312
runTests (grammar , tests , "s" );
313
313
}
@@ -444,7 +444,7 @@ public void testAmbigLR() throws Exception {
444
444
"ID : 'a'..'z'+ ;\n " +
445
445
"WS : (' '|'\\ n') -> skip ;\n " ;
446
446
String expected =
447
- "error(" + ErrorType .NO_NON_LR_ALTS .code + "): T.g4:3:0: left recursive rule 'a' must contain an alternative which is not left recursive\n " ;
447
+ "error(" + ErrorType .NO_NON_LR_ALTS .code + "): T.g4:3:0: left recursive rule a must contain an alternative which is not left recursive\n " ;
448
448
testErrors (new String [] { grammar , expected }, false );
449
449
}
450
450
@@ -458,7 +458,7 @@ public void testAmbigLR() throws Exception {
458
458
"ID : 'a'..'z'+ ;\n " +
459
459
"WS : (' '|'\\ n') -> skip ;\n " ;
460
460
String expected =
461
- "error(" + ErrorType .EPSILON_LR_FOLLOW .code + "): T.g4:3:0: left recursive rule 'a' contains a left recursive alternative which can be followed by the empty string\n " ;
461
+ "error(" + ErrorType .EPSILON_LR_FOLLOW .code + "): T.g4:3:0: left recursive rule a contains a left recursive alternative which can be followed by the empty string\n " ;
462
462
testErrors (new String [] { grammar , expected }, false );
463
463
}
464
464
0 commit comments