source: applications/trunk/LFC/lfcg.grammar @ 3806

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