int main(int argc, char **argv) { if (argc!=2) {fprintf(stderr,"usage: a.out filename\n"); exit(1);} S_table tenv = E_base_tenv(); S_table venv = E_base_venv(); transExp(venv, tenv, parse(argv[1])); return 0; }
void SEM_transProg(A_exp exp){ struct expty et; S_table t = E_base_tenv(); S_table v = E_base_venv(); et = transExp(Tr_outermost(), v, t, exp); printf("this exp return: %d\n", et.ty->kind); /* check the return result (use Ty_ty->kind stand) */ }
void SEM_transProg(A_exp exp) { S_table tenv = E_base_tenv(); S_table venv = E_base_venv(); Tr_level level = Tr_outermost(); struct expty et = transExp(level, venv, tenv, exp, NULL); Tr_printTree(et.exp); }
F_fragList SEM_transProg(A_exp exp){ struct expty et; S_table t = E_base_tenv(); S_table v = E_base_venv(); et = transExp(Tr_outermost(),NULL,v, t, exp); printf("@this expr return:\n"); /* check the return result (use Ty_ty->kind stand) */ F_fragList resl = Tr_getResult(); return resl; }
F_fragList SEM_transProg(A_exp exp){ struct expty et; S_table t = E_base_tenv(); S_table v = E_base_venv(); //puts("@before trans:"); et = transExp(Tr_outermost(), NULL, v, t, exp); //puts("@end trans, begin pr-main:"); //if(!anyErrors) print(et.exp); else printf("@error cant pr"); //puts("\n@end pr-main, begin ref:"); //printf("this exp return: %d\n", et.ty->kind); //puts("@end ref, begin pr-frag"); //puts("@@@@@@@@@@@@@@@@@@@@@@@"); F_fragList resl = Tr_getResult(); //print_frag(resl); //puts("\n@end pr-falg"); return resl; }
void SEM_transProg(A_exp exp) { transExp(E_base_venv(), E_base_tenv(), exp); }
void SEM_transProg(A_exp exp) { S_table tenv = E_base_tenv(); S_table venv = E_base_venv(); struct expty main = transExp(venv, tenv, exp); }