source: trunk/yao/share/antlr-2.7.7/examples/python/lexerTester/lexertester.g @ 1

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
3header {
4import sys
5}
6
7options {
8  language = "Python";
9}
10
11//----------------------------------------------------------------------------
12// The lexertester parser
13//----------------------------------------------------------------------------
14
15class LexerTester extends Parser;
16
17options {
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).
25source_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.