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

SCM Repository

[diderot] Diff of /trunk/src/ast/ast.sml
ViewVC logotype

Diff of /trunk/src/ast/ast.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 70, Sat May 22 14:23:32 2010 UTC revision 71, Sat May 22 22:16:04 2010 UTC
# Line 11  Line 11 
11    
12      structure Ty = Types      structure Ty = Types
13    
14      datatype program = Program of unit (* FIXME *)    (* AST variable kinds *)
15        datatype var_kind
16          = InputVar
17          | GlobalVar
18          | ActorParam
19          | LocalVar
20    
21        datatype var = V of {
22            name : string,          (* print name of variable *)
23            id : Stamp.stamp,       (* unique ID *)
24            kind : var_kind,        (* variable kind *)
25            ty : Ty.scheme          (* type scheme *)
26          }
27    
28        datatype program
29          = Program of decl list
30    
31        and decl
32          = D_Input of var * expr option
33          | D_Var of var_decl                       (* global variable decl *)
34          | D_Actor of {                            (* actor decl *)
35                name : Atom.atom,
36                params : var list,
37                state : var_decl list,
38                methods : method list
39              }
40          | D_InitialArray of create * iter list
41          | D_InitialCollection of create * iter list
42    
43        and var_decl
44          = VD_Decl of var * expr
45    
46        and method
47          = M_Method of var * stmt
48    
49        and create
50          = C_Create of (var * expr list)
51    
52        and iter
53          = I_Range of var * expr * expr
54    
55        and stmt
56          = S_Block of stmt list
57          | S_Decl of var_decl
58          | S_IfThenElse of expr * stmt * stmt
59          | S_Assign of var * expr
60          | S_New of var * expr list
61          | S_Die
62          | S_Stabilize
63    
64        and expr
65          = E_Var of var
66          | E_Lit of Literal.literal
67          | E_Tuple of expr list
68          | E_Apply of var * expr list
69          | E_Cons of Ty.ty * expr list
70    
71    end    end

Legend:
Removed from v.70  
changed lines
  Added in v.71

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