Lines Matching refs:fp

2957   FILE *fp;  in Parse()  local
2972 fp = fopen(ps.filename,"rb"); in Parse()
2973 if( fp==0 ){ in Parse()
2978 fseek(fp,0,2); in Parse()
2979 filesize = ftell(fp); in Parse()
2980 rewind(fp); in Parse()
2986 fclose(fp); in Parse()
2989 if( fread(filebuf,1,filesize,fp)!=filesize ){ in Parse()
2994 fclose(fp); in Parse()
2997 fclose(fp); in Parse()
3219 FILE *fp; in file_open() local
3223 fp = fopen(lemp->outname,mode); in file_open()
3224 if( fp==0 && *mode=='w' ){ in file_open()
3229 return fp; in file_open()
3290 void RulePrint(FILE *fp, struct rule *rp, int iCursor){ in RulePrint() argument
3293 fprintf(fp,"%s ::=",rp->lhs->name); in RulePrint()
3295 if( i==iCursor ) fprintf(fp," *"); in RulePrint()
3299 fprintf(fp," %s", sp->subsym[0]->name); in RulePrint()
3301 fprintf(fp,"|%s",sp->subsym[j]->name); in RulePrint()
3304 fprintf(fp," %s", sp->name); in RulePrint()
3311 void ConfigPrint(FILE *fp, struct config *cfp){ in ConfigPrint() argument
3312 RulePrint(fp, cfp->rp, cfp->dot); in ConfigPrint()
3356 FILE *fp, /* Print the action here */ in PrintAction() argument
3363 fprintf(fp,"%*s shift %-7d",indent,ap->sp->name,stp->statenum); in PrintAction()
3368 fprintf(fp,"%*s reduce %-7d",indent,ap->sp->name,rp->iRule); in PrintAction()
3369 RulePrint(fp, rp, -1); in PrintAction()
3374 fprintf(fp,"%*s shift-reduce %-7d",indent,ap->sp->name,rp->iRule); in PrintAction()
3375 RulePrint(fp, rp, -1); in PrintAction()
3379 fprintf(fp,"%*s accept",indent,ap->sp->name); in PrintAction()
3382 fprintf(fp,"%*s error",indent,ap->sp->name); in PrintAction()
3386 fprintf(fp,"%*s reduce %-7d ** Parsing conflict **", in PrintAction()
3390 fprintf(fp,"%*s shift %-7d ** Parsing conflict **", in PrintAction()
3395 fprintf(fp,"%*s shift %-7d -- dropped by precedence", in PrintAction()
3403 fprintf(fp,"%*s reduce %-7d -- dropped by precedence", in PrintAction()
3414 fprintf(fp," /* because %s==%s */", ap->sp->name, ap->spOpt->name); in PrintAction()
3427 FILE *fp; in ReportOutput() local
3429 fp = file_open(lemp,".out","wb"); in ReportOutput()
3430 if( fp==0 ) return; in ReportOutput()
3433 fprintf(fp,"State %d:\n",stp->statenum); in ReportOutput()
3440 fprintf(fp," %5s ",buf); in ReportOutput()
3442 fprintf(fp," "); in ReportOutput()
3444 ConfigPrint(fp,cfp); in ReportOutput()
3445 fprintf(fp,"\n"); in ReportOutput()
3447 SetPrint(fp,cfp->fws,lemp); in ReportOutput()
3448 PlinkPrint(fp,cfp->fplp,"To "); in ReportOutput()
3449 PlinkPrint(fp,cfp->bplp,"From"); in ReportOutput()
3454 fprintf(fp,"\n"); in ReportOutput()
3456 if( PrintAction(ap,fp,30) ) fprintf(fp,"\n"); in ReportOutput()
3458 fprintf(fp,"\n"); in ReportOutput()
3460 fprintf(fp, "----------------------------------------------------\n"); in ReportOutput()
3461 fprintf(fp, "Symbols:\n"); in ReportOutput()
3462 fprintf(fp, "The first-set of non-terminals is shown after the name.\n\n"); in ReportOutput()
3468 fprintf(fp, " %3d: %s", i, sp->name); in ReportOutput()
3470 fprintf(fp, ":"); in ReportOutput()
3472 fprintf(fp, " <lambda>"); in ReportOutput()
3476 fprintf(fp, " %s", lemp->symbols[j]->name); in ReportOutput()
3480 if( sp->prec>=0 ) fprintf(fp," (precedence=%d)", sp->prec); in ReportOutput()
3481 fprintf(fp, "\n"); in ReportOutput()
3483 fprintf(fp, "----------------------------------------------------\n"); in ReportOutput()
3484 fprintf(fp, "Syntax-only Symbols:\n"); in ReportOutput()
3485 fprintf(fp, "The following symbols never carry semantic content.\n\n"); in ReportOutput()
3492 fprintf(fp,"\n"); in ReportOutput()
3496 fprintf(fp, " "); in ReportOutput()
3499 fprintf(fp, "%s", sp->name); in ReportOutput()
3502 if( n>0 ) fprintf(fp, "\n"); in ReportOutput()
3503 fprintf(fp, "----------------------------------------------------\n"); in ReportOutput()
3504 fprintf(fp, "Rules:\n"); in ReportOutput()
3506 fprintf(fp, "%4d: ", rp->iRule); in ReportOutput()
3507 rule_print(fp, rp); in ReportOutput()
3508 fprintf(fp,"."); in ReportOutput()
3510 fprintf(fp," [%s precedence=%d]", in ReportOutput()
3513 fprintf(fp,"\n"); in ReportOutput()
3515 fclose(fp); in ReportOutput()