Source code of Windows XP (NT5)
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.

34 lines
730 B

  1. // Copyright (c) 1993-1999 Microsoft Corporation
  2. #include "y1.h"
  3. struct looksets *flset( p ) struct looksets *p;
  4. {
  5. /* decide if the lookahead set pointed to by p is known */
  6. /* return pointer to a perminent location for the set */
  7. register struct looksets *q;
  8. int j;
  9. SSIZE_T *u, *v, *w;
  10. for( q = &lkst[nlset]; q-- > lkst; )
  11. {
  12. u = p->lset;
  13. v = q->lset;
  14. w = & v[tbitset];
  15. while( v<w) if( *u++ != *v++ ) goto more;
  16. /* we have matched */
  17. return( q );
  18. more:
  19. ;
  20. }
  21. /* add a new one */
  22. q = &lkst[nlset++];
  23. if( nlset >= LSETSIZE )error("too many lookahead sets" );
  24. SETLOOP(j)
  25. {
  26. q->lset[j] = p->lset[j];
  27. }
  28. return( q );
  29. }