Last change
on this file since 1 was
1,
checked in by lnalod, 15 years ago
|
Initial import of YAO sources
|
File size:
800 bytes
|
Line | |
---|
1 | // This is -*- ANTLR -*- code |
---|
2 | |
---|
3 | header { |
---|
4 | import sys |
---|
5 | } |
---|
6 | |
---|
7 | options { |
---|
8 | language = "Python"; |
---|
9 | } |
---|
10 | |
---|
11 | //---------------------------------------------------------------------------- |
---|
12 | // The lexertester parser |
---|
13 | //---------------------------------------------------------------------------- |
---|
14 | |
---|
15 | class LexerTester extends Parser; |
---|
16 | |
---|
17 | options { |
---|
18 | k = 1; // A lookahead depth of 1 |
---|
19 | buildAST = false; // no AST required |
---|
20 | } |
---|
21 | |
---|
22 | // This is a simple rule that can be used to test the Lexer. It will output |
---|
23 | // every token it sees using a complete description (including file, line |
---|
24 | // and column info). |
---|
25 | source_text |
---|
26 | : ( token:. |
---|
27 | { |
---|
28 | sys.stdout.write("lexertester: " + \ |
---|
29 | self.getFilename() + ':' + \ |
---|
30 | str(token) + '\n') |
---|
31 | } |
---|
32 | )* |
---|
33 | ; |
---|
Note: See
TracBrowser
for help on using the repository browser.