Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

40 lines
938 B

#include <stdlib.h>
#include "y1.h"
/*
* 12-Apr-83 (RBD) Add symbolic exit status
*/
extern int * pyield[NPROD];
void cpres(void)
{
/* compute an array with the beginnings of productions yielding given nonterminals
The array pres points to these lists */
/* the array pyield has the lists: the total size is only NPROD+1 */
register **pmem;
register c, j, i;
pmem = pyield;
NTLOOP(i)
{
c = i+NTBASE;
pres[i] = pmem;
fatfl = 0; /* make undefined symbols nonfatal */
PLOOP(0,j)
{
if (*prdptr[j] == c) *pmem++ = prdptr[j]+1;
}
if(pres[i] == pmem)
{
error("nonterminal %s not defined!", nontrst[i].name);
}
}
pres[i] = pmem;
fatfl = 1;
if( nerrors )
{
summary();
exit(EX_ERR);
}
if( pmem != &pyield[nprod] ) error( "internal Yacc error: pyield %d", pmem-&pyield[nprod] );
}