ag: namen geaendert und debug meldung fix
[uebersetzerbau-ss10.git] / ag / parser.y
index c9b465aecb4355d8066031146a108f871d57ebcf..7df16d2f1ea6c67f299a0b07c0e5c1fa84366bbf 100644 (file)
@@ -25,7 +25,7 @@
  * s .. symbols  */
 @attributes { char *name; } IDENT
 @attributes { struct symbol *f; struct symbol *s; } Program
-@attributes { struct symbol *f; } Idents Structdef Parms
+@attributes { struct symbol *f; } FeldID Structdef Parms
 @attributes { struct symbol *s; } Methoddef Statseq Lexpr Expr Minusterm Multerm Orterm
 Term Exprs Feld
 @attributes { struct symbol *sin; struct symbol *sout; } Statement
@@ -65,9 +65,9 @@ Methoddef:
        ;
 
 Structdef:
-         STRUCT Idents END
+         STRUCT FeldID END
          @{
-           @i @Structdef.f@ = @Idents.f@;
+           @i @Structdef.f@ = @FeldID.f@;
          @}
        ;
 
@@ -84,15 +84,15 @@ Parms:
          @}
        ;
 
-Idents:
-         IDENT Idents
+FeldID:
+         IDENT FeldID
          @{
-           @i @Idents.0.f@ = tab_add_symbol(@Idents.1.f@, @IDENT.name@, S_FIELD, 1);
+           @i @FeldID.0.f@ = tab_add_symbol(@FeldID.1.f@, @IDENT.name@, S_FIELD, 1);
          @}
 
        |
          @{
-           @i @Idents.f@ = new_tab();
+           @i @FeldID.f@ = new_tab();
          @}
        ;
 
@@ -158,7 +158,7 @@ Statement:
 Lexpr:
          IDENT
          @{
-               @c check_variable(@Lexpr.s@, @IDENT.name@);
+               @c check(@Lexpr.s@, @IDENT.name@, S_VAR);
          @}
 
        | Feld
@@ -166,7 +166,7 @@ Lexpr:
 
 Feld: Term '.' IDENT
          @{
-               @c check_field(@Feld.s@, @IDENT.name@);
+               @c check(@Feld.s@, @IDENT.name@, S_FIELD);
          @}
        ;
 
@@ -202,7 +202,7 @@ Term:
        | THIS
        | IDENT
          @{
-               @c check_variable(@Term.s@, @IDENT.name@);
+               @c check(@Term.s@, @IDENT.name@, S_VAR);
          @}
 
        | Feld