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

SCM Repository

[diderot] Diff of /branches/lamont/src/compiler/ast/ast.sml
ViewVC logotype

Diff of /branches/lamont/src/compiler/ast/ast.sml

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

revision 2297, Fri Mar 15 22:05:31 2013 UTC revision 2298, Fri Mar 15 22:18:22 2013 UTC
# Line 12  Line 12 
12      structure Ty = Types      structure Ty = Types
13    
14      type field = Atom.atom      type field = Atom.atom
15    
16    (* AST variable kinds *)    (* AST variable kinds *)
17      datatype var_kind      datatype var_kind
18        = BasisVar        = BasisVar
19        | InputVar        | InputVar
20        | GlobalVar        | GlobalVar
21          | FunVar                  (* user-defined function *)
22        | StrandParam             (* parameter to strand definition *)        | StrandParam             (* parameter to strand definition *)
23        | StrandStateVar  (* strand state variable *)        | StrandStateVar  (* strand state variable *)
24        | StrandOutputVar (* strand output variable *)        | StrandOutputVar (* strand output variable *)
25        | LocalVar                (* local variable in method *)        | LocalVar                (* local variable in method *)
26    
27      datatype var = V of {      datatype var = V of {
28          name : string,          (* print name of variable *)          name : Atom.atom,       (* print name of variable *)
29          id : Stamp.stamp,       (* unique ID *)          id : Stamp.stamp,       (* unique ID *)
30          kind : var_kind,        (* variable kind *)          kind : var_kind,        (* variable kind *)
31          ty : Ty.scheme          (* type scheme *)          ty : Ty.scheme          (* type scheme *)
# Line 35  Line 37 
37      and decl      and decl
38        = D_Input of var * string option * expr option        = D_Input of var * string option * expr option
39        | D_Var of var_decl                       (* global variable decl *)        | D_Var of var_decl                       (* global variable decl *)
40        | D_Strand of {                           (* strand decl *)        | D_Func of var * var list * stmt         (* user-defined function *)
41              name : Atom.atom,        | D_Strand of strand                      (* strand decl *)
             params : var list,  
             state : var_decl list,              (* true marks output variables *)  
             methods : method list  
           }  
42        | D_InitialArray of create * iter list        | D_InitialArray of create * iter list
43        | D_InitialCollection of create * iter list        | D_InitialCollection of create * iter list
44        | D_Global of stmt        | D_Global of stmt
# Line 48  Line 46 
46      and var_decl      and var_decl
47        = VD_Decl of var * expr        = VD_Decl of var * expr
48    
49    (* FIXME: these could probably be atoms *)
50      and strand_set      and strand_set
51         = SS_All         = SS_All
52         | SS_Active         | SS_Active
53         | SS_Stable         | SS_Stable
54    
55    (* FIXME: these should be variables *)
56      and reduction      and reduction
57         = R_Max         = R_Max
58         | R_Min         | R_Min
# Line 63  Line 63 
63         | R_Mean         | R_Mean
64         | R_Variance         | R_Variance
65    
66        and strand = Strand of {
67            name : Atom.atom,
68            params : var list,
69            state : var_decl list,
70            methods : method list
71          }
72    
73      and method      and method
74        = M_Method of StrandUtil.method_name * stmt        = M_Method of StrandUtil.method_name * stmt
# Line 83  Line 89 
89        | S_New of Atom.atom * expr list        | S_New of Atom.atom * expr list
90        | S_Die        | S_Die
91        | S_Stabilize        | S_Stabilize
92          | S_Return of expr
93        | S_Print of expr list        | S_Print of expr list
94    
95      and expr      and expr

Legend:
Removed from v.2297  
changed lines
  Added in v.2298

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