source: trunk/yao/share/antlr-2.7.7/examples/cpp/multiParser/lexer.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: 451 bytes
Line 
1/* This grammar demonstrates the use of two parsers sharing a token
2 * vocabulary with a single lexer.
3 */
4
5header {
6/* empty header */
7}
8
9options {
10        language=Cpp;
11}
12
13class SimpleLexer extends Lexer;
14
15options {
16        exportVocab=Simple;
17}
18
19WS_     :       (' '
20        |       '\t'    { tab(); }
21        |       '\n'    { newline(); }
22        |       '\r')
23                { $setType(ANTLR_USE_NAMESPACE(antlr)Token::SKIP); }
24        ;
25
26A : 'a' | 'A' ;
27B : 'b' | 'B' ;
28C : 'c' | 'C' ;
29D : 'd' | 'D' ;
30
Note: See TracBrowser for help on using the repository browser.