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

Legend:
Removed from v.40  
changed lines
  Added in v.80

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