From: Bernhard Urban Date: Wed, 5 May 2010 15:06:12 +0000 (+0200) Subject: codea: cleanup; imm wird eh nicht benoetigt X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=uebersetzerbau-ss10.git;a=commitdiff_plain;h=1655012042275ce0a24e5429e3d2a14559849cda codea: cleanup; imm wird eh nicht benoetigt --- diff --git a/codea/parser.y b/codea/parser.y index 74fe1f4..c64007e 100644 --- a/codea/parser.y +++ b/codea/parser.y @@ -29,13 +29,12 @@ * gparamges: * parms: * node: - * imm: * exprcount: * sin: * sout: */ @autoinh s gparamges -@autosyn node imm +@autosyn node @attributes { char *name; } IDENT @attributes { long val; } NUM @@ -43,7 +42,7 @@ @attributes { struct symbol *f; } FeldID Structdef Program @attributes { struct symbol *s; } Methoddef @attributes { struct symbol *s; int gparamges; } Statseq Exprs -@attributes { struct symbol *s; int gparamges; struct treenode *node; short imm; int exprcount; } Expr Minusterm Term Multerm Orterm +@attributes { struct symbol *s; int gparamges; struct treenode *node; int exprcount; } Expr Minusterm Term Multerm Orterm @attributes { struct symbol *s; int gparamges; struct treenode *node; } Lexpr Feld @attributes { struct symbol *sin; int gparamges; struct symbol *sout; struct treenode *node; } Statement @@ -223,7 +222,6 @@ Expr: @{ @i @Expr.exprcount@ = @Term.exprcount@ + @Minusterm.exprcount@; fprintf(stderr, "(Expr)- Term Minusterm\n"); @i @Expr.node@ = new_node(O_SUB, @Term.node@, @Minusterm.node@, @Expr.exprcount@); - @i @Expr.imm@ = @Term.imm@ && @Minusterm.imm@; @reg { /* TODO */ @@ -237,7 +235,6 @@ Expr: @{ @i @Expr.exprcount@ = @Term.exprcount@ + @Multerm.exprcount@; fprintf(stderr, "(Expr)- Term Multerm\n"); @i @Expr.node@ = new_node(O_MUL, @Term.node@, @Multerm.node@, @Expr.exprcount@); - @i @Expr.imm@ = @Term.imm@ && @Multerm.imm@; @reg { /* TODO */ @@ -251,7 +248,6 @@ Expr: @{ @i @Expr.exprcount@ = @Term.exprcount@ + @Orterm.exprcount@; fprintf(stderr, "(Expr)- Term Orterm\n"); @i @Expr.node@ = new_node(O_OR, @Term.node@, @Orterm.node@, @Expr.exprcount@); - @i @Expr.imm@ = @Term.imm@ && @Orterm.imm@; @reg { /* TODO */ @@ -264,14 +260,12 @@ Expr: | Term '<' Term @{ @i @Expr.node@ = TREENULL; - /* das is bloedsinn atm */ @i @Expr.imm@ = @Term.0.imm@ && @Term.1.imm@; @i @Expr.exprcount@ = @Term.0.exprcount@ + @Term.1.exprcount@; fprintf(stderr, "(Expr)- Term < Term\n"); @} | Term '=' Term @{ @i @Expr.node@ = TREENULL; - /* das is bloedsinn atm */ @i @Expr.imm@ = @Term.0.imm@ && @Term.1.imm@; @i @Expr.exprcount@ = @Term.0.exprcount@ + @Term.1.exprcount@; fprintf(stderr, "(Expr)- Term = Term\n"); @} ; @@ -281,7 +275,6 @@ Minusterm: @{ @i @Minusterm.0.exprcount@ = @Term.exprcount@ + @Minusterm.1.exprcount@; fprintf(stderr, "(Minusterm)- - Term Minusterm\n"); @i @Minusterm.node@ = new_node(O_ADD, @Minusterm.1.node@, @Term.node@, @Minusterm.0.exprcount@); - @i @Minusterm.imm@ = @Term.imm@ && @Minusterm.1.imm@; @reg { @Minusterm.1.node@->reg = @Minusterm.node@->reg; @@ -301,7 +294,6 @@ Multerm: @{ @i @Multerm.0.exprcount@ = @Term.exprcount@ + @Multerm.1.exprcount@; fprintf(stderr, "(Multerm)- - Term Multerm\n"); @i @Multerm.node@ = new_node(O_MUL, @Multerm.1.node@, @Term.node@, @Multerm.0.exprcount@); - @i @Multerm.imm@ = @Term.imm@ && @Multerm.1.imm@; @reg { @Multerm.1.node@->reg = @Multerm.node@->reg; @@ -321,7 +313,6 @@ Orterm: @{ @i @Orterm.0.exprcount@ = @Term.exprcount@ + @Orterm.1.exprcount@; fprintf(stderr, "(Orterm)- - Term Orterm\n"); @i @Orterm.node@ = new_node(O_OR, @Orterm.1.node@, @Term.node@, @Orterm.0.exprcount@); - @i @Orterm.imm@ = @Term.imm@ && @Orterm.1.imm@; @reg { @Orterm.1.node@->reg = @Orterm.node@->reg; @@ -347,21 +338,18 @@ Term: @{ @i @Term.exprcount@ = 0; fprintf(stderr, "(Term)- NUM\n"); @i @Term.node@ = new_number(@NUM.val@, @Term.exprcount@); - @i @Term.imm@ = 1; @} | '-' NUM @{ @i @Term.exprcount@ = 0; fprintf(stderr, "(Term)- - NUM\n"); @i @Term.node@ = new_number(-1 * (@NUM.val@), @Term.exprcount@); - @i @Term.imm@ = 1; @} | THIS @{ @i @Term.exprcount@ = 0; fprintf(stderr, "(Term)- THIS\n"); @i @Term.node@ = new_param(O_ID, strdup("this"), TREENULL, TREENULL, 0, @Term.exprcount@); - @i @Term.imm@ = 0; @} | IDENT @@ -369,27 +357,23 @@ Term: @c check(@Term.s@, @IDENT.name@, S_VAR|S_PARM); @i @Term.exprcount@ = 0; fprintf(stderr, "(Term)- IDENT\n"); @i @Term.node@ = new_param(O_ID, @IDENT.name@, TREENULL, TREENULL, tab_lookup(@Term.s@, @IDENT.name@, S_PARM) == SYMNULL ? -1 : tab_lookup(@Term.s@, @IDENT.name@, S_PARM)->param_index, @Term.exprcount@); - @i @Term.imm@ = 0; @} | Feld @{ @i @Term.node@ = TREENULL; - @i @Term.imm@ = 0; /*TODO*/@i @Term.exprcount@ = 0; @} | IDENT '(' Exprs ')' @{ @i @Term.node@ = TREENULL; - @i @Term.imm@ = 0; /*TODO*/@i @Term.exprcount@ = 0; @} | Term '.' IDENT '(' Exprs ')' @{ @i @Term.node@ = TREENULL; - @i @Term.imm@ = 0; /*TODO*/@i @Term.exprcount@ = 0; @}