Changeset 3807
- Timestamp:
- Jun 12, 2008, 7:58:42 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/trunk/LFC/lfcg.grammar
r3806 r3807 1 1 /* $Id$ 2 2 * 3 * This is LL(1) grammar for grammars used in LFC based on the "Introduction to LFC Programming4 * L anguage" (January 25, 2008) by Zhen Lixiao3 * 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 5 */ 6 6 7 7 %token LANG RANG 8 8 %token LBRACKET RBRACKET 9 %token TO VBAR 9 %token TO VBAR TILDA 10 10 %token BLANK 11 %token IDENTIFIER 11 %token IDENTIFIER STRING 12 12 13 13 %% 14 14 15 15 grammar : /*empty*/ 16 | production grammar 17 | BLANK grammar 18 ; 16 | production grammar_rest 17 ; 18 19 grammar_rest : /*empty*/ 20 | BLANK grammar 21 ; 19 22 20 23 production : ordinary_production 21 | non -token_production24 | non_token_production 22 25 ; 23 26 24 27 ordinary_production : LANG IDENTIFIER RANG TO terms ; 25 28 26 non -token_production : LBRACKET IDENTIFIER RBRACKET TO terms ;29 non_token_production : LBRACKET IDENTIFIER RBRACKET TO terms ; 27 30 28 31 terms : term terms_rest ; 29 32 30 33 terms_rest : /*empty*/ 31 | VBAR term terms_rest34 | VBAR terms 32 35 ; 33 36 … … 35 38 36 39 item_rest : /*empty*/ 37 | item item_rest40 | term 38 41 ; 39 42
Note: See TracChangeset
for help on using the changeset viewer.