int decision_stat() { if(strcmp(token.c_str(),"if") == 0) { getToken("decision_stat"); if(strcmp(token.c_str(),"(") == 0) { getToken("decision_stat"); expr(); if(strcmp(token.c_str(),")") == 0) { getToken("decision_stat"); if(strcmp(token.c_str(),"{") == 0) { getToken("decision_stat"); statement_list(); if(strcmp(token.c_str(),"}") == 0) { getToken("decision_stat"); dprime(); return 1; } else { printf("Error at }\n"); exit(1); } } else { printf("Error at {\n"); exit(1); } } else { printf("Error at )\n"); exit(1); } } else { printf("Error at (\n"); exit(1); } } else return 0; }
int decstat() { if(T[nt++].t==13) { stmtflag[no]=1; if(T[nt++].t==20) { if(expn()) { if(T[nt++].t==21) { if(stmt()) { if(dprime()) return 1; else return 0; } else return 0; } else { strcpy(miss,")"); return 0; } } else return 0; } else { strcpy(miss,"("); return 0; } } else { nt--; return 0; } }