From 6278c4628881cfda291dc7060f8cae4dcfb24277 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Mon, 3 May 2010 13:23:18 +0200 Subject: [PATCH] codea: this passt jetzt auch --- codea/code.bfe | 2 +- codea/parser.y | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/codea/code.bfe b/codea/code.bfe index c2a0d6d..be61221 100644 --- a/codea/code.bfe +++ b/codea/code.bfe @@ -17,7 +17,7 @@ begin: ret # 0 # printf("// end\n"); ret: O_RET(expr) # 1 # move(bnode->reg, "rax"); ret(); -expr: O_ID # 1 # if(bnode->param_index!=0) move(param_reg(bnode->param_index), bnode->reg); +expr: O_ID # 1 # if(bnode->param_index > -1) move(param_reg(bnode->param_index), bnode->reg); %% diff --git a/codea/parser.y b/codea/parser.y index f981df9..c6158c2 100644 --- a/codea/parser.y +++ b/codea/parser.y @@ -92,7 +92,7 @@ Parms: FeldID: IDENT FeldID @{ - @i @FeldID.0.f@ = tab_add_symbol(@FeldID.1.f@, @IDENT.name@, S_FIELD, 1, 0); + @i @FeldID.0.f@ = tab_add_symbol(@FeldID.1.f@, @IDENT.name@, S_FIELD, 1, -1); @} | @@ -125,7 +125,7 @@ Statement: @{ /* tab_clone ist hier noetig, vgl. folgendes statement * > var x := x - 1; */ - @i @Statement.sout@ = tab_add_symbol(tab_clone(@Statement.sin@), @IDENT.name@, S_VAR, 1, 0); + @i @Statement.sout@ = tab_add_symbol(tab_clone(@Statement.sin@), @IDENT.name@, S_VAR, 1, -1); xxputsin(@Expr.s@,) @i @Statement.node@ = TREENULL; @} @@ -289,7 +289,7 @@ Term: | THIS @{ - @i @Term.node@ = TREENULL; + @i @Term.node@ = new_node(O_ID, TREENULL, TREENULL); @Term.node@->param_index = 0; @reg fprintf(stderr, "wtf4\n"); @} -- 2.25.1