@attributes { struct symbol *f; } Idents Structdef
@attributes { struct symbol *p; } Parms
@attributes { struct symbol *s; } Methoddef Statseq Lexpr Expr Minusterm Multerm Orterm
-Term Exprs
+Term Exprs Feld
@attributes { struct symbol *sin; struct symbol *sout; } Statement
@traversal @postorder c
@c check_variable(@Lexpr.s@, @IDENT.name@);
@}
- | Term '.' IDENT
+ | Feld
+ ;
+
+Feld: Term '.' IDENT
@{
- @c check_variable(@Lexpr.s@, @IDENT.name@);
+ @c check_field(@Feld.s@, @IDENT.name@);
@}
;
@c check_variable(@Term.s@, @IDENT.name@);
@}
- | Term '.' IDENT
- @{
- @c check_variable(@Term.s@, @IDENT.name@);
- @}
-
+ | Feld
| IDENT '(' Exprs ')'
@{
@c check_variable(@Term.s@, @IDENT.name@);
int yyerror(char *error_text)
{
- fprintf(stderr,"Line %i: %s\n", yylineno, error_text);
+ fprintf(stderr,"Zeile %i: %s\n", yylineno, error_text);
exit(2);
}
int yyerror(char *error_text)
{
- fprintf(stderr,"Line %i: %s\n", yylineno, error_text);
+ fprintf(stderr,"Zeile %i: %s\n", yylineno, error_text);
exit(2);
}