Lines Matching refs:self
16 def parserClass(self, base): argument
18 def recover(self, input, re): argument
25 def parse(self, text, method, rArgs=[], **kwargs): argument
26 self.compileGrammar() #options='-trace')
29 self.lexer = self.getLexer(cStream)
30 tStream = antlr3.CommonTokenStream(self.lexer)
31 self.parser = self.getParser(tStream)
34 setattr(self.parser, attr, val)
36 return getattr(self.parser, method)(*rArgs)
39 def testR1(self): argument
40 r = self.parse("1 + 2", 'r1')
41 self.failUnlessEqual(
47 def testR2a(self): argument
48 r = self.parse("assert 2+3;", 'r2')
49 self.failUnlessEqual(
55 def testR2b(self): argument
56 r = self.parse("assert 2+3 : 5;", 'r2')
57 self.failUnlessEqual(
63 def testR3a(self): argument
64 r = self.parse("if 1 fooze", 'r3')
65 self.failUnlessEqual(
71 def testR3b(self): argument
72 r = self.parse("if 1 fooze else fooze", 'r3')
73 self.failUnlessEqual(
79 def testR4a(self): argument
80 r = self.parse("while 2 fooze", 'r4')
81 self.failUnlessEqual(
87 def testR5a(self): argument
88 r = self.parse("return;", 'r5')
89 self.failUnlessEqual(
95 def testR5b(self): argument
96 r = self.parse("return 2+3;", 'r5')
97 self.failUnlessEqual(
103 def testR6a(self): argument
104 r = self.parse("3", 'r6')
105 self.failUnlessEqual(
111 def testR6b(self): argument
112 r = self.parse("3 a", 'r6')
113 self.failUnlessEqual(
119 def testR7(self): argument
120 r = self.parse("3", 'r7')
121 self.failUnless(
126 def testR8(self): argument
127 r = self.parse("var foo:bool", 'r8')
128 self.failUnlessEqual(
134 def testR9(self): argument
135 r = self.parse("int foo;", 'r9')
136 self.failUnlessEqual(
142 def testR10(self): argument
143 r = self.parse("10", 'r10')
144 self.failUnlessEqual(
150 def testR11a(self): argument
151 r = self.parse("1+2", 'r11')
152 self.failUnlessEqual(
158 def testR11b(self): argument
159 r = self.parse("", 'r11')
160 self.failUnlessEqual(
166 def testR12a(self): argument
167 r = self.parse("foo", 'r12')
168 self.failUnlessEqual(
174 def testR12b(self): argument
175 r = self.parse("foo, bar, gnurz", 'r12')
176 self.failUnlessEqual(
182 def testR13a(self): argument
183 r = self.parse("int foo;", 'r13')
184 self.failUnlessEqual(
190 def testR13b(self): argument
191 r = self.parse("bool foo, bar, gnurz;", 'r13')
192 self.failUnlessEqual(
198 def testR14a(self): argument
199 r = self.parse("1+2 int", 'r14')
200 self.failUnlessEqual(
206 def testR14b(self): argument
207 r = self.parse("1+2 int bool", 'r14')
208 self.failUnlessEqual(
214 def testR14c(self): argument
215 r = self.parse("int bool", 'r14')
216 self.failUnlessEqual(
222 def testR14d(self): argument
223 r = self.parse("fooze fooze int bool", 'r14')
224 self.failUnlessEqual(
230 def testR14e(self): argument
231 r = self.parse("7+9 fooze fooze int bool", 'r14')
232 self.failUnlessEqual(
238 def testR15(self): argument
239 r = self.parse("7", 'r15')
240 self.failUnlessEqual(
246 def testR16a(self): argument
247 r = self.parse("int foo", 'r16')
248 self.failUnlessEqual(
254 def testR16b(self): argument
255 r = self.parse("int foo, bar, gnurz", 'r16')
257 self.failUnlessEqual(
263 def testR17a(self): argument
264 r = self.parse("for ( fooze ; 1 + 2 ; fooze ) fooze", 'r17')
265 self.failUnlessEqual(
271 def testR18a(self): argument
272 r = self.parse("for", 'r18')
273 self.failUnlessEqual(
279 def testR19a(self): argument
280 r = self.parse("for", 'r19')
281 self.failUnlessEqual(
287 def testR20a(self): argument
288 r = self.parse("for", 'r20')
289 self.failUnlessEqual(
295 def testR21a(self): argument
296 r = self.parse("for", 'r21')
297 self.failUnlessEqual(
303 def testR22a(self): argument
304 r = self.parse("for", 'r22')
305 self.failUnlessEqual(
311 def testR23a(self): argument
312 r = self.parse("for", 'r23')
313 self.failUnlessEqual(
319 def testR24a(self): argument
320 r = self.parse("fooze 1 + 2", 'r24')
321 self.failUnlessEqual(
327 def testR25a(self): argument
328 r = self.parse("fooze, fooze2 1 + 2", 'r25')
329 self.failUnlessEqual(
335 def testR26a(self): argument
336 r = self.parse("fooze, fooze2", 'r26')
337 self.failUnlessEqual(
343 def testR27a(self): argument
344 r = self.parse("fooze 1 + 2", 'r27')
345 self.failUnlessEqual(
351 def testR28(self): argument
352 r = self.parse("foo28a", 'r28')
353 self.failUnless(
358 def testR29(self): argument
360 r = self.parse("", 'r29')
361 self.fail()
375 def testR31a(self): argument
376 r = self.parse("public int gnurz = 1 + 2;", 'r31', flag=0)
377 self.failUnlessEqual(
383 def testR31b(self): argument
384 r = self.parse("public int gnurz = 1 + 2;", 'r31', flag=1)
385 self.failUnlessEqual(
391 def testR31c(self): argument
392 r = self.parse("public int gnurz = 1 + 2;", 'r31', flag=2)
393 self.failUnlessEqual(
399 def testR32a(self): argument
400 r = self.parse("gnurz 32", 'r32', [1], flag=2)
401 self.failUnlessEqual(
407 def testR32b(self): argument
408 r = self.parse("gnurz 32", 'r32', [2], flag=2)
409 self.failUnlessEqual(
415 def testR32c(self): argument
416 r = self.parse("gnurz 32", 'r32', [3], flag=2)
417 self.failUnless(
422 def testR33a(self): argument
423 r = self.parse("public private fooze", 'r33')
424 self.failUnlessEqual(
430 def testR34a(self): argument
431 r = self.parse("public class gnurz { fooze fooze2 }", 'r34')
432 self.failUnlessEqual(
438 def testR34b(self): argument
439 … r = self.parse("public class gnurz extends bool implements int, bool { fooze fooze2 }", 'r34')
440 self.failUnlessEqual(
446 def testR35(self): argument
448 r = self.parse("{ extends }", 'r35')
449 self.fail()
455 def testR36a(self): argument
456 r = self.parse("if ( 1 + 2 ) fooze", 'r36')
457 self.failUnlessEqual(
463 def testR36b(self): argument
464 r = self.parse("if ( 1 + 2 ) fooze else fooze2", 'r36')
465 self.failUnlessEqual(
471 def testR37(self): argument
472 r = self.parse("1 + 2 + 3", 'r37')
473 self.failUnlessEqual(
479 def testR38(self): argument
480 r = self.parse("1 + 2 + 3", 'r38')
481 self.failUnlessEqual(
487 def testR39a(self): argument
488 r = self.parse("gnurz[1]", 'r39')
489 self.failUnlessEqual(
495 def testR39b(self): argument
496 r = self.parse("gnurz(2)", 'r39')
497 self.failUnlessEqual(
503 def testR39c(self): argument
504 r = self.parse("gnurz.gnarz", 'r39')
505 self.failUnlessEqual(
511 def testR39d(self): argument
512 r = self.parse("gnurz.gnarz.gnorz", 'r39')
513 self.failUnlessEqual(
519 def testR40(self): argument
520 r = self.parse("1 + 2 + 3;", 'r40')
521 self.failUnlessEqual(
527 def testR41(self): argument
528 r = self.parse("1 + 2 + 3;", 'r41')
529 self.failUnlessEqual(
535 def testR42(self): argument
536 r = self.parse("gnurz, gnarz, gnorz", 'r42')
537 self.failUnlessEqual(
543 def testR43(self): argument
544 r = self.parse("gnurz, gnarz, gnorz", 'r43')
545 self.failUnless(
548 self.failUnlessEqual(
554 def testR44(self): argument
555 r = self.parse("gnurz, gnarz, gnorz", 'r44')
556 self.failUnlessEqual(
562 def testR45(self): argument
563 r = self.parse("gnurz", 'r45')
564 self.failUnlessEqual(
570 def testR46(self): argument
571 r = self.parse("gnurz, gnarz, gnorz", 'r46')
572 self.failUnless(
575 self.failUnlessEqual(
581 def testR47(self): argument
582 r = self.parse("gnurz, gnarz, gnorz", 'r47')
583 self.failUnlessEqual(
589 def testR48(self): argument
590 r = self.parse("gnurz, gnarz, gnorz", 'r48')
591 self.failUnlessEqual(
597 def testR49(self): argument
598 r = self.parse("gnurz gnorz", 'r49')
599 self.failUnlessEqual(
605 def testR50(self): argument
606 r = self.parse("gnurz", 'r50')
607 self.failUnlessEqual(
613 def testR51(self): argument
614 r = self.parse("gnurza gnurzb gnurzc", 'r51')
615 self.failUnlessEqual(
621 def testR52(self): argument
622 r = self.parse("gnurz", 'r52')
623 self.failUnlessEqual(
629 def testR53(self): argument
630 r = self.parse("gnurz", 'r53')
631 self.failUnlessEqual(
637 def testR54(self): argument
638 r = self.parse("gnurza 1 + 2 gnurzb", 'r54')
639 self.failUnlessEqual(
645 def testR55a(self): argument
646 r = self.parse("public private 1 + 2", 'r55')
647 self.failUnlessEqual(
653 def testR55b(self): argument
654 r = self.parse("public fooze", 'r55')
655 self.failUnlessEqual(
661 def testR56(self): argument
662 r = self.parse("a b c d", 'r56')
663 self.failUnlessEqual(
669 def testR57(self): argument
670 r = self.parse("a b c d", 'r57')
671 self.failUnlessEqual(
677 def testR59(self): argument
678 r = self.parse("a b c fooze", 'r59')
679 self.failUnlessEqual(