12.07.2015 Views

LEX & YACC

LEX & YACC

LEX & YACC

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}case '=':ex(p->opr.op[1]);printf("\tpop\t%c\n", p->opr.op[0]->id.i + 'a');break;case UMINUS:ex(p->opr.op[0]);printf("\tneg\n");break;default:ex(p->opr.op[0]);ex(p->opr.op[1]);switch(p->opr.oper) {case '+': printf("\tadd\n"); break;case '-': printf("\tsub\n"); break;case '*': printf("\tmul\n"); break;case '/': printf("\tdiv\n"); break;case '': printf("\tcompGT\n"); break;case GE: printf("\tcompGE\n"); break;case LE: printf("\tcompLE\n"); break;case NE: printf("\tcompNE\n"); break;case EQ: printf("\tcompEQ\n"); break;}}}return 0;28

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!