17 %token
<name
> IDF TYPE
24 CLASS IDF
'{' functions
'}' ';' { printf
("ClassName: %s\n",$2); }
28 functions types IDF
'(' parameters
')' ';' { printf
("MethodName: %s\n", $3); }
34 |
/* empty */ { $$
= "NoType"; }
39 | parameter
',' parameters
40 |
/* empty */ { printf
("NoParameter\n"); }
44 types IDF
{ printf
("ParameterType: %s\nParameterName: %s\n", $1, $2); }
49 int main
(int argc
, char **argv
)
55 void yyerror(char *s
) {
56 fprintf
(stdout
, "%s\n", s
);