home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pascal.zip / lexical / lexical.h < prev    next >
Text File  |  1995-10-29  |  2KB  |  89 lines

  1. /*
  2.  *        C . A . P .   L E X I C A L   A N A L Y Z E R
  3.  *
  4.  *        G L O B A L   I N C L U D E   F I L E
  5.  *
  6.  *        Stéphane Charette @ C.A.P. Services
  7.  *
  8.  *        Last modified:  Stéphane Charette, 1995 October 29
  9.  *
  10.  *****************************************************************************
  11.  *
  12.  *        Project:    BILL
  13.  *        Group:    lexical analyzer
  14.  *        File:        lexical\lexical.h
  15.  *
  16.  *        This file contains all of the global definitions used with the lexical
  17.  *        portion of the interpreter BILL.
  18.  */
  19.  
  20.  
  21.  
  22. #ifndef _LEXICAL_H_GLOBAL
  23.  
  24.     #define _LEXICAL_H_GLOBAL
  25.  
  26.     /*
  27.      *        Includes
  28.      */
  29.         #include "..\global\global.h"
  30.         #include "..\lexical\lex_ids.h"
  31.  
  32.  
  33.  
  34.     /*
  35.      *        Defines
  36.      */
  37.         #define LEX_MAX_PATH_LEN    _MAX_LENGTH_OF_PATH
  38.         #define LEX_MAX_TOKEN_LEN    128
  39.  
  40.  
  41.  
  42.     /*
  43.      *        Types & structures
  44.      */
  45.         struct LEXICAL_STATE_STRUCT
  46.         {
  47.             BOOL        InComment;        // are we inside a comment?
  48.             BOOL        InString;        // are we inside a string?
  49.             ULONG        LineNumber;        // current line number
  50.             USHORT    CharOffset;        // character offset into current line
  51.             ERR        Error;            // last error encountered
  52.             USHORT    TokenID;            // id of current token
  53.             USHORT    LexemeID;        // id of lexeme (if applicable)
  54.             SHORT        VarID;            // value of identifier, or table entry
  55.             UCHAR        Token[ LEX_MAX_TOKEN_LEN + 1 ];        // current token
  56.         };
  57.         typedef struct LEXICAL_STATE_STRUCT LEXICAL_STATE;
  58.  
  59.  
  60.  
  61.     /*
  62.      *        Macros
  63.      */
  64.  
  65.  
  66.  
  67.     /*
  68.      *        Global (external) variables
  69.      */
  70.         extern LEXICAL_STATE Lex_State;
  71.  
  72.  
  73.  
  74.     /*
  75.      *        Global (external) prototyping
  76.      */
  77.         ERR InitLex( UCHAR path[] );    // initialize all variables for lex
  78.         ERR ResetLex( void );            // reset all variables used with lex
  79.         ERR GetNextToken( void );        // read buffer and return next token
  80.         #if( _LEX_DEBUG )
  81.         ERR InitLexDebug( BOOL screen, BOOL source, BOOL token, BOOL mix );    // initialize lexical debug module
  82.         ERR ResetLexDebug( void );        // reset the lexical debug module
  83.         #endif
  84.  
  85.  
  86.  
  87. #endif
  88.  
  89.