Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /trunk/src/parser/parse-tree.sml
ViewVC logotype

Annotation of /trunk/src/parser/parse-tree.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 27 - (view) (download)

1 : jhr 25 (* parse-tree.sml
2 :     *
3 :     * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)
4 :     * All rights reserved.
5 :     *
6 :     * Diderot parse-tree representation.
7 :     *)
8 :    
9 :     structure ParseTree =
10 :     struct
11 :    
12 : jhr 27 type 'a mark = 'a Error.mark
13 :    
14 : jhr 25 type var = Atom.atom
15 :     type dim = IntInf.int
16 :    
17 :     datatype program
18 :     = Porgram of decl list
19 :    
20 :     and decl
21 :     = D_Mark of decl mark
22 : jhr 27 | D_Input of ty * var * expr option (* input variable decl with optional default *)
23 :     | D_Var of var_decl (* global variable decl *)
24 :     | D_Actor of { (* actor decl *)
25 :     name : var,
26 :     params : param list,
27 :     state : var_decl list,
28 :     methods : method list
29 :     }
30 : jhr 25
31 :     and ty
32 :     = T_Mark of ty mark
33 :     | T_Bool
34 :     | T_Int
35 :     | T_Real
36 :     | T_String
37 :     | T_Vec of dim
38 : jhr 26 | T_Kernel of dim
39 :     | T_Field of dim * dim list
40 :     | T_Tensor of dim list
41 :     | T_Image of dim list
42 : jhr 25
43 : jhr 27 and actor = Actor of var * param list *
44 :    
45 :     and var_decl
46 :     = VD_Mark of var_decl mark
47 :     | VD_Decl of ty * var * expr
48 :    
49 : jhr 25 and stmt
50 : jhr 27 = S_Mark of stmt mark
51 :     | S_Block of stmt list
52 :     | S_Decl of var_decl
53 :     | S_IfThen of expr * stmt
54 :     | S_IfThenElse of expr * stmt * stmt
55 :     | S_Assign of var * expr
56 :     | S_New of var * expr list
57 :     | S_Die
58 :     | S_Stabilize
59 : jhr 25
60 :     and expr
61 :     = E_Mark of expr mark
62 :     | E_Var of var
63 : jhr 27 | E_Lit of Literal.literal
64 : jhr 25 | E_BinOp of expr * var * expr
65 : jhr 27 | E_UnaryOp of var * expr
66 :     | E_Tuple of expr list
67 : jhr 25
68 :     end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0