X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=uebersetzerbau-ss10.git;a=blobdiff_plain;f=gesamt%2Fparser.y;fp=gesamt%2Fparser.y;h=5dba8e00c69a4020a68525136b45bacfdcb1c562;hp=107ede5c4992278fe35310d71b93909aeb1200a8;hb=53fd1c254c4bad576328130c8d4456c86a320a9b;hpb=3cc9774c47638019932f476371f731bc61a7f1eb diff --git a/gesamt/parser.y b/gesamt/parser.y index 107ede5..5dba8e0 100644 --- a/gesamt/parser.y +++ b/gesamt/parser.y @@ -550,9 +550,10 @@ Term: | IDENT '(' Exprs ')' @{ @i { - @Term.node@ = new_call(@IDENT.name@, new_arg(@Exprs.node@, new_nothing(), 0) /*this*/, - TREENULL, @Term.gparamges@, @Term.vars_in@); + @Term.node@ = new_call(@IDENT.name@, @Exprs.node@, new_arg(new_nothing(), new_nothing(), 0) /*this*/, + @Term.gparamges@, @Term.vars_in@); @Term.node@->soffset = MAX(@Exprs.paramcount@, @Term.gparamges@); + @Term.node@->sc = @Term.node@->kids[1]->sc = @Exprs.node@->sc; } @i @Exprs.cnt@ = 1; @i @Term.imm@ = 0; @@ -563,14 +564,15 @@ Term: | Term '.' IDENT '(' Exprs ')' @{ @i { - @Term.node@ = new_call(@IDENT.name@, new_arg(@Exprs.node@, @Term.1.node@, 0) /*this*/, - TREENULL, @Term.gparamges@, @Term.vars_in@); + @Term.node@ = new_call(@IDENT.name@, @Exprs.node@, new_arg(@Term.1.node@, new_nothing(), 0) /*this*/, + @Term.gparamges@, @Term.vars_in@); @Term.node@->soffset = MAX(@Exprs.paramcount@, @Term.gparamges@); + @Term.node@->sc = @Term.node@->kids[1]->sc = @Exprs.node@->sc; } @i @Exprs.cnt@ = 1; @i @Term.imm@ = 0; @i @Term.call@ = 1; - @reg @Exprs.node@->reg = @Term.1.node@->reg = @Term.node@->kids[0]->reg = @Term.node@->reg; + @reg @Exprs.node@->reg = @Term.1.node@->reg = @Term.node@->kids[1]->reg = @Term.node@->reg; @} ; @@ -578,7 +580,10 @@ Term: Exprs: Expr ',' Exprs @{ - @i @Exprs.0.node@ = new_arg(@Expr.0.node@, @Exprs.1.node@, @Exprs.0.cnt@); + @i { + @Exprs.0.node@ = new_arg(@Exprs.1.node@, @Expr.0.node@, @Exprs.0.cnt@); + @Exprs.0.node@->sc = @Exprs.1.node@->sc; + } @i @Exprs.0.paramcount@ = @Exprs.1.paramcount@; @i @Exprs.1.cnt@ = @Exprs.0.cnt@ + 1; @reg { @@ -588,13 +593,19 @@ Exprs: @} | Expr @{ - @i @Exprs.0.node@ = new_arg(@Expr.0.node@, new_nothing(), @Exprs.cnt@); + @i { + @Exprs.0.node@ = new_arg(@Expr.0.node@, new_nothing(), @Exprs.cnt@); + @Exprs.0.node@->sc = malloc(8 * sizeof(short)); + } @i @Exprs.paramcount@ = @Exprs.cnt@ + 1; @reg @Expr.node@->reg = @Exprs.0.node@->reg; @} | @{ - @i @Exprs.0.node@ = new_nothing(); + @i { + @Exprs.0.node@ = new_nothing(); + @Exprs.0.node@->sc = malloc(8 * sizeof(short)); + } @i @Exprs.paramcount@ = @Exprs.cnt@; @} ;