about summary refs log tree commit diff
path: root/src/Syntax.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Syntax.hs')
-rw-r--r--src/Syntax.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Syntax.hs b/src/Syntax.hs
index f5d9c2d..18949d2 100644
--- a/src/Syntax.hs
+++ b/src/Syntax.hs
@@ -19,6 +19,7 @@ data Expr = Var Idnt
           | Deref Expr
           | Match Expr [(Idnt, Idnt, Expr)] -- Variant,Binder, Expression
           | Proj Idnt Expr 
+          | Annot Expr Typ
            deriving(Eq,Show)
 data Com = Skip
          | Seq Com Com
@@ -29,10 +30,14 @@ data Com = Skip
          | Alloc Idnt Expr Com
          | Save Idnt Expr
          | SMatch Expr [(Idnt, Idnt, Com)]
+         | FunctionCall Idnt Idnt [Expr] -- variable function_name parameters
            deriving(Eq,Show)
          
-data FuncDecl = Func Idnt [Idnt] [(Idnt,Expr)] Com Expr
+data FuncDecl = Func Idnt [(Idnt, Typ)] [(Idnt,Expr)] Com Expr -- function_name [parameters]  [local variables] body return_val
            deriving(Eq,Show)
+data FuncSign = FuncSign [Typ] Typ
+                deriving(Eq,Show)
+type FuncEnv = [(Idnt,FuncSign)]
 data Program = P [FuncDecl] [(Idnt, Int)] Com
            deriving(Eq,Show)