#ifndef NORCSID static char rcsid[] = "$Header$"; #endif #include #include #include "assert.h" #include "param.h" #include "tables.h" #include "types.h" #include #include "data.h" #include "result.h" #include "extern.h" /* * (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands. * * This product is part of the Amsterdam Compiler Kit. * * Permission to use, sell, duplicate or disclose this software must be * obtained in writing. Requests for such permissions may be sent to * * Dr. Andrew S. Tanenbaum * Wiskundig Seminarium * Vrije Universiteit * Postbox 7161 * 1007 MC Amsterdam * The Netherlands * * Author: Hans van Staveren */ #ifndef NDEBUG #include extern char em_mnem[][4]; #endif byte *trypat(bp,len) register byte *bp; { register patlen,i; result_t result; getint(patlen,bp); if (len == 3) { if (patlen < 3) return(0); } else { if (patlen != len) return(0); } for(i=0;iemlines) { nemlines -= emp-emlines; for (i=0,ep=emlines;i=0;i--) { index = pathash[hash[i]&BMASK]; while (index != 0) { bp = &pattern[index]; if ( bp[PO_HASH] == (hash[i]>>8)) if ((cp=trypat(&bp[PO_MATCH],i+1)) != 0) return(cp); index = (bp[PO_NEXT]&BMASK) | (bp[PO_NEXT+1]<<8); } } return(0); }