source: applications/trunk/LFC/lfc.grammar @ 3785

Last change on this file since 3785 was 3785, checked in by orlov, 13 years ago
  • Grammar for LFC language (unfinished).
File size: 944 bytes
Line 
1/* $Id$ */
2
3%token SC COMMA
4%token LPAR RPAR
5%token IDENTIFIER STRING UNDEFINED
6%token CONCAT
7%token IF THEN ELSE WHERE
8%token ASSIGN
9
10%%
11
12program : exp ;
13
14variable : IDENTIFIER ;
15/*
16funname  : IDENTIFIER ;
17*/
18
19exp : STRING exp_concat_or_where
20    | UNDEFINED exp_concat_or_where
21    | IDENTIFIER exp_var_or_func exp_concat_or_where
22    | LPAR exp RPAR exp_concat_or_where
23    | IF exp THEN exp ELSE exp exp_where
24    ;
25
26exp_var_or_func : /*empty*/
27                | LPAR exp_list RPAR
28                ;
29
30exp_list : /*empty*/
31         | exp exp_list_rest
32         ;
33
34exp_list_rest : /*empty*/
35              | COMMA exp exp_list_rest
36              ;
37
38exp_concat_or_where : exp_where
39                    | CONCAT exp
40                    ;
41
42
43exp_where : /*empty*/
44          | WHERE varassign_list
45          ;
46
47varassign_list : variable ASSIGN exp varassign_rest ;
48
49varassign_rest : /*empty*/
50               | COMMA varassign_list
51               ;
Note: See TracBrowser for help on using the repository browser.