aboutsummaryrefslogtreecommitdiff
path: root/antlr-3.4/runtime/Python/tests/t019lexer.py
blob: de21d33245a062cdc438482f3d2e51c3d1e0a7cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
import antlr3
import testbase
import unittest

class t019lexer(testbase.ANTLRTest):
    def setUp(self):
        self.compileGrammar()
        

    def testValid(self):
        inputPath = os.path.splitext(__file__)[0] + '.input'
        stream = antlr3.StringStream(open(inputPath).read())
        lexer = self.getLexer(stream)

        while True:
            token = lexer.nextToken()
            if token.type == antlr3.EOF:
                break

if __name__ == '__main__':
    unittest.main()