8 static int inc_flag = 1;
9 static int arg_size = 0;
11 extern int yylex(void);
13 static void yyerror(char *s);
15 #define INC_ARGS(n) arg_size += (inc_flag ? n : 0)
28 : function_declaration
29 | start function_declaration
33 : type_name '(' parameter_list ')' ';'
35 ADD_FUNCTION($1, arg_size);
38 | type_name '(' ')' ';'
43 | error { arg_size = 0; yyclearin; }
52 | type_name ID pointer
54 | type_name function_pointer
59 : '(' function_pointer_name ')' '(' ')'
61 | '(' function_pointer_name ')' '('
80 if (strcmp($1, "POINT") == 0)
82 else if (strcmp($1, "RECT") == 0)
84 else if (strcmp($1, "float") == 0)
85 INC_ARGS(sizeof(float));
86 else if (strcmp($1, "double") == 0)
87 INC_ARGS(sizeof(double));
88 else if (strcmp($1, "void") != 0)
94 : parameter_declaration
95 | parameter_list ',' parameter_declaration