home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume36 / unpost / part07 / lex.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-18  |  923 b   |  48 lines

  1. /******************************************************************************
  2. * Module    :   Lexical Analyzer --- Extract tokens from the source file.
  3. *
  4. * Author    :   John W. M. Stevens
  5. ******************************************************************************/
  6.  
  7. #if ! defined(LEXICAL_ANALYZER)
  8. #define     LEXICAL_ANALYZER
  9.  
  10. typedef enum    {
  11.     T_NOT_FND,
  12.     T_ALTERNATE,
  13.     T_BODY,
  14.     T_CASE,
  15.     T_HEADER,
  16.     T_ID,
  17.     T_IGNORE,
  18.     T_NUMBER,
  19.     T_PART,
  20.     T_SEGMENT,
  21.     T_SEGMENTS,
  22.     T_SENSITIVE,
  23.     T_STRING,
  24.     T_TOTAL,
  25.     T_L_BRACE,
  26.     T_R_BRACE,
  27.     T_DBL_QUOTE,
  28.     T_INT_NO
  29. } TKNS;
  30.  
  31. /*  Token structure for returning values.   */
  32. typedef struct  {
  33.     char        str[256];
  34.     int         no;
  35. } TOKEN;
  36.  
  37. /*  Function prototypes.    */
  38. extern
  39. void    ParseErr(char   *ErrStr);
  40. extern
  41. void    OpenCfg(char    *FileNm);
  42. extern
  43. void    CloseCfg(void);
  44. extern
  45. int     Lex(TOKEN   *sym);
  46.  
  47. #endif
  48.