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

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

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