/* Edits: * 06-Dec-80 Original code broken out of y1.c. * 18-Dec-80 Add conditional code for Decus for tempfile deletion. */ #include "y1.h" others() { /* put out other arrays, copy the parsers */ register c, i, j; finput = fopen( PARSER, "r" ); if( finput == NULL ) error( "cannot find parser %s", PARSER ); warray( "yyr1", levprd, nprod ); aryfil( temp1, nprod, 0 ); PLOOP(1,i)temp1[i] = prdptr[i+1]-prdptr[i]-2; warray( "yyr2", temp1, nprod ); aryfil( temp1, nstate, -1000 ); TLOOP(i) { for( j=tstates[i]; j!=0; j=mstates[j] ) { temp1[j] = tokset[i].value; } } NTLOOP(i) { for( j=ntstates[i]; j!=0; j=mstates[j] ) { temp1[j] = -i; } } warray( "yychk", temp1, nstate ); warray( "yydef", defact, nstate ); /* copy parser text */ while( (c=getc(finput) ) != EOF ) { if( c == '$' ) { if( (c=getc(finput)) != 'A' ) putc( '$', ftable ); else { /* copy actions */ faction = fopen( ACTNAME, "r" ); if( faction == NULL ) error( "cannot reopen action tempfile" ); while( (c=getc(faction) ) != EOF ) putc( c, ftable ); #ifdef decus fmkdl(faction); /* Decus-specific */ #else fclose(faction); ZAPFILE(ACTNAME); #endif c = getc(finput); } } putc( c, ftable ); } fclose( ftable ); }