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

SCM Repository

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

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

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

revision 2038, Tue Oct 16 11:31:02 2012 UTC revision 2039, Wed Oct 17 16:10:37 2012 UTC
# Line 25  Line 25 
25    | KW_new              ("new")    | KW_new              ("new")
26    | KW_output           ("output")    | KW_output           ("output")
27    | KW_print            ("print")    | KW_print            ("print")
28    | KW_radius   ("radius")    | KW_sphere   ("sphere")
29    | KW_real             ("real")    | KW_real             ("real")
30    | KW_stabilize        ("stabilize")    | KW_stabilize        ("stabilize")
31    | KW_strand           ("strand")    | KW_strand           ("strand")
# Line 86  Line 86 
86  %keywords  %keywords
87    KW_bool, KW_D, KW_die, KW_else, KW_field,    KW_bool, KW_D, KW_die, KW_else, KW_field,
88    KW_foreach, KW_identity, KW_if, KW_image, KW_initially,    KW_foreach, KW_identity, KW_if, KW_image, KW_initially,
89    KW_int, KW_kernel, KW_new, KW_output, KW_print, KW_radius, KW_real, KW_stabilize, KW_strand,    KW_int, KW_kernel, KW_new, KW_output, KW_print, KW_sphere, KW_real, KW_stabilize, KW_strand,
90    KW_string, KW_tensor, KW_update, KW_vec2, KW_vec3, KW_vec4, KW_zeros;    KW_string, KW_tensor, KW_update, KW_vec2, KW_vec3, KW_vec4, KW_zeros;
91    
92  %defs (  %defs (
# Line 156  Line 156 
156  (***** variable declarations *****)  (***** variable declarations *****)
157    
158  VarIterationDecl  VarIterationDecl
159      : Type ID      : Type ID "in" Expr
160          => (mark PT.VD_Mark (FULL_SPAN, PT.VID_Decl(Type, ID)))          => (mark PT.VD_Mark (FULL_SPAN, PT.VD_Decl(Type, ID, Expr)))
161      ;      ;
162  VarDecl  VarDecl
163          : Type ID "=" Expr ";"          : Type ID "=" Expr ";"
# Line 210  Line 210 
210  Stmt  Stmt
211          : AtomicStmt          : AtomicStmt
212                  => (AtomicStmt)                  => (AtomicStmt)
213          | %try  KW_foreach "(" VarIterationDecl  "in"  Expr ")" Stmt          | %try  KW_foreach "(" VarIterationDecl ")" Stmt
214              => (markStmt(FULL_SPAN, PT.S_Foreach(VarIterationDecl,Expr,Stmt)))              => (markStmt(FULL_SPAN, PT.S_Foreach(VarIterationDecl,Stmt)))
215          | %try "if" "(" Expr ")" Stmt "else" Stmt          | %try "if" "(" Expr ")" Stmt "else" Stmt
216                  => (markStmt(FULL_SPAN, PT.S_IfThenElse(Expr, Stmt1, Stmt2)))                  => (markStmt(FULL_SPAN, PT.S_IfThenElse(Expr, Stmt1, Stmt2)))
217          | %try "if" "(" Expr ")" Stmt          | %try "if" "(" Expr ")" Stmt
# Line 457  Line 457 
457          | KW_zeros Dimensions          | KW_zeros Dimensions
458                  => (markExpr(FULL_SPAN, PT.E_Zero Dimensions))                  => (markExpr(FULL_SPAN, PT.E_Zero Dimensions))
459    
460      | "radius" "(" Expr ")"      | KW_sphere "(" Expr ")"
461          => (markExpr(FULL_SPAN, PT.E_RadiusQuery(Expr)))          => (markExpr(FULL_SPAN, PT.E_SphereQuery(Expr)))
462      | "real" "(" Expr ")"      | "real" "(" Expr ")"
463                  => (markExpr(FULL_SPAN, PT.E_Real Expr))                  => (markExpr(FULL_SPAN, PT.E_Real Expr))
464          | "(" Expr ("," Expr)* ")"          | "(" Expr ("," Expr)* ")"

Legend:
Removed from v.2038  
changed lines
  Added in v.2039

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