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

SCM Repository

[diderot] Diff of /branches/lamont/src/compiler/parser/diderot.grm
ViewVC logotype

Diff of /branches/lamont/src/compiler/parser/diderot.grm

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

revision 2160, Tue Feb 19 13:27:00 2013 UTC revision 2203, Mon Feb 25 05:15:24 2013 UTC
# Line 8  Line 8 
8    
9  %tokens  %tokens
10    : KW_active   ("active")    : KW_active   ("active")
11    | KW_and      ("and")    | KW_all     ("all")
12    | KW_bool             ("bool")    | KW_bool             ("bool")
13    | KW_dead     ("dead")    | KW_dead     ("dead")
14    | KW_die              ("die")    | KW_die              ("die")
15    | KW_else             ("else")    | KW_else             ("else")
16      | KW_exists       ("exists")
17    | KW_false            ("false")    | KW_false            ("false")
18    | KW_field            ("field")    | KW_field            ("field")
19    | KW_foreach      ("foreach")    | KW_foreach      ("foreach")
20      | KW_global       ("global")
21    | KW_identity         ("identity")    (* identity matrix *)    | KW_identity         ("identity")    (* identity matrix *)
22    | KW_if               ("if")    | KW_if               ("if")
23    | KW_image            ("image")    | KW_image            ("image")
# Line 27  Line 29 
29    | KW_load             ("load")    | KW_load             ("load")
30    | KW_new              ("new")    | KW_new              ("new")
31    | KW_max      ("max")    | KW_max      ("max")
32      | KW_mean     ("mean")
33    | KW_min      ("min")    | KW_min      ("min")
   | KW_or       ("or")  
34    | KW_product  ("product")    | KW_product  ("product")
   | KW_sphere   ("sphere")  
35    | KW_output           ("output")    | KW_output           ("output")
36    | KW_print            ("print")    | KW_print            ("print")
37    | KW_real             ("real")    | KW_real             ("real")
# Line 42  Line 43 
43    | KW_tensor           ("tensor")    | KW_tensor           ("tensor")
44    | KW_true             ("true")    | KW_true             ("true")
45    | KW_update           ("update")    | KW_update           ("update")
46      | KW_variance     ("variance")
47    | KW_vec2             ("vec2")    | KW_vec2             ("vec2")
48    | KW_vec3             ("vec3")    | KW_vec3             ("vec3")
49    | KW_vec4             ("vec4")    | KW_vec4             ("vec4")
# Line 95  Line 97 
97    ;    ;
98    
99  %keywords  %keywords
100    KW_active, KW_and, KW_bool, KW_dead, KW_die,  KW_else, KW_field, KW_foreach, KW_identity, KW_if, KW_image, KW_initially,    KW_active, KW_all, KW_bool, KW_dead, KW_die,  KW_else, KW_field, KW_foreach, KW_identity, KW_if, KW_global, KW_image, KW_initially,
101     KW_int, KW_kernel, KW_load, KW_max, KW_min,KW_new,KW_or, KW_output, KW_real, KW_print,KW_product, KW_stable, KW_stabilize,KW_sum,     KW_int, KW_kernel, KW_load, KW_max, KW_min, KW_mean, KW_new,KW_exists, KW_output, KW_real, KW_print,KW_product, KW_stable, KW_stabilize,KW_sum,
102    KW_strand, KW_string, KW_tensor, KW_update, KW_vec2, KW_vec3, KW_vec4,KW_xor, KW_zeros;    KW_strand, KW_string, KW_tensor, KW_update, KW_variance, KW_vec2, KW_vec3, KW_vec4,KW_xor, KW_zeros;
103    
104  %defs (  %defs (
105    structure PT = ParseTree    structure PT = ParseTree
# Line 145  Line 147 
147  );  );
148    
149  File  File
150          : GlobalDecl+ StrandDecl CoordinationDecl          : GlobalDecl+ StrandDecl GlobalDef CoordinationDecl
151                  => (PT.Program{span=FULL_SPAN, tree=GlobalDecl @ [StrandDecl, CoordinationDecl]})                  => (PT.Program{span=FULL_SPAN, tree= GlobalDecl @ [StrandDecl, CoordinationDecl,GlobalDef]})
152          ;          ;
153    
154  GlobalDecl  GlobalDecl
# Line 174  Line 176 
176          ;          ;
177    
178    
   
179  (***** Strands *****)  (***** Strands *****)
180    
181  StrandDecl  StrandDecl
# Line 261  Line 262 
262  (***** Strand Sets *****)  (***** Strand Sets *****)
263    
264  StrandSetType  StrandSetType
265       : "active"       : "all"
266            => (mark PT.SS_Mark (FULL_SPAN, PT.SS_All))
267         | "active"
268          => (mark PT.SS_Mark (FULL_SPAN, PT.SS_Active))          => (mark PT.SS_Mark (FULL_SPAN, PT.SS_Active))
269       | "stable"       | "stable"
270          => (mark PT.SS_Mark (FULL_SPAN, PT.SS_Stable))          => (mark PT.SS_Mark (FULL_SPAN, PT.SS_Stable))
      | "dead"  
         => (mark PT.SS_Mark (FULL_SPAN, PT.SS_Dead))  
271  ;  ;
272  StrandSetVar  StrandSetVar
273       : Expr "|" ID "in" "{" Type "." StrandSetType ( "&&" Type "."  StrandSetType)* "}"       : Expr "|" ID "in"  Type "." StrandSetType ( "," Type "."  StrandSetType)*
274          => (mark PT.VD_Mark (FULL_SPAN, PT.VD_SDecl(ID,(Type,StrandSetType)::SR,Expr)))          => (mark PT.VD_Mark (FULL_SPAN, PT.VD_SDecl(ID,(Type,StrandSetType)::SR,Expr)))
275  ;  ;
276    
277    
278    
279    
280  (***** Coordination declaration *****)  (***** Coordination declaration *****)
281    
282  CoordinationDecl  CoordinationDecl
# Line 305  Line 309 
309                  => (PT.D_InitialCollection(Create, Iterations))                  => (PT.D_InitialCollection(Create, Iterations))
310          ;          ;
311    
312    
313    (****** Global Block *******)
314    GlobalDef
315            : "global" Block
316                    => (markDecl(FULL_SPAN, PT.D_Global(Block)))
317            ;
318    
319  (***** Types *****)  (***** Types *****)
320    
321  Type    : "image" "(" Dimension ")" Dimensions  Type    : "image" "(" Dimension ")" Dimensions
# Line 498  Line 509 
509      | KW_sum "{" Expr "|" StrandSetVar "}"      | KW_sum "{" Expr "|" StrandSetVar "}"
510          => (markExpr(FULL_SPAN, PT.E_Reduction(PT.R_Sum,StrandSetVar)))          => (markExpr(FULL_SPAN, PT.E_Reduction(PT.R_Sum,StrandSetVar)))
511    
512      | KW_or "{" StrandSetVar "}"      | KW_all "{" StrandSetVar "}"
513          => (markExpr(FULL_SPAN, PT.E_Reduction(PT.R_Or,StrandSetVar)))          => (markExpr(FULL_SPAN, PT.E_Reduction(PT.R_All,StrandSetVar)))
   
     | KW_and "{" StrandSetVar "}"  
         => (markExpr(FULL_SPAN, PT.E_Reduction(PT.R_And,StrandSetVar)))  
514    
515      | KW_xor "{"  StrandSetVar "}"      | KW_exists "{"  StrandSetVar "}"
516          => (markExpr(FULL_SPAN, PT.E_Reduction(PT.R_Xor,StrandSetVar)))          => (markExpr(FULL_SPAN, PT.E_Reduction(PT.R_Exists,StrandSetVar)))
517    
518      | KW_product "{" StrandSetVar "}"      | KW_product "{" StrandSetVar "}"
519          => (markExpr(FULL_SPAN, PT.E_Reduction(PT.R_Product,StrandSetVar)))          => (markExpr(FULL_SPAN, PT.E_Reduction(PT.R_Product,StrandSetVar)))
520    
521        | KW_mean "{" StrandSetVar "}"
522            => (markExpr(FULL_SPAN, PT.E_Reduction(PT.R_Mean,StrandSetVar)))
523    
524        | KW_variance "{" StrandSetVar "}"
525            => (markExpr(FULL_SPAN, PT.E_Reduction(PT.R_Variance,StrandSetVar)))
526    
527    
528  (* should the following be classified as SuffixExprs? *)  (* should the following be classified as SuffixExprs? *)
529          | "real" "(" Expr ")"          | "real" "(" Expr ")"
530                  => (markExpr(FULL_SPAN, PT.E_Real Expr))                  => (markExpr(FULL_SPAN, PT.E_Real Expr))

Legend:
Removed from v.2160  
changed lines
  Added in v.2203

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