Leaked source code of windows server 2003
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.

44 lines
1.0 KiB

  1. // Copyright (c) 1993-1999 Microsoft Corporation
  2. #include <stdlib.h>
  3. #include "y1.h"
  4. /*
  5. * 12-Apr-83 (RBD) Add symbolic exit status
  6. */
  7. extern SSIZE_T * pyield[NPROD];
  8. void
  9. cpres( void )
  10. {
  11. /* compute an array with the beginnings of productions yielding given nonterminals
  12. The array pres points to these lists */
  13. /* the array pyield has the lists: the total size is only NPROD+1 */
  14. SSIZE_T **pmem;
  15. register j, i;
  16. SSIZE_T c;
  17. pmem = pyield;
  18. NTLOOP(i)
  19. {
  20. c = i+NTBASE;
  21. pres[i] = pmem;
  22. fatfl = 0; /* make undefined symbols nonfatal */
  23. PLOOP(0,j)
  24. {
  25. if (*prdptr[j] == c) *pmem++ = prdptr[j]+1;
  26. }
  27. if(pres[i] == pmem)
  28. {
  29. error("nonterminal %s not defined!", nontrst[i].name);
  30. }
  31. }
  32. pres[i] = pmem;
  33. fatfl = 1;
  34. if( nerrors )
  35. {
  36. summary();
  37. exit(EX_ERR);
  38. }
  39. if( pmem != &pyield[nprod] ) error( "internal Yacc error: pyield %d", pmem-&pyield[nprod] );
  40. }