]> Joshua Wise's Git repositories - snipe.git/blobdiff - parse/ast.sml
Add string pasting support to the gramamr.
[snipe.git] / parse / ast.sml
index 75f704243da867828b4a8ab0e70baec7336d3356..9645f6ae9c17525dec83e013fd18f859b30fd45c 100644 (file)
@@ -38,7 +38,9 @@ sig
 
   datatype exp =
      Var of ident
+   | Cast of Type.vtype * exp
    | ConstExp of Word32.word
+   | StringExp of string
    | OpExp of oper * exp list
    | Marked of (* Kane *) exp Mark.marked
    | FuncCall of ident * (exp list)
@@ -108,7 +110,9 @@ struct
 
   datatype exp =
      Var of ident
+   | Cast of Type.vtype * exp
    | ConstExp of Word32.word
+   | StringExp of string
    | OpExp of oper * exp list
    | Marked of exp Mark.marked
    | FuncCall of ident * (exp list)
@@ -170,7 +174,9 @@ struct
       | pp_oper GE = ">="
 
     fun pp_exp (Var(id)) = pp_ident id
+      | pp_exp (Cast(ty, exp)) = "["^(Type.Print.pp_type ty)^"]"^(pp_exp exp)
       | pp_exp (ConstExp(c)) = Word32Signed.toString c
+      | pp_exp (StringExp(s)) = "\"" ^ s ^ "\""
       | pp_exp (OpExp(oper, [e])) =
          pp_oper oper ^ "(" ^ pp_exp e ^ ")"
       | pp_exp (OpExp(oper, [e1,e2])) =
This page took 0.02077 seconds and 4 git commands to generate.