Last change
on this file since 1 was
1,
checked in by lnalod, 15 years ago
|
Initial import of YAO sources
|
File size:
346 bytes
|
Line | |
---|
1 | /* This grammar demonstrates the use of two parsers sharing a token |
---|
2 | * vocabulary with a single lexer. |
---|
3 | */ |
---|
4 | |
---|
5 | header { |
---|
6 | # empty header |
---|
7 | } |
---|
8 | |
---|
9 | options { |
---|
10 | language="Python"; |
---|
11 | } |
---|
12 | |
---|
13 | class SimpleParser extends Parser; |
---|
14 | |
---|
15 | options { |
---|
16 | k=1; |
---|
17 | importVocab=Simple; |
---|
18 | } |
---|
19 | |
---|
20 | simple: ( x )+ |
---|
21 | ; |
---|
22 | |
---|
23 | x: |
---|
24 | (a) => a |
---|
25 | | b |
---|
26 | ; |
---|
27 | |
---|
28 | a : A B C; |
---|
29 | b : A B D; |
---|
Note: See
TracBrowser
for help on using the repository browser.