Working on statement checking
[cc1516.git] / grammar / grammar.txt
index ce6732b..6e9549d 100644 (file)
@@ -1,6 +1,8 @@
+<Prog>         ::= <VarDecl>* <FunDecl>+
+
 <FunDecl>      ::= <id> '(' <Type>* ')' ['::' <FunType] '{' <VarDecl>* <Stmt>+ '}'
-<FunType>      ::= <Type>+ '->' <VoidType>
-                 | <VoidType> 
+<FunType>      ::= <VoidType> ['->' <FunType>]  //in semantische analyse checken dat Void indien 
+                                                //aanwezig laatste type in de rij is
 <Stmt>         ::= 'if' '(' <Expr> ')' '{' <Stmt>* '}' ['else' '{' <Stmt>* '}']
                  | 'while' '(' <Expr> ')' '{' <Stmt>* '}'
                  | <id> <FieldSels> '=' <Expr> ';'