%{ #include "bisonUtils.h" #include extern int yylex(); extern void yyerror(char *s); %} %error-verbose %token '=' %token '.' %token '{' %token '}' %token '(' %token ')' %token ':' %token ';' %token ',' %token KEYWORD %token NUM %token COMPOP %token SYMBOL %token THIS %token '+' '-' %token '*' '/' %type NomCompose %type Arg ArgList FuncCall %union { char * stringVal; } %% Programme: | Programme Element {fprintf(stderr, "");} Element: KEYWORD {fprintf(stderr, "", $1); } | COMPOP {fprintf(stderr, "", $1); } | FuncCall {fprintf(stderr, "", $1);} | '+' {fprintf(stderr, "", $1);} | '-' {fprintf(stderr, "", $1);} | '/' {fprintf(stderr, "", $1);} | '*' {fprintf(stderr, "", $1);} | '=' {fprintf(stderr, "", $1);} | '{' {fprintf(stderr, "", $1);} | '}' {fprintf(stderr, "", $1);} | ':' {fprintf(stderr, "", $1);} | ';' {fprintf(stderr, "", $1);} | error FuncCall: NomCompose '(' ')' {$$ = c3($1, $2, $3); } | NomCompose '(' ArgList ')' {$$ = c4($1, $2, $3, $4); fprintf(stderr, " = %s", $3);} ArgList: Arg {fprintf(stderr, "", $1); $$ = copy($1); } | ArgList ',' Arg { fprintf(stderr, "", $3); $$ = c3($1, $2, $3); } Arg: NUM {$$ = copy($1); } | NomCompose {fprintf(stderr, "", $1); $$ = copy($1);} NomCompose: SYMBOL {fprintf(stderr, "", $1); $$ = copy($1); } | THIS {fprintf(stderr, "", $1); $$ = copy($1); } | NomCompose '.' SYMBOL {fprintf(stderr, "", $3); $$ = c3($1,$2,$3); } %%