source: applications/trunk/LFC/lfcg.grammar

Last change on this file was 3809, checked in by orlov, 12 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 yura $
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
15grammar : /*empty*/
16        | production grammar_rest
17        ;
18
19grammar_rest : /*empty*/
20             | BLANK grammar
21             ;
22
23production : ordinary_production
24           | non_token_production
25           ;
26
27ordinary_production : LANG IDENTIFIER RANG TO terms ;
28
29non_token_production : LBRACKET IDENTIFIER RBRACKET TO terms ;
30
31terms : term terms_rest ;
32
33terms_rest : /*empty*/
34           | VBAR terms
35           ;
36
37term : item item_rest ;
38
39item_rest : /*empty*/
40          | term
41          ;
42
43item : TILDA
44     | LANG IDENTIFIER RANG
45     | STRING
46     ;
Note: See TracBrowser for help on using the repository browser.