Home | History | Annotate | Download | only in tests
      1 import antlr3
      2 import testbase
      3 import unittest
      4 
      5 
      6 class t030specialStates(testbase.ANTLRTest):
      7     def setUp(self):
      8         self.compileGrammar()
      9         
     10 
     11     def testValid1(self):
     12         cStream = antlr3.StringStream('foo')
     13         lexer = self.getLexer(cStream)
     14         tStream = antlr3.CommonTokenStream(lexer)
     15         parser = self.getParser(tStream)
     16         events = parser.r()
     17 
     18 
     19     def testValid2(self):
     20         cStream = antlr3.StringStream('foo name1')
     21         lexer = self.getLexer(cStream)
     22         tStream = antlr3.CommonTokenStream(lexer)
     23         parser = self.getParser(tStream)
     24         events = parser.r()
     25 
     26 
     27     def testValid3(self):
     28         cStream = antlr3.StringStream('bar name1')
     29         lexer = self.getLexer(cStream)
     30         tStream = antlr3.CommonTokenStream(lexer)
     31         parser = self.getParser(tStream)
     32         parser.cond = False
     33         events = parser.r()
     34 
     35 
     36     def testValid4(self):
     37         cStream = antlr3.StringStream('bar name1 name2')
     38         lexer = self.getLexer(cStream)
     39         tStream = antlr3.CommonTokenStream(lexer)
     40         parser = self.getParser(tStream)
     41         parser.cond = False
     42         events = parser.r()
     43 
     44 
     45 if __name__ == '__main__':
     46     unittest.main()
     47 
     48