1 | # Is pgen LL(*) ?
|
2 |
|
3 | ID: NAME
|
4 |
|
5 | expr: NUMBER
|
6 |
|
7 |
|
8 | # From section 2 of LL(*) ANTLR paper (2011).
|
9 | paper: ID | ID '=' expr | 'unsigned'* 'int' ID | 'unsigned'* ID ID
|
10 |
|
11 | paper_input: paper NEWLINE* ENDMARKER
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | # From
|
17 | # https://theantlrguy.atlassian.net/wiki/spaces/ANTLR3/pages/2687279/What+is+the+difference+between+ANTLR+v2+and+v3
|
18 |
|
19 | type: 'unsigned' ['int']
|
20 | arg: 'arg'
|
21 | body: 'body'
|
22 |
|
23 | method: type ID '(' arg* ')' ';' | type ID '(' arg* ')' '{' body '}'
|
24 |
|
25 | method_input: method NEWLINE* ENDMARKER
|