int main(int argc, char** argv) { if (argc < 3) { cout << "Usage: infilename outfilename" << endl; return 0; } ofstream out; out.open(argv[2]); Parser* p = new Parser(); try { p->parse(argv[1]); } catch (exception& e) { out << "Failure!" << endl; out << " "; print_tok(p->curr,out); // cout << e.what() << endl; delete p; return 0; } out << "Success!" << endl; out << p->prog->toString(); delete p; return 0; }
int yyprint_token(int symbol){ stringnode_ref sn; yylval_token(symbol); print_tok(symbol); sn = intern_stringtable(st, yytext); return symbol; }
void print_exec_band(struct band_list_el band[], int size){ int i; for (i=0; i<size; ++i){ printf("hpos -> %d\t",i); print_tok(band[i].id); printf("\t"); print_tok(band[i].band_id); printf("\thpos = %d lgm %d tok %s", band[i].head_pos, band[i].lgm, band[i].tok); if (band[i].band_id == FUNK || band[i].band_id == FCALL1 || \ band[i].band_id == SNMEM) printf("%s sntip %d fid %d dt_size %d\n ", band[i].tok, band[i].sntip, band[i].fid, band[i].dt_size); else{ if (band[i].band_id == GLBMT) printf(" dt_size %d", band[i].dt_size); printf("\n"); } } }
int yyprint_token(int symbol){ yylval_token(symbol); print_tok(symbol); return symbol; }