Mercurial > hg > CbC > old > device
changeset 504:48e4f6e6178c
*** empty log message ***
author | kono |
---|---|
date | Fri, 23 Dec 2005 20:14:15 +0900 |
parents | 3c95c69aa80e |
children | 5d4112735c5c |
files | mc-inline.c mc-parse.c |
diffstat | 2 files changed, 59 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/mc-inline.c Fri Dec 23 19:44:26 2005 +0900 +++ b/mc-inline.c Fri Dec 23 20:14:15 2005 +0900 @@ -20,6 +20,7 @@ st_decl(int e1){ // NMTBL *n = (NMTBL *)caddr(e1); // int stmode = cadddr(e1); + g_expr_u(cadr(e1)); } extern void @@ -45,6 +46,7 @@ fwddef(l1); } // conv->if_endif_(); + g_expr_u(cadr(e1)); } @@ -68,6 +70,7 @@ fwddef(blabel); clabel=scontinue; blabel=sbreak; + g_expr_u(cadr(e1)); } @@ -97,6 +100,7 @@ fwddef(blabel); clabel=scontinue; blabel=sbreak; + g_expr_u(cadr(e1)); } @@ -141,6 +145,7 @@ fwddef(blabel); clabel=scontinue; blabel=sbreak; + g_expr_u(cadr(e1)); } @@ -179,12 +184,14 @@ fwddef(blabel); blabel=sbreak; cslist = slist; + g_expr_u(cadr(e1)); } extern void st_comp(int e1){ g_expr_u(caddr(e1)); + g_expr_u(cadr(e1)); } @@ -194,6 +201,7 @@ // conv->break_(); if (control) gen_jmp(blabel); + g_expr_u(cadr(e1)); } @@ -202,6 +210,7 @@ checkret(); // conv->continue_(); if (control) gen_jmp(clabel); + g_expr_u(cadr(e1)); } @@ -252,6 +261,7 @@ cmpdimm(car(c),csvalue1,cslabel=fwdlabel(),1); if (l) fwddef(l); #endif + g_expr_u(cadr(e1)); } @@ -262,6 +272,7 @@ if (dlabel) error(STERR); // double default: dlabel = backdef(); // conv->case_(0,1); + g_expr_u(cadr(e1)); } @@ -274,6 +285,7 @@ // conv->return_(); // conv->return_end_(); retpending = 1; + g_expr_u(cadr(e1)); return; } // conv->return_(); @@ -301,6 +313,7 @@ } // conv->return_end_(); retpending = 1; + g_expr_u(cadr(e1)); } @@ -314,6 +327,7 @@ e1 = caddr(e); if (car(e1)==RINDIRECT) { gen_indirect_goto(cadr(e1)); + g_expr_u(cadr(e1)); return; } else if (car(e1)==FLABEL) { nlist = (NMTBL *)cadr(e1); @@ -330,6 +344,7 @@ control=0; // conv->sm_(); // conv->goto_label_(nptr0); + g_expr_u(cadr(e1)); return; } else { /* CbC continuation */ @@ -348,6 +363,7 @@ gexpr(list3(CODE,e1,env),0); control=0; // conv->sm_(); + g_expr_u(cadr(e1)); return; } } @@ -358,6 +374,7 @@ st_asm(int e1){ checkret(); g_expr_u(list3(ASM,caddr(e1),cadddr(e1))); + g_expr_u(cadr(e1)); } #endif @@ -380,11 +397,13 @@ nptr->dsp = backdef(); } // conv->label_(); + g_expr_u(cadr(e1)); } extern void st_comment(int e1){ gen_comment((char *)caddr(e1)); + g_expr_u(cadr(e1)); } /*
--- a/mc-parse.c Fri Dec 23 19:44:26 2005 +0900 +++ b/mc-parse.c Fri Dec 23 20:14:15 2005 +0900 @@ -2184,31 +2184,37 @@ } else { checkret(); } - slist = cslist; - cslist = 0; - sbreak=blabel; /* save parents break label */ - if (!inmode) + if (!inmode) { + slist = cslist; + cslist = 0; + sbreak=blabel; /* save parents break label */ blabel=fwdlabel(); - sdefault=dlabel; /* save parents default label */ - dlabel=0; - scase=cslabel; /* save parents next case label */ - conv->switch_(); - getsym(0); - checksym(LPAR); - slfree=lfree; - svalue=csvalue1; /* save parents switch value */ - if (inmode) { + sdefault=dlabel; /* save parents default label */ + dlabel=0; + scase=cslabel; /* save parents next case label */ + conv->switch_(); + getsym(0); + checksym(LPAR); + slfree=lfree; + svalue=csvalue1; /* save parents switch value */ + gexpr(expr(0),1); + } else { + conv->switch_(); + getsym(0); + checksym(LPAR); v = expr(0); - } else { - gexpr(expr(0),1); } if (!scalar(type)) error(EXERR); - if (!inmode) + if (!inmode) { csvalue1=csvalue() ; - set_lfree(slfree); - checksym(RPAR); - conv->switch_body_(); - cslabel = control = 0; + set_lfree(slfree); + checksym(RPAR); + conv->switch_body_(); + cslabel = control = 0; + } else { + conv->switch_body_(); + checksym(RPAR); + } /* next syntax should be a case statement but... main() { int i=3,j=1,k=0; @@ -2237,13 +2243,14 @@ #endif free_glist2(csvalue1); } - csvalue1=svalue; - cslabel=scase; - dlabel=sdefault; - if (!inmode) + if (!inmode) { + csvalue1=svalue; + cslabel=scase; + dlabel=sdefault; fwddef(blabel); - blabel=sbreak; - cslist = slist; + blabel=sbreak; + cslist = slist; + } } #if CASE_CODE @@ -2310,14 +2317,15 @@ #else /* casading branch implementation */ int c,l,slfree; - l = 0; if (!inmode) { if (retpending) { ret(); retpending=0; } + } else { + l = 0; + slfree=lfree; + c=0; } - slfree=lfree; - c=0; while(sym==CASE) { conv->case_begin_(c,0); getsym(0); @@ -2329,8 +2337,9 @@ parse = list3(ST_CASE,parse,clist); control=1; return; + } else { + l=fwdlabel(); } - l=fwdlabel(); if (control) { control=0; gen_jmp(l); @@ -2355,10 +2364,10 @@ checkret(); getsym(0); checksym(COLON); - if (dlabel) error(STERR); // double default: if (inmode) { parse = list2(ST_DEFAULT,parse); } else { + if (dlabel) error(STERR); // double default: dlabel = backdef(); } conv->case_(0,1);