ag: felder haben nicht ganz gepasst
authorBernhard Urban <lewurm@gmail.com>
Tue, 30 Mar 2010 16:20:44 +0000 (18:20 +0200)
committerBernhard Urban <lewurm@gmail.com>
Tue, 30 Mar 2010 16:20:44 +0000 (18:20 +0200)
ag/parser.y
parser/parser.y

index 3fe648bd80566301f325261c311d752afc42cf48..af8f0a68ff0a4ee9e145036a2b2641ce9ee295c4 100644 (file)
@@ -19,7 +19,7 @@
 @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
@@ -161,9 +161,12 @@ Lexpr:
                @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@);
          @}
 
        ;
@@ -204,11 +207,7 @@ Term:
                @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@);
@@ -236,7 +235,7 @@ extern int yylineno;
 
 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);
 }
 
index 181bc5a0a9ffb6fb38474568b055587075fa3ade..e5f1909afafd10c204a7b700f3a2589cd2d35d0f 100644 (file)
@@ -100,7 +100,7 @@ extern int yylineno;
 
 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);
 }