Last change
on this file since 3809 was
3809,
checked in by orlov, 13 years ago
|
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Id Author Date Rev
|
File size:
821 bytes
|
Line | |
---|
1 | /* $Id: lfcg.grammar 3809 2008-06-12 04:02:25Z orlov $ |
---|
2 | * |
---|
3 | * This is LL(1) grammar for grammars used in LFC based on the "Introduction to |
---|
4 | * LFC Programming Language" (January 25, 2008) by Zhen Lixiao |
---|
5 | */ |
---|
6 | |
---|
7 | %token LANG RANG |
---|
8 | %token LBRACKET RBRACKET |
---|
9 | %token TO VBAR TILDA |
---|
10 | %token BLANK |
---|
11 | %token IDENTIFIER STRING |
---|
12 | |
---|
13 | %% |
---|
14 | |
---|
15 | grammar : /*empty*/ |
---|
16 | | production grammar_rest |
---|
17 | ; |
---|
18 | |
---|
19 | grammar_rest : /*empty*/ |
---|
20 | | BLANK grammar |
---|
21 | ; |
---|
22 | |
---|
23 | production : ordinary_production |
---|
24 | | non_token_production |
---|
25 | ; |
---|
26 | |
---|
27 | ordinary_production : LANG IDENTIFIER RANG TO terms ; |
---|
28 | |
---|
29 | non_token_production : LBRACKET IDENTIFIER RBRACKET TO terms ; |
---|
30 | |
---|
31 | terms : term terms_rest ; |
---|
32 | |
---|
33 | terms_rest : /*empty*/ |
---|
34 | | VBAR terms |
---|
35 | ; |
---|
36 | |
---|
37 | term : item item_rest ; |
---|
38 | |
---|
39 | item_rest : /*empty*/ |
---|
40 | | term |
---|
41 | ; |
---|
42 | |
---|
43 | item : TILDA |
---|
44 | | LANG IDENTIFIER RANG |
---|
45 | | STRING |
---|
46 | ; |
---|
Note: See
TracBrowser
for help on using the repository browser.