home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pascal.zip / lexical / lex_ids.h next >
Text File  |  1995-10-29  |  3KB  |  87 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 ,   I D E N T I F I E R S
  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\lex_ids.h
  15.  *
  16.  *        This file contains all of the token and lexeme identifiers used with
  17.  *        the lexical analyzer portion of the interpreter BILL.
  18.  */
  19.  
  20.  
  21.  
  22. #ifndef _LEX_IDS_H_GLOBAL
  23.  
  24.     #define _LEX_IDS_H_GLOBAL
  25.  
  26.     /*
  27.      *        Includes
  28.      */
  29.  
  30.  
  31.  
  32.     /*
  33.      *        Defines (Tokens)
  34.      */
  35.         #define TOK_NO_ID                0    // no id recognized
  36.         #define TOK_ERROR_ID            1    // error occurred while getting token
  37.         #define TOK_END_OF_FILE_ID    2    // end of file was reached
  38.         #define TOK_PROGRAM_ID        3    // program
  39.         #define TOK_CONST_ID            4    // const
  40.         #define TOK_VAR_ID            5    // var
  41.         #define TOK_BEGIN_ID            6    // begin
  42.         #define TOK_END_ID            7    // end
  43.         #define TOK_IF_ID                8    // if
  44.         #define TOK_THEN_ID            9    // then
  45.         #define TOK_WHILE_ID            10    // while
  46.         #define TOK_DO_ID                11    // do
  47.         #define TOK_WRITE_ID            12    // write
  48.         #define TOK_READ_ID            13    // read
  49.         #define TOK_ODD_ID            14    // odd
  50.         #define TOK_ASSIGNMENT_ID    15    // assignment ":="
  51.         #define TOK_IDENTIFIER_ID    16    // "identifier" (variable)
  52.         #define TOK_STRING_ID        17    // "identifier" (string)
  53. //        #define TOK_OP_ID                18    // "operator" (see lexemes)
  54.         #define TOK_RELOP_ID            19    // "relational operator" (see lexemes)
  55.         #define TOK_PLUS_ID            20    // plus "+"
  56.         #define TOK_MINUS_ID            21    // minus "-"
  57.         #define TOK_MULT_ID            22    // multiply "*"
  58.         #define TOK_DIV_ID            23    // divide "/"
  59.         #define TOK_PO_ID                24    // parenteses open "("
  60.         #define TOK_PC_ID                25    // parenteses close ")"
  61.         #define TOK_SEMICOLON_ID    26    // semicolon ";"
  62.         #define TOK_COMMA_ID            27    // comma ","
  63.         #define TOK_PERIOD_ID        28    // period "."
  64.  
  65.  
  66.  
  67.     /*
  68.      *        Defines (Lexemes)
  69.      */
  70.         #define LEX_NO_ID                0    // no lexeme recognized
  71.         #define LEX_EQ_ID                1    // equal "="
  72.         #define LEX_NE_ID                2    // not equal "<>"
  73.         #define LEX_LE_ID                3    // less than or equal to "<="
  74.         #define LEX_LT_ID                4    // less than "<"
  75.         #define LEX_GE_ID                5    // greater than or equal to ">="
  76.         #define LEX_GT_ID                6    // greater than ">"
  77.         #define LEX_VALUE_ID            13    // "VarID" is a numeric or "Token[]" is a string
  78.                                                 // If a variable    ->    value is in Lex_State.VarID
  79.                                                 // If a string        ->    characters are in Lex_State.Token[]
  80.         #define LEX_VAR_ID            14    // "VarID" is a table entry
  81.                                                 //                        ->    Lex_State.VarID is the table entry
  82.  
  83.  
  84.  
  85. #endif
  86.  
  87.