diff --git a/Monicelli.ypp b/Monicelli.ypp index c2dfc8b..408078a 100644 --- a/Monicelli.ypp +++ b/Monicelli.ypp @@ -98,6 +98,7 @@ Id* idval; Number* numericval; Function* funval; + FunctionPrototype* protoval; FunArg *argval; PointerList *arglistval; } @@ -114,6 +115,7 @@ %type arg_decl %type args_decl args %type fun_decl main +%type fun_proto %type print_stmt %type input_stmt %type abort_stmt @@ -149,8 +151,13 @@ fun_decls: fun_decls ; fun_decl: - FUN_DECL fun_return ID args FUN_END statements { - $$ = new Function(new FunctionPrototype(new Id($3), $2, $4), $6); + fun_proto statements { + $$ = new Function($1, $2); + } +; +fun_proto: + FUN_DECL fun_return ID args FUN_END { + $$ = new FunctionPrototype(new Id($3), $2, $4); } ; fun_return: