home *** CD-ROM | disk | FTP | other *** search
/ ftptest.leeds.ac.uk / 2015.02.ftptest.leeds.ac.uk.tar / ftptest.leeds.ac.uk / bionet / CAE-GROUP / SCL-WIN3x / FED_PLUS.EXE / LEXACT.H < prev    next >
C/C++ Source or Header  |  1994-07-25  |  3KB  |  123 lines

  1. #ifndef LEXACT_H
  2. #define LEXACT_H
  3.  
  4. /* $Id: lexact.h,v 1.3 1994/05/11 19:51:05 libes Exp $ */
  5.  
  6. /*
  7.  * This software was developed by U.S. Government employees as part of
  8.  * their official duties and is not subject to copyright.
  9.  *
  10.  * $Log: lexact.h,v $
  11.  * Revision 1.3  1994/05/11  19:51:05  libes
  12.  * numerous fixes
  13.  *
  14.  * Revision 1.2  1993/10/15  18:48:24  libes
  15.  * CADDETC certified
  16.  *
  17.  * Revision 1.5  1992/08/27  23:41:58  libes
  18.  * modified decl of SCANinitialize
  19.  *
  20.  * Revision 1.4  1992/08/18  17:12:41  libes
  21.  * rm'd extraneous error messages
  22.  *
  23.  * Revision 1.3  1992/06/08  18:06:24  libes
  24.  * prettied up interface to print_objects_when_running
  25.  */
  26.  
  27. /*************/
  28. /* constants */
  29. /*************/
  30.  
  31. /*****************/
  32. /* packages used */
  33. /*****************/
  34.  
  35. #include <ctype.h>
  36. #include "basic.h"
  37. #include "error.h"
  38.  
  39. /************/
  40. /* typedefs */
  41. /************/
  42.  
  43. #define SCAN_BUFFER_SIZE    1024
  44. #define SCAN_NESTING_DEPTH    6
  45.  
  46. typedef struct Scan_Buffer {
  47.     char    text[SCAN_BUFFER_SIZE + 1];
  48.     char*    savedPos;
  49.     FILE*    file;
  50.     char    *filename;
  51.     Boolean    readEof;
  52.     int    lineno;
  53. } Scan_Buffer;
  54.  
  55. /********************/
  56. /* global variables */
  57. /********************/
  58.  
  59. #ifdef LEXACT_C
  60. # define GLOBAL
  61. # define INITIALLY(value) = value
  62. #else
  63. # define GLOBAL extern
  64. # define INITIALLY(value)
  65. #endif /* LEXACT_C */
  66.  
  67. GLOBAL Scan_Buffer    SCAN_buffers[SCAN_NESTING_DEPTH];
  68. GLOBAL int        SCAN_current_buffer    INITIALLY(0);
  69. GLOBAL char*        SCANcurrent;
  70.  
  71. GLOBAL Error        ERROR_include_file        INITIALLY(ERROR_none);
  72. GLOBAL Error        ERROR_unmatched_close_comment    INITIALLY(ERROR_none);
  73. GLOBAL Error        ERROR_unmatched_open_comment    INITIALLY(ERROR_none);
  74. GLOBAL Error        ERROR_unterminated_string    INITIALLY(ERROR_none);
  75. GLOBAL Error        ERROR_encoded_string_bad_digit    INITIALLY(ERROR_none);
  76. GLOBAL Error        ERROR_encoded_string_bad_count    INITIALLY(ERROR_none);
  77. GLOBAL Error        ERROR_bad_identifier        INITIALLY(ERROR_none);
  78. GLOBAL Error        ERROR_unexpected_character    INITIALLY(ERROR_none);
  79. GLOBAL Error        ERROR_nonascii_char;
  80.  
  81.  
  82. #undef GLOBAL
  83. #undef INITIALLY
  84.  
  85. /******************************/
  86. /* macro function definitions */
  87. /******************************/
  88.  
  89. #define SCANbuffer    SCAN_buffers[SCAN_current_buffer]
  90. #define SCANtext_ready    (*SCANcurrent != '\0')
  91.  
  92. /***********************/
  93. /* function prototypes */
  94. /***********************/
  95.  
  96. extern int    exp_yylex PROTO((void));    /* the scanner */
  97.  
  98. extern void    SCANinitialize PROTO((void));
  99. extern int    SCANprocess_real_literal PROTO((void));
  100. extern int    SCANprocess_integer_literal PROTO((void));
  101. /*extern int    SCANprocess_keyword_or_identifier PROTO((void));*/
  102. extern int    SCANprocess_identifier_or_keyword PROTO((void));
  103. extern int    SCANprocess_string PROTO((void));
  104. extern int    SCANprocess_binary_literal PROTO((void));
  105. extern Boolean    SCANread PROTO((void));
  106. extern void    SCANdefine_macro PROTO((char *, char *));
  107. extern void    SCANinclude_file PROTO((char *));
  108. void        SCANlowerize PROTO((char *));
  109. void        SCANupperize PROTO((char *));
  110. extern char *    SCANstrdup PROTO((char *));
  111. int
  112. SCANprocess_encoded_string(void);
  113. /*******************************/
  114. /* inline function definitions */
  115. /*******************************/
  116.  
  117.  
  118. int
  119. SCANnextchar(char* buffer);
  120.  
  121.  
  122. #endif /* LEX_ACTIONS_H */
  123.