home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / FORTH / FLEX.ARC / FASTSKEL.H < prev    next >
Text File  |  1988-10-09  |  3KB  |  118 lines

  1. /*  macro definitions for fast/full-table  C/FTL programs generated by flex */
  2.  
  3. #ifndef MSDOS
  4. # include "flexskelcom.h"
  5. #else
  6. # include "flexscom.h"
  7. #endif
  8.  
  9. #define YY_END_OF_BUFFER_CHAR 0
  10.  
  11. /* action number for "not an accepting state; back-track (not implemented)" */
  12. #define YY_BACK_TRACK 0
  13.  
  14. /* action number for end-of-buffer was seen */
  15. #define YY_END_OF_BUFFER -3
  16.  
  17. /* reinitializes everything except the current start condition.  The last
  18.  * input character is set to a newline so an initial beginning-of-line
  19.  * rule will match
  20.  */
  21. #define YY_FAST_INIT \
  22.     { \
  23.     yytext = yy_c_buf_p = &yy_ch_buf[1]; \
  24.     yyleng = 0; \
  25.     yy_hold_char = *yy_c_buf_p; \
  26.     }
  27.  
  28. /* done before the next pattern has been matched action
  29.  * change both of these if you change them at all!
  30.  */
  31. #define YY_DO_BEFORE_SCAN \
  32.     *yy_c_buf_p = yy_hold_char
  33. #define YY_DO_BEFORE_RESTART \
  34.     yy_hold_char = *yy_c_buf_p
  35.  
  36. /* done after the current pattern has been matched and before the
  37.  * corresponding action
  38.  */
  39. #define YY_DO_BEFORE_ACTION \
  40.     yytext = yy_b_buf_p; \
  41.     yyleng = YY_LENG; \
  42.     yy_hold_char = *yy_c_buf_p; \
  43.     *yy_c_buf_p = '\0'
  44.  
  45. /* returns the length of the matched text */
  46. #define YY_LENG (yy_c_buf_p - yy_b_buf_p)
  47.  
  48. #ifdef FLEX_FULL_TABLE
  49. #define YY_CS_TYPE int
  50. #else
  51. #define YY_CS_TYPE struct yy_trans_info *
  52. #endif
  53.  
  54. /* find starting state */
  55. #ifdef FLEX_FULL_TABLE
  56. #    define YY_FIND_START_STATE( x ) \
  57.         x = yy_start; \
  58.         if ( yy_b_buf_p[-1] == '\n' ) \
  59.         ++x
  60. #else
  61. #    define YY_FIND_START_STATE( x ) \
  62.         x = yy_state_ptr[yy_start]; \
  63.         if ( yy_b_buf_p[-1] == '\n' ) \
  64.         x = yy_state_ptr[yy_start + 1]
  65. #endif
  66.  
  67. # ifdef FLEX_USE_ECS
  68. #     define yy_eq(x) e[x]
  69. # else
  70. #     define yy_eq(x) x
  71. # endif
  72.  
  73. /* get next jam state from packed table */
  74. #ifdef FLEX_FULL_TABLE
  75. #    define YY_FIND_NEXT_MATCH \
  76.         { \
  77.         register int yy_state_info; \
  78.         while ( (yy_state_info = n[yy_current_state][yy_eq(*yy_c_buf_p)] ) != YY_JAM ) \
  79.         { \
  80.         yy_current_state = yy_state_info; \
  81.         YY_BACKTRACKING_ACTION \
  82.         yy_c_buf_p++; \
  83.         } \
  84.         }
  85. #else
  86. #    define YY_FIND_NEXT_MATCH \
  87.         for ( yy_c = yy_eq(*yy_c_buf_p); \
  88.           (yy_trans_info = &yy_current_state[yy_c])->v == yy_c; \
  89.           yy_c = yy_eq(*++yy_c_buf_p) ) \
  90.         { \
  91.         yy_current_state += yy_trans_info->n; \
  92.         YY_BACKTRACKING_ACTION \
  93.         }
  94. #endif
  95.  
  96. #ifdef FLEX_FULL_TABLE
  97. #    define YY_FIND_ACTION( x ) x = l[yy_current_state]
  98. #else
  99. #    define YY_FIND_ACTION( x ) x = yy_current_state[-1].n
  100. #endif
  101.  
  102.  
  103. #ifdef FLEX_FULL_TABLE
  104. #    define YY_GET_NEXT_STATE yy_cur_state = n[yy_cur_state][*(yy_temp_char_ptr++)]
  105. #else
  106. #    define YY_GET_NEXT_STATE yy_cur_state += yy_cur_state[*(yy_temp_char_ptr++)].n
  107. #endif
  108.  
  109. #define EOB_ACT_RESTART_SCAN 2
  110. #define EOB_ACT_END_OF_FILE 3
  111. #define EOB_ACT_LAST_MATCH 4
  112.  
  113. #ifdef FLEX_FULL_TABLE
  114. #define YY_DECLARE_YY_CS_PARAM int *yy_current_state
  115. #else
  116. #define YY_DECLARE_YY_CS_PARAM struct yy_trans_info *yy_current_state
  117. #endif
  118.