source: applications/trunk/LFC/lfc.ast

Last change on this file was 4080, checked in by orlov, 11 years ago
  • Names are represented as compound symbols, not (terms).
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.1 KB
Line 
1/* $Id: lfc.ast 4080 2009-07-16 09:04:46Z yura $ */
2
3e.program ::= t.func_def e.func_defs
4
5e.func_defs ::= /*empty*/ | t.func_def e.func_defs
6
7t.func_def ::= (FUNC t.name (e.func_type) (e.var_decls) t.sentence e.sentences)
8
9e.func_type ::= t.type e.types t.type
10
11e.types ::= /*empty*/ | t.type e.types
12
13e.var_decls ::= /*empty*/ | (t.var e.vars t.type) e.var_decls
14
15e.vars ::= /*empty*/ | t.var e.vars
16
17e.sentences ::= /*empty*/ | t.sentence e.sentences
18
19t.sentence ::= (SENTENCE t.name ((t.pat e.pattern) e.patterns) t.term e.exp)
20
21e.patterns ::= /*empty*/ | (t.pat e.pattern) e.patterns
22
23e.pattern ::= /*empty*/ | t.pat e.pattern
24
25t.pat ::= t.var | t.const
26
27e.exp ::= /*empty*/ | t.term e.exp
28
29t.term ::= (UNDEFINED)
30         | t.const
31         | t.var
32         | (CALL t.name (e.exp) e.args)
33         | (PAREN e.exp)
34         | (IF (e.exp) (e.exp) (e.exp))
35         | (LET (t.assign e.assigns) e.exp)
36
37e.args ::= /*empty*/ | (e.exp) e.args
38
39e.assigns ::= /*empty*/ | t.assign e.assigns
40
41t.assign ::= (t.var e.exp)
42
43t.const ::= [a character]
44
45t.type ::= (TYPE t.name)
46
47t.var ::= (VAR t.name)
48
49t.name ::= "compound_symbol"
Note: See TracBrowser for help on using the repository browser.