home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 172_01 / impure.c < prev    next >
Text File  |  1979-12-31  |  3KB  |  96 lines

  1. /*
  2.   HEADER:              CUG  nnn.nn;
  3.   TITLE:               LEX - A Lexical Analyser Generator
  4.   VERSION:             1.1 for IBM-PC
  5.   DATE:                Jan 30, 1985
  6.   DESCRIPTION:         A Lexical Analyser Generator. From UNIX
  7.   KEYWORDS:            Lexical Analyser Generator YACC C PREP
  8.   SYSTEM:              IBM-PC and Compatiables
  9.   FILENAME:            impure.c
  10.   WARNINGS:            This program is not for the casual user. It will
  11.                        be useful primarily to expert developers.
  12.   CRC:                 N/A
  13.   SEE-ALSO:            YACC and PREP
  14.   AUTHORS:             Charles H. Forsyth
  15.                        Scott Guthery 11100 leafwood lane Austin, TX 78750
  16.                        Andrew M. Ward, Jr.  Houston, Texas (Modifications)
  17.   COMPILERS:           LATTICE C
  18.   REFERENCES:          UNIX Systems Manuals -- Lex Manual on distribution disks
  19. */
  20. /*
  21.  * Copyright (c) 1978 Charles H. Forsyth
  22.  *
  23.  * Modified 02-Dec-80 Bob Denny -- Conditionalize debug code for reduced size
  24.  * Modified 29-May-81 Bob Denny -- Clean up overlay stuff for RSX.
  25.  * More     19-Mar-82 Bob Denny -- New C library & compiler
  26.  * More     03-May-82 Bob Denny -- Final touches, remove unreferenced autos
  27.  * More     29-Aug-82 Bob Denny -- Clean up -d printouts
  28.  * More     29-Aug-82 Bob Denny -- Reformat for readability and comment
  29.  *                                 while learning about LEX.
  30.  * More     20-Nov-83 Scott Guthery -- Adapt for IBM PC & DeSmet C
  31.  *
  32.  * Modified 22-Jun-86 Andrew Ward -- Modified code to compile under Lattice C
  33.  *                                 version 3.0h.  Corrected several errors
  34.  *                                 from the assumption that pointers and
  35.  *                                 integers are the same size.     
  36.  *                                 New debug code for LATTICE C using assert
  37.  *                                 to test for wild pointers.
  38.  */
  39. /*
  40.  * impure.c  -- Impure data for ytab.c and min.c
  41.  *
  42.  * Created 02-Dec-80 Bob Denny -- Impure data from ytab.c and min.c moved
  43.  *                                                                  here so they can reside in overlays.
  44.  * More    19-Mar-82 Bob Denny -- New C library & compiler
  45.  * More    20-Nov-83 Scott Guthery -- Adapt for IBM PC & DeSmet C
  46.  */
  47.  
  48. #include <stdio.h>
  49. #include "lexlex.h"
  50. #include "ytab.h"
  51.  
  52. /*
  53.  * min's
  54.  */
  55. struct set **oldpart;
  56. int **newpart;
  57. int nold;
  58. int nnew;
  59.  
  60. /*
  61.  * ytab's
  62.  */
  63.  
  64. extern struct nlist {
  65.     struct  nlist   *nl_next;
  66.     struct  nfa     *nl_base;
  67.     struct  nfa     *nl_end;
  68.     struct  nfa     *nl_start;
  69.     struct  nfa     *nl_final;
  70.          } *nlist;
  71.  
  72. extern struct des {
  73.       struct nfa *d_start;
  74.       struct nfa *d_final;
  75.       };
  76.  
  77. int nlook = 0;
  78. static int yyline = 0;
  79. char *breakc;
  80. char *ignore;
  81. char *illeg;
  82.  
  83. /* char buffer[150]; */
  84. int str_len;
  85.  
  86. extern char *ccl;
  87.  
  88. /*
  89.  * Copied from ytab.c just before yyparse() ... kludgy.
  90.  */
  91. #define YYMAXDEPTH 150
  92.  
  93. /*
  94.  * These are impure data for the parser driver yyparse().
  95.  */
  96.