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 30 - (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 : jhr 30 and param
32 :     = P_Mark of param mark
33 :     | P_Param of ty * var
34 :    
35 : jhr 25 and ty
36 :     = T_Mark of ty mark
37 :     | T_Bool
38 :     | T_Int
39 :     | T_Real
40 :     | T_String
41 :     | T_Vec of dim
42 : jhr 26 | T_Kernel of dim
43 :     | T_Field of dim * dim list
44 :     | T_Tensor of dim list
45 :     | T_Image of dim list
46 : jhr 25
47 : jhr 27 and var_decl
48 :     = VD_Mark of var_decl mark
49 :     | VD_Decl of ty * var * expr
50 :    
51 : jhr 30 and method
52 :     = M_Mark of method mark
53 :     | M_Method of var * stmt
54 :    
55 : jhr 25 and stmt
56 : jhr 27 = S_Mark of stmt mark
57 :     | S_Block of stmt list
58 :     | S_Decl of var_decl
59 :     | S_IfThen of expr * stmt
60 :     | S_IfThenElse of expr * stmt * stmt
61 :     | S_Assign of var * expr
62 :     | S_New of var * expr list
63 :     | S_Die
64 :     | S_Stabilize
65 : jhr 25
66 :     and expr
67 :     = E_Mark of expr mark
68 :     | E_Var of var
69 : jhr 27 | E_Lit of Literal.literal
70 : jhr 25 | E_BinOp of expr * var * expr
71 : jhr 27 | E_UnaryOp of var * expr
72 :     | E_Tuple of expr list
73 : jhr 25
74 :     end

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