PageRenderTime 56ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/usr.bin/csup/lex.rcs.c

https://bitbucket.org/freebsd/freebsd-head/
C | 2094 lines | 1296 code | 374 blank | 424 comment | 129 complexity | 101a2ac78e95b1aae618426a1017c3d1 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, BSD-3-Clause, LGPL-2.0, LGPL-2.1, BSD-2-Clause, 0BSD, JSON, AGPL-1.0, GPL-2.0
  1. #line 3 "lex.rcs.c"
  2. #define YY_INT_ALIGNED short int
  3. /* A lexical scanner generated by flex */
  4. #define FLEX_SCANNER
  5. #define YY_FLEX_MAJOR_VERSION 2
  6. #define YY_FLEX_MINOR_VERSION 5
  7. #define YY_FLEX_SUBMINOR_VERSION 35
  8. #if YY_FLEX_SUBMINOR_VERSION > 0
  9. #define FLEX_BETA
  10. #endif
  11. /* First, we deal with platform-specific or compiler-specific issues. */
  12. /* begin standard C headers. */
  13. #include <stdio.h>
  14. #include <string.h>
  15. #include <errno.h>
  16. #include <stdlib.h>
  17. /* end standard C headers. */
  18. /* flex integer type definitions */
  19. #ifndef FLEXINT_H
  20. #define FLEXINT_H
  21. /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
  22. #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  23. /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
  24. * if you want the limit (max/min) macros for int types.
  25. */
  26. #ifndef __STDC_LIMIT_MACROS
  27. #define __STDC_LIMIT_MACROS 1
  28. #endif
  29. #include <inttypes.h>
  30. typedef int8_t flex_int8_t;
  31. typedef uint8_t flex_uint8_t;
  32. typedef int16_t flex_int16_t;
  33. typedef uint16_t flex_uint16_t;
  34. typedef int32_t flex_int32_t;
  35. typedef uint32_t flex_uint32_t;
  36. #else
  37. typedef signed char flex_int8_t;
  38. typedef short int flex_int16_t;
  39. typedef int flex_int32_t;
  40. typedef unsigned char flex_uint8_t;
  41. typedef unsigned short int flex_uint16_t;
  42. typedef unsigned int flex_uint32_t;
  43. #endif /* ! C99 */
  44. /* Limits of integral types. */
  45. #ifndef INT8_MIN
  46. #define INT8_MIN (-128)
  47. #endif
  48. #ifndef INT16_MIN
  49. #define INT16_MIN (-32767-1)
  50. #endif
  51. #ifndef INT32_MIN
  52. #define INT32_MIN (-2147483647-1)
  53. #endif
  54. #ifndef INT8_MAX
  55. #define INT8_MAX (127)
  56. #endif
  57. #ifndef INT16_MAX
  58. #define INT16_MAX (32767)
  59. #endif
  60. #ifndef INT32_MAX
  61. #define INT32_MAX (2147483647)
  62. #endif
  63. #ifndef UINT8_MAX
  64. #define UINT8_MAX (255U)
  65. #endif
  66. #ifndef UINT16_MAX
  67. #define UINT16_MAX (65535U)
  68. #endif
  69. #ifndef UINT32_MAX
  70. #define UINT32_MAX (4294967295U)
  71. #endif
  72. #endif /* ! FLEXINT_H */
  73. #ifdef __cplusplus
  74. /* The "const" storage-class-modifier is valid. */
  75. #define YY_USE_CONST
  76. #else /* ! __cplusplus */
  77. /* C99 requires __STDC__ to be defined as 1. */
  78. #if defined (__STDC__)
  79. #define YY_USE_CONST
  80. #endif /* defined (__STDC__) */
  81. #endif /* ! __cplusplus */
  82. #ifdef YY_USE_CONST
  83. #define yyconst const
  84. #else
  85. #define yyconst
  86. #endif
  87. /* Returned upon end-of-file. */
  88. #define YY_NULL 0
  89. /* Promotes a possibly negative, possibly signed char to an unsigned
  90. * integer for use as an array index. If the signed char is negative,
  91. * we want to instead treat it as an 8-bit unsigned char, hence the
  92. * double cast.
  93. */
  94. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  95. /* An opaque pointer. */
  96. #ifndef YY_TYPEDEF_YY_SCANNER_T
  97. #define YY_TYPEDEF_YY_SCANNER_T
  98. typedef void* yyscan_t;
  99. #endif
  100. /* For convenience, these vars (plus the bison vars far below)
  101. are macros in the reentrant scanner. */
  102. #define yyin yyg->yyin_r
  103. #define yyout yyg->yyout_r
  104. #define yyextra yyg->yyextra_r
  105. #define yyleng yyg->yyleng_r
  106. #define yytext yyg->yytext_r
  107. #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
  108. #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
  109. #define yy_flex_debug yyg->yy_flex_debug_r
  110. /* Enter a start condition. This macro really ought to take a parameter,
  111. * but we do it the disgusting crufty way forced on us by the ()-less
  112. * definition of BEGIN.
  113. */
  114. #define BEGIN yyg->yy_start = 1 + 2 *
  115. /* Translate the current start state into a value that can be later handed
  116. * to BEGIN to return to the state. The YYSTATE alias is for lex
  117. * compatibility.
  118. */
  119. #define YY_START ((yyg->yy_start - 1) / 2)
  120. #define YYSTATE YY_START
  121. /* Action number for EOF rule of a given start state. */
  122. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  123. /* Special action meaning "start processing a new file". */
  124. #define YY_NEW_FILE rcsrestart(yyin ,yyscanner )
  125. #define YY_END_OF_BUFFER_CHAR 0
  126. /* Size of default input buffer. */
  127. #ifndef YY_BUF_SIZE
  128. #define YY_BUF_SIZE 16384
  129. #endif
  130. /* The state buf must be large enough to hold one state per character in the main buffer.
  131. */
  132. #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
  133. #ifndef YY_TYPEDEF_YY_BUFFER_STATE
  134. #define YY_TYPEDEF_YY_BUFFER_STATE
  135. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  136. #endif
  137. #define EOB_ACT_CONTINUE_SCAN 0
  138. #define EOB_ACT_END_OF_FILE 1
  139. #define EOB_ACT_LAST_MATCH 2
  140. #define YY_LESS_LINENO(n)
  141. /* Return all but the first "n" matched characters back to the input stream. */
  142. #define yyless(n) \
  143. do \
  144. { \
  145. /* Undo effects of setting up yytext. */ \
  146. int yyless_macro_arg = (n); \
  147. YY_LESS_LINENO(yyless_macro_arg);\
  148. *yy_cp = yyg->yy_hold_char; \
  149. YY_RESTORE_YY_MORE_OFFSET \
  150. yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  151. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  152. } \
  153. while ( 0 )
  154. #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
  155. #ifndef YY_TYPEDEF_YY_SIZE_T
  156. #define YY_TYPEDEF_YY_SIZE_T
  157. typedef size_t yy_size_t;
  158. #endif
  159. #ifndef YY_STRUCT_YY_BUFFER_STATE
  160. #define YY_STRUCT_YY_BUFFER_STATE
  161. struct yy_buffer_state
  162. {
  163. FILE *yy_input_file;
  164. char *yy_ch_buf; /* input buffer */
  165. char *yy_buf_pos; /* current position in input buffer */
  166. /* Size of input buffer in bytes, not including room for EOB
  167. * characters.
  168. */
  169. yy_size_t yy_buf_size;
  170. /* Number of characters read into yy_ch_buf, not including EOB
  171. * characters.
  172. */
  173. int yy_n_chars;
  174. /* Whether we "own" the buffer - i.e., we know we created it,
  175. * and can realloc() it to grow it, and should free() it to
  176. * delete it.
  177. */
  178. int yy_is_our_buffer;
  179. /* Whether this is an "interactive" input source; if so, and
  180. * if we're using stdio for input, then we want to use getc()
  181. * instead of fread(), to make sure we stop fetching input after
  182. * each newline.
  183. */
  184. int yy_is_interactive;
  185. /* Whether we're considered to be at the beginning of a line.
  186. * If so, '^' rules will be active on the next match, otherwise
  187. * not.
  188. */
  189. int yy_at_bol;
  190. int yy_bs_lineno; /**< The line count. */
  191. int yy_bs_column; /**< The column count. */
  192. /* Whether to try to fill the input buffer when we reach the
  193. * end of it.
  194. */
  195. int yy_fill_buffer;
  196. int yy_buffer_status;
  197. #define YY_BUFFER_NEW 0
  198. #define YY_BUFFER_NORMAL 1
  199. /* When an EOF's been seen but there's still some text to process
  200. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  201. * shouldn't try reading from the input source any more. We might
  202. * still have a bunch of tokens to match, though, because of
  203. * possible backing-up.
  204. *
  205. * When we actually see the EOF, we change the status to "new"
  206. * (via rcsrestart()), so that the user can continue scanning by
  207. * just pointing yyin at a new input file.
  208. */
  209. #define YY_BUFFER_EOF_PENDING 2
  210. };
  211. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  212. /* We provide macros for accessing buffer states in case in the
  213. * future we want to put the buffer states in a more general
  214. * "scanner state".
  215. *
  216. * Returns the top of the stack, or NULL.
  217. */
  218. #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
  219. ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
  220. : NULL)
  221. /* Same as previous macro, but useful when we know that the buffer stack is not
  222. * NULL or when we need an lvalue. For internal use only.
  223. */
  224. #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
  225. void rcsrestart (FILE *input_file ,yyscan_t yyscanner );
  226. void rcs_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
  227. YY_BUFFER_STATE rcs_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
  228. void rcs_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
  229. void rcs_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
  230. void rcspush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
  231. void rcspop_buffer_state (yyscan_t yyscanner );
  232. static void rcsensure_buffer_stack (yyscan_t yyscanner );
  233. static void rcs_load_buffer_state (yyscan_t yyscanner );
  234. static void rcs_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
  235. #define YY_FLUSH_BUFFER rcs_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
  236. YY_BUFFER_STATE rcs_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
  237. YY_BUFFER_STATE rcs_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
  238. YY_BUFFER_STATE rcs_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
  239. void *rcsalloc (yy_size_t ,yyscan_t yyscanner );
  240. void *rcsrealloc (void *,yy_size_t ,yyscan_t yyscanner );
  241. void rcsfree (void * ,yyscan_t yyscanner );
  242. #define yy_new_buffer rcs_create_buffer
  243. #define yy_set_interactive(is_interactive) \
  244. { \
  245. if ( ! YY_CURRENT_BUFFER ){ \
  246. rcsensure_buffer_stack (yyscanner); \
  247. YY_CURRENT_BUFFER_LVALUE = \
  248. rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
  249. } \
  250. YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  251. }
  252. #define yy_set_bol(at_bol) \
  253. { \
  254. if ( ! YY_CURRENT_BUFFER ){\
  255. rcsensure_buffer_stack (yyscanner); \
  256. YY_CURRENT_BUFFER_LVALUE = \
  257. rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
  258. } \
  259. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  260. }
  261. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  262. /* Begin user sect3 */
  263. #define rcswrap(n) 1
  264. #define YY_SKIP_YYWRAP
  265. typedef unsigned char YY_CHAR;
  266. typedef int yy_state_type;
  267. #define yytext_ptr yytext_r
  268. static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
  269. static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
  270. static int yy_get_next_buffer (yyscan_t yyscanner );
  271. static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
  272. /* Done after the current pattern has been matched and before the
  273. * corresponding action - sets up yytext.
  274. */
  275. #define YY_DO_BEFORE_ACTION \
  276. yyg->yytext_ptr = yy_bp; \
  277. yyleng = (size_t) (yy_cp - yy_bp); \
  278. yyg->yy_hold_char = *yy_cp; \
  279. *yy_cp = '\0'; \
  280. yyg->yy_c_buf_p = yy_cp;
  281. #define YY_NUM_RULES 10
  282. #define YY_END_OF_BUFFER 11
  283. /* This struct is not used in this scanner,
  284. but its presence is necessary. */
  285. struct yy_trans_info
  286. {
  287. flex_int32_t yy_verify;
  288. flex_int32_t yy_nxt;
  289. };
  290. static yyconst flex_int16_t yy_accept[89] =
  291. { 0,
  292. 0, 0, 11, 5, 9, 8, 10, 4, 4, 7,
  293. 6, 5, 5, 5, 5, 5, 5, 5, 5, 5,
  294. 5, 5, 5, 5, 5, 9, 5, 4, 4, 5,
  295. 4, 4, 5, 0, 0, 5, 5, 3, 5, 5,
  296. 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
  297. 5, 3, 5, 5, 5, 5, 5, 5, 5, 5,
  298. 5, 2, 5, 5, 5, 5, 5, 5, 5, 5,
  299. 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
  300. 5, 5, 5, 1, 5, 5, 5, 0
  301. } ;
  302. static yyconst flex_int32_t yy_ec[256] =
  303. { 0,
  304. 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
  305. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  306. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  307. 1, 2, 1, 1, 1, 4, 1, 1, 1, 1,
  308. 1, 1, 1, 4, 1, 5, 1, 6, 6, 6,
  309. 6, 6, 6, 6, 6, 6, 6, 7, 8, 1,
  310. 1, 1, 1, 9, 1, 1, 1, 1, 1, 1,
  311. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  312. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  313. 1, 1, 1, 1, 1, 1, 10, 11, 12, 13,
  314. 14, 1, 15, 16, 17, 1, 18, 19, 20, 21,
  315. 22, 23, 1, 24, 25, 26, 27, 1, 1, 28,
  316. 29, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  317. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  318. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  319. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  320. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  321. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  322. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  323. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  324. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  325. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  326. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  327. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  328. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  329. 1, 1, 1, 1, 1
  330. } ;
  331. static yyconst flex_int32_t yy_meta[30] =
  332. { 0,
  333. 1, 2, 2, 2, 1, 1, 2, 2, 1, 1,
  334. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  335. 1, 1, 1, 1, 1, 1, 1, 1, 1
  336. } ;
  337. static yyconst flex_int16_t yy_base[94] =
  338. { 0,
  339. 0, 0, 136, 25, 127, 297, 297, 27, 29, 297,
  340. 297, 34, 39, 41, 47, 44, 50, 54, 57, 66,
  341. 68, 70, 76, 80, 82, 91, 84, 86, 90, 93,
  342. 95, 97, 102, 58, 61, 0, 0, 107, 109, 112,
  343. 114, 117, 120, 122, 125, 129, 137, 127, 135, 145,
  344. 148, 74, 152, 155, 157, 162, 167, 174, 164, 178,
  345. 182, 184, 187, 189, 191, 193, 196, 200, 204, 206,
  346. 214, 211, 218, 224, 228, 230, 236, 239, 241, 243,
  347. 245, 248, 250, 254, 260, 265, 267, 297, 76, 56,
  348. 47, 292, 294
  349. } ;
  350. static yyconst flex_int16_t yy_def[94] =
  351. { 0,
  352. 88, 1, 88, 89, 88, 88, 88, 90, 91, 88,
  353. 88, 92, 89, 89, 89, 89, 89, 89, 89, 89,
  354. 89, 89, 89, 89, 89, 88, 89, 90, 91, 89,
  355. 91, 91, 92, 93, 93, 33, 33, 89, 89, 89,
  356. 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
  357. 89, 88, 89, 89, 89, 89, 89, 89, 89, 89,
  358. 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
  359. 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
  360. 89, 89, 89, 89, 89, 89, 89, 0, 88, 88,
  361. 88, 88, 88
  362. } ;
  363. static yyconst flex_int16_t yy_nxt[327] =
  364. { 0,
  365. 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
  366. 14, 15, 16, 17, 4, 18, 4, 4, 19, 4,
  367. 20, 4, 4, 4, 21, 22, 4, 4, 4, 24,
  368. 25, 28, 29, 31, 32, 34, 35, 34, 36, 37,
  369. 34, 34, 38, 24, 25, 24, 25, 30, 24, 25,
  370. 39, 24, 25, 43, 24, 25, 27, 44, 24, 25,
  371. 35, 24, 25, 35, 41, 40, 52, 46, 42, 52,
  372. 24, 25, 24, 25, 24, 25, 23, 45, 47, 48,
  373. 24, 25, 34, 51, 24, 25, 24, 25, 24, 25,
  374. 28, 29, 26, 49, 31, 32, 50, 24, 25, 31,
  375. 32, 31, 32, 34, 35, 34, 36, 37, 34, 34,
  376. 38, 24, 25, 24, 25, 33, 24, 25, 24, 25,
  377. 53, 24, 25, 55, 24, 25, 24, 25, 26, 24,
  378. 25, 24, 25, 24, 25, 88, 56, 54, 60, 24,
  379. 25, 24, 25, 88, 64, 57, 58, 59, 61, 24,
  380. 25, 62, 24, 25, 63, 88, 24, 25, 65, 24,
  381. 25, 24, 25, 88, 66, 68, 24, 25, 24, 25,
  382. 69, 24, 25, 72, 88, 67, 88, 70, 24, 25,
  383. 62, 71, 24, 25, 88, 62, 24, 25, 24, 25,
  384. 62, 24, 25, 24, 25, 24, 25, 24, 25, 73,
  385. 24, 25, 88, 76, 24, 25, 88, 75, 24, 25,
  386. 24, 25, 62, 88, 74, 24, 25, 79, 24, 25,
  387. 88, 62, 24, 25, 77, 78, 88, 80, 24, 25,
  388. 88, 81, 24, 25, 24, 25, 88, 62, 88, 82,
  389. 24, 25, 62, 24, 25, 24, 25, 24, 25, 24,
  390. 25, 83, 24, 25, 24, 25, 84, 62, 24, 25,
  391. 62, 88, 62, 85, 24, 25, 88, 87, 86, 24,
  392. 25, 24, 25, 62, 88, 88, 88, 88, 88, 88,
  393. 88, 88, 88, 88, 88, 62, 88, 88, 88, 62,
  394. 88, 62, 33, 33, 34, 34, 3, 88, 88, 88,
  395. 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
  396. 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
  397. 88, 88, 88, 88, 88, 88
  398. } ;
  399. static yyconst flex_int16_t yy_chk[327] =
  400. { 0,
  401. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  402. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  403. 1, 1, 1, 1, 1, 1, 1, 1, 1, 4,
  404. 4, 8, 8, 9, 9, 12, 12, 12, 12, 12,
  405. 12, 12, 12, 13, 13, 14, 14, 91, 16, 16,
  406. 13, 15, 15, 16, 17, 17, 90, 16, 18, 18,
  407. 34, 19, 19, 35, 14, 13, 34, 18, 15, 35,
  408. 20, 20, 21, 21, 22, 22, 89, 17, 19, 20,
  409. 23, 23, 52, 22, 24, 24, 25, 25, 27, 27,
  410. 28, 28, 26, 21, 29, 29, 21, 30, 30, 31,
  411. 31, 32, 32, 33, 33, 33, 33, 33, 33, 33,
  412. 33, 38, 38, 39, 39, 38, 40, 40, 41, 41,
  413. 39, 42, 42, 41, 43, 43, 44, 44, 5, 45,
  414. 45, 48, 48, 46, 46, 3, 42, 40, 46, 49,
  415. 49, 47, 47, 0, 49, 43, 44, 45, 47, 50,
  416. 50, 47, 51, 51, 48, 0, 53, 53, 49, 54,
  417. 54, 55, 55, 0, 50, 53, 56, 56, 59, 59,
  418. 54, 57, 57, 59, 0, 51, 0, 55, 58, 58,
  419. 57, 56, 60, 60, 0, 58, 61, 61, 62, 62,
  420. 60, 63, 63, 64, 64, 65, 65, 66, 66, 61,
  421. 67, 67, 0, 66, 68, 68, 0, 65, 69, 69,
  422. 70, 70, 63, 0, 64, 72, 72, 70, 71, 71,
  423. 0, 67, 73, 73, 68, 69, 0, 71, 74, 74,
  424. 0, 72, 75, 75, 76, 76, 0, 74, 0, 75,
  425. 77, 77, 73, 78, 78, 79, 79, 80, 80, 81,
  426. 81, 76, 82, 82, 83, 83, 79, 81, 84, 84,
  427. 77, 0, 78, 80, 85, 85, 0, 84, 83, 86,
  428. 86, 87, 87, 82, 0, 0, 0, 0, 0, 0,
  429. 0, 0, 0, 0, 0, 85, 0, 0, 0, 86,
  430. 0, 87, 92, 92, 93, 93, 88, 88, 88, 88,
  431. 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
  432. 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
  433. 88, 88, 88, 88, 88, 88
  434. } ;
  435. /* The intent behind this definition is that it'll catch
  436. * any uses of REJECT which flex missed.
  437. */
  438. #define REJECT reject_used_but_not_detected
  439. #define yymore() yymore_used_but_not_detected
  440. #define YY_MORE_ADJ 0
  441. #define YY_RESTORE_YY_MORE_OFFSET
  442. #line 1 "rcstokenizer.l"
  443. /*-
  444. * Copyright (c) 2007-2008, Ulf Lilleengen <lulf@FreeBSD.org>
  445. * All rights reserved.
  446. *
  447. * Redistribution and use in source and binary forms, with or without
  448. * modification, are permitted provided that the following conditions
  449. * are met:
  450. * 1. Redistributions of source code must retain the above copyright
  451. * notice, this list of conditions and the following disclaimer.
  452. * 2. Redistributions in binary form must reproduce the above copyright
  453. * notice, this list of conditions and the following disclaimer in the
  454. * documentation and/or other materials provided with the distribution.
  455. *
  456. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  457. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  458. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  459. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  460. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  461. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  462. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  463. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  464. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  465. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  466. * SUCH DAMAGE.
  467. *
  468. * $FreeBSD$
  469. *
  470. */
  471. /*
  472. * This tokenizer must be generated by a lexxer with support for reentrancy.
  473. */
  474. #line 34 "rcstokenizer.l"
  475. #include <string.h>
  476. #include "misc.h"
  477. #include "rcsparse.h"
  478. #line 567 "lex.rcs.c"
  479. #define INITIAL 0
  480. #ifndef YY_NO_UNISTD_H
  481. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  482. * down here because we want the user's section 1 to have been scanned first.
  483. * The user has a chance to override it with an option.
  484. */
  485. #include <unistd.h>
  486. #endif
  487. #ifndef YY_EXTRA_TYPE
  488. #define YY_EXTRA_TYPE void *
  489. #endif
  490. /* Holds the entire state of the reentrant scanner. */
  491. struct yyguts_t
  492. {
  493. /* User-defined. Not touched by flex. */
  494. YY_EXTRA_TYPE yyextra_r;
  495. /* The rest are the same as the globals declared in the non-reentrant scanner. */
  496. FILE *yyin_r, *yyout_r;
  497. size_t yy_buffer_stack_top; /**< index of top of stack. */
  498. size_t yy_buffer_stack_max; /**< capacity of stack. */
  499. YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
  500. char yy_hold_char;
  501. int yy_n_chars;
  502. int yyleng_r;
  503. char *yy_c_buf_p;
  504. int yy_init;
  505. int yy_start;
  506. int yy_did_buffer_switch_on_eof;
  507. int yy_start_stack_ptr;
  508. int yy_start_stack_depth;
  509. int *yy_start_stack;
  510. yy_state_type yy_last_accepting_state;
  511. char* yy_last_accepting_cpos;
  512. int yylineno_r;
  513. int yy_flex_debug_r;
  514. char *yytext_r;
  515. int yy_more_flag;
  516. int yy_more_len;
  517. }; /* end struct yyguts_t */
  518. static int yy_init_globals (yyscan_t yyscanner );
  519. int rcslex_init (yyscan_t* scanner);
  520. int rcslex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
  521. /* Accessor methods to globals.
  522. These are made visible to non-reentrant scanners for convenience. */
  523. int rcslex_destroy (yyscan_t yyscanner );
  524. int rcsget_debug (yyscan_t yyscanner );
  525. void rcsset_debug (int debug_flag ,yyscan_t yyscanner );
  526. YY_EXTRA_TYPE rcsget_extra (yyscan_t yyscanner );
  527. void rcsset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
  528. FILE *rcsget_in (yyscan_t yyscanner );
  529. void rcsset_in (FILE * in_str ,yyscan_t yyscanner );
  530. FILE *rcsget_out (yyscan_t yyscanner );
  531. void rcsset_out (FILE * out_str ,yyscan_t yyscanner );
  532. int rcsget_leng (yyscan_t yyscanner );
  533. char *rcsget_text (yyscan_t yyscanner );
  534. int rcsget_lineno (yyscan_t yyscanner );
  535. void rcsset_lineno (int line_number ,yyscan_t yyscanner );
  536. /* Macros after this point can all be overridden by user definitions in
  537. * section 1.
  538. */
  539. #ifndef YY_SKIP_YYWRAP
  540. #ifdef __cplusplus
  541. extern "C" int rcswrap (yyscan_t yyscanner );
  542. #else
  543. extern int rcswrap (yyscan_t yyscanner );
  544. #endif
  545. #endif
  546. static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
  547. #ifndef yytext_ptr
  548. static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
  549. #endif
  550. #ifdef YY_NEED_STRLEN
  551. static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
  552. #endif
  553. #ifndef YY_NO_INPUT
  554. #ifdef __cplusplus
  555. static int yyinput (yyscan_t yyscanner );
  556. #else
  557. static int input (yyscan_t yyscanner );
  558. #endif
  559. #endif
  560. /* Amount of stuff to slurp up with each read. */
  561. #ifndef YY_READ_BUF_SIZE
  562. #define YY_READ_BUF_SIZE 8192
  563. #endif
  564. /* Copy whatever the last rule matched to the standard output. */
  565. #ifndef ECHO
  566. /* This used to be an fputs(), but since the string might contain NUL's,
  567. * we now use fwrite().
  568. */
  569. #define ECHO fwrite( yytext, yyleng, 1, yyout )
  570. #endif
  571. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  572. * is returned in "result".
  573. */
  574. #ifndef YY_INPUT
  575. #define YY_INPUT(buf,result,max_size) \
  576. if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  577. { \
  578. int c = '*'; \
  579. int n; \
  580. for ( n = 0; n < max_size && \
  581. (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  582. buf[n] = (char) c; \
  583. if ( c == '\n' ) \
  584. buf[n++] = (char) c; \
  585. if ( c == EOF && ferror( yyin ) ) \
  586. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  587. result = n; \
  588. } \
  589. else \
  590. { \
  591. errno=0; \
  592. while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
  593. { \
  594. if( errno != EINTR) \
  595. { \
  596. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  597. break; \
  598. } \
  599. errno=0; \
  600. clearerr(yyin); \
  601. } \
  602. }\
  603. \
  604. #endif
  605. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  606. * we don't want an extra ';' after the "return" because that will cause
  607. * some compilers to complain about unreachable statements.
  608. */
  609. #ifndef yyterminate
  610. #define yyterminate() return YY_NULL
  611. #endif
  612. /* Number of entries by which start-condition stack grows. */
  613. #ifndef YY_START_STACK_INCR
  614. #define YY_START_STACK_INCR 25
  615. #endif
  616. /* Report a fatal error. */
  617. #ifndef YY_FATAL_ERROR
  618. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
  619. #endif
  620. /* end tables serialization structures and prototypes */
  621. /* Default declaration of generated scanner - a define so the user can
  622. * easily add parameters.
  623. */
  624. #ifndef YY_DECL
  625. #define YY_DECL_IS_OURS 1
  626. extern int rcslex (yyscan_t yyscanner);
  627. #define YY_DECL int rcslex (yyscan_t yyscanner)
  628. #endif /* !YY_DECL */
  629. /* Code executed at the beginning of each rule, after yytext and yyleng
  630. * have been set up.
  631. */
  632. #ifndef YY_USER_ACTION
  633. #define YY_USER_ACTION
  634. #endif
  635. /* Code executed at the end of each rule. */
  636. #ifndef YY_BREAK
  637. #define YY_BREAK break;
  638. #endif
  639. #define YY_RULE_SETUP \
  640. YY_USER_ACTION
  641. /** The main scanner function which does all the work.
  642. */
  643. YY_DECL
  644. {
  645. register yy_state_type yy_current_state;
  646. register char *yy_cp, *yy_bp;
  647. register int yy_act;
  648. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  649. #line 51 "rcstokenizer.l"
  650. #line 791 "lex.rcs.c"
  651. if ( !yyg->yy_init )
  652. {
  653. yyg->yy_init = 1;
  654. #ifdef YY_USER_INIT
  655. YY_USER_INIT;
  656. #endif
  657. if ( ! yyg->yy_start )
  658. yyg->yy_start = 1; /* first start state */
  659. if ( ! yyin )
  660. yyin = stdin;
  661. if ( ! yyout )
  662. yyout = stdout;
  663. if ( ! YY_CURRENT_BUFFER ) {
  664. rcsensure_buffer_stack (yyscanner);
  665. YY_CURRENT_BUFFER_LVALUE =
  666. rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
  667. }
  668. rcs_load_buffer_state(yyscanner );
  669. }
  670. while ( 1 ) /* loops until end-of-file is reached */
  671. {
  672. yy_cp = yyg->yy_c_buf_p;
  673. /* Support of yytext. */
  674. *yy_cp = yyg->yy_hold_char;
  675. /* yy_bp points to the position in yy_ch_buf of the start of
  676. * the current run.
  677. */
  678. yy_bp = yy_cp;
  679. yy_current_state = yyg->yy_start;
  680. yy_match:
  681. do
  682. {
  683. register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
  684. if ( yy_accept[yy_current_state] )
  685. {
  686. yyg->yy_last_accepting_state = yy_current_state;
  687. yyg->yy_last_accepting_cpos = yy_cp;
  688. }
  689. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  690. {
  691. yy_current_state = (int) yy_def[yy_current_state];
  692. if ( yy_current_state >= 89 )
  693. yy_c = yy_meta[(unsigned int) yy_c];
  694. }
  695. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  696. ++yy_cp;
  697. }
  698. while ( yy_base[yy_current_state] != 297 );
  699. yy_find_action:
  700. yy_act = yy_accept[yy_current_state];
  701. if ( yy_act == 0 )
  702. { /* have to back up */
  703. yy_cp = yyg->yy_last_accepting_cpos;
  704. yy_current_state = yyg->yy_last_accepting_state;
  705. yy_act = yy_accept[yy_current_state];
  706. }
  707. YY_DO_BEFORE_ACTION;
  708. do_action: /* This label is used only to access EOF actions. */
  709. switch ( yy_act )
  710. { /* beginning of action switch */
  711. case 0: /* must back up */
  712. /* undo the effects of YY_DO_BEFORE_ACTION */
  713. *yy_cp = yyg->yy_hold_char;
  714. yy_cp = yyg->yy_last_accepting_cpos;
  715. yy_current_state = yyg->yy_last_accepting_state;
  716. goto yy_find_action;
  717. case 1:
  718. YY_RULE_SETUP
  719. #line 53 "rcstokenizer.l"
  720. {
  721. return (KEYWORD_TWO);
  722. }
  723. YY_BREAK
  724. case 2:
  725. YY_RULE_SETUP
  726. #line 56 "rcstokenizer.l"
  727. {
  728. return (KEYWORD);
  729. }
  730. YY_BREAK
  731. case 3:
  732. /* rule 3 can match eol */
  733. YY_RULE_SETUP
  734. #line 59 "rcstokenizer.l"
  735. {
  736. return (STRING);
  737. }
  738. YY_BREAK
  739. case 4:
  740. YY_RULE_SETUP
  741. #line 62 "rcstokenizer.l"
  742. {
  743. return (NUM);
  744. }
  745. YY_BREAK
  746. case 5:
  747. YY_RULE_SETUP
  748. #line 65 "rcstokenizer.l"
  749. {
  750. /* This will use ID as both ID and SYM. Do extra checking elsewhere.*/
  751. return (ID);
  752. }
  753. YY_BREAK
  754. case 6:
  755. YY_RULE_SETUP
  756. #line 69 "rcstokenizer.l"
  757. { return (SEMIC); }
  758. YY_BREAK
  759. case 7:
  760. YY_RULE_SETUP
  761. #line 70 "rcstokenizer.l"
  762. { return (COLON); }
  763. YY_BREAK
  764. case 8:
  765. /* rule 8 can match eol */
  766. YY_RULE_SETUP
  767. #line 71 "rcstokenizer.l"
  768. ;
  769. YY_BREAK
  770. case 9:
  771. YY_RULE_SETUP
  772. #line 72 "rcstokenizer.l"
  773. ;
  774. YY_BREAK
  775. case 10:
  776. YY_RULE_SETUP
  777. #line 73 "rcstokenizer.l"
  778. ECHO;
  779. YY_BREAK
  780. #line 937 "lex.rcs.c"
  781. case YY_STATE_EOF(INITIAL):
  782. yyterminate();
  783. case YY_END_OF_BUFFER:
  784. {
  785. /* Amount of text matched not including the EOB char. */
  786. int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
  787. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  788. *yy_cp = yyg->yy_hold_char;
  789. YY_RESTORE_YY_MORE_OFFSET
  790. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  791. {
  792. /* We're scanning a new file or input source. It's
  793. * possible that this happened because the user
  794. * just pointed yyin at a new source and called
  795. * rcslex(). If so, then we have to assure
  796. * consistency between YY_CURRENT_BUFFER and our
  797. * globals. Here is the right place to do so, because
  798. * this is the first action (other than possibly a
  799. * back-up) that will match for the new input source.
  800. */
  801. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  802. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  803. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  804. }
  805. /* Note that here we test for yy_c_buf_p "<=" to the position
  806. * of the first EOB in the buffer, since yy_c_buf_p will
  807. * already have been incremented past the NUL character
  808. * (since all states make transitions on EOB to the
  809. * end-of-buffer state). Contrast this with the test
  810. * in input().
  811. */
  812. if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  813. { /* This was really a NUL. */
  814. yy_state_type yy_next_state;
  815. yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
  816. yy_current_state = yy_get_previous_state( yyscanner );
  817. /* Okay, we're now positioned to make the NUL
  818. * transition. We couldn't have
  819. * yy_get_previous_state() go ahead and do it
  820. * for us because it doesn't know how to deal
  821. * with the possibility of jamming (and we don't
  822. * want to build jamming into it because then it
  823. * will run more slowly).
  824. */
  825. yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
  826. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  827. if ( yy_next_state )
  828. {
  829. /* Consume the NUL. */
  830. yy_cp = ++yyg->yy_c_buf_p;
  831. yy_current_state = yy_next_state;
  832. goto yy_match;
  833. }
  834. else
  835. {
  836. yy_cp = yyg->yy_c_buf_p;
  837. goto yy_find_action;
  838. }
  839. }
  840. else switch ( yy_get_next_buffer( yyscanner ) )
  841. {
  842. case EOB_ACT_END_OF_FILE:
  843. {
  844. yyg->yy_did_buffer_switch_on_eof = 0;
  845. if ( rcswrap(yyscanner ) )
  846. {
  847. /* Note: because we've taken care in
  848. * yy_get_next_buffer() to have set up
  849. * yytext, we can now set up
  850. * yy_c_buf_p so that if some total
  851. * hoser (like flex itself) wants to
  852. * call the scanner after we return the
  853. * YY_NULL, it'll still work - another
  854. * YY_NULL will get returned.
  855. */
  856. yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
  857. yy_act = YY_STATE_EOF(YY_START);
  858. goto do_action;
  859. }
  860. else
  861. {
  862. if ( ! yyg->yy_did_buffer_switch_on_eof )
  863. YY_NEW_FILE;
  864. }
  865. break;
  866. }
  867. case EOB_ACT_CONTINUE_SCAN:
  868. yyg->yy_c_buf_p =
  869. yyg->yytext_ptr + yy_amount_of_matched_text;
  870. yy_current_state = yy_get_previous_state( yyscanner );
  871. yy_cp = yyg->yy_c_buf_p;
  872. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  873. goto yy_match;
  874. case EOB_ACT_LAST_MATCH:
  875. yyg->yy_c_buf_p =
  876. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
  877. yy_current_state = yy_get_previous_state( yyscanner );
  878. yy_cp = yyg->yy_c_buf_p;
  879. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  880. goto yy_find_action;
  881. }
  882. break;
  883. }
  884. default:
  885. YY_FATAL_ERROR(
  886. "fatal flex scanner internal error--no action found" );
  887. } /* end of action switch */
  888. } /* end of scanning one token */
  889. } /* end of rcslex */
  890. /* yy_get_next_buffer - try to read in a new buffer
  891. *
  892. * Returns a code representing an action:
  893. * EOB_ACT_LAST_MATCH -
  894. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  895. * EOB_ACT_END_OF_FILE - end of file
  896. */
  897. static int yy_get_next_buffer (yyscan_t yyscanner)
  898. {
  899. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  900. register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  901. register char *source = yyg->yytext_ptr;
  902. register int number_to_move, i;
  903. int ret_val;
  904. if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
  905. YY_FATAL_ERROR(
  906. "fatal flex scanner internal error--end of buffer missed" );
  907. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  908. { /* Don't try to fill the buffer, so this is an EOF. */
  909. if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
  910. {
  911. /* We matched a single character, the EOB, so
  912. * treat this as a final EOF.
  913. */
  914. return EOB_ACT_END_OF_FILE;
  915. }
  916. else
  917. {
  918. /* We matched some text prior to the EOB, first
  919. * process it.
  920. */
  921. return EOB_ACT_LAST_MATCH;
  922. }
  923. }
  924. /* Try to read more data. */
  925. /* First move last chars to start of buffer. */
  926. number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
  927. for ( i = 0; i < number_to_move; ++i )
  928. *(dest++) = *(source++);
  929. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  930. /* don't do the read, it's not guaranteed to return an EOF,
  931. * just force an EOF
  932. */
  933. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
  934. else
  935. {
  936. int num_to_read =
  937. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  938. while ( num_to_read <= 0 )
  939. { /* Not enough room in the buffer - grow it. */
  940. /* just a shorter name for the current buffer */
  941. YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
  942. int yy_c_buf_p_offset =
  943. (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
  944. if ( b->yy_is_our_buffer )
  945. {
  946. int new_size = b->yy_buf_size * 2;
  947. if ( new_size <= 0 )
  948. b->yy_buf_size += b->yy_buf_size / 8;
  949. else
  950. b->yy_buf_size *= 2;
  951. b->yy_ch_buf = (char *)
  952. /* Include room in for 2 EOB chars. */
  953. rcsrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
  954. }
  955. else
  956. /* Can't grow it, we don't own it. */
  957. b->yy_ch_buf = 0;
  958. if ( ! b->yy_ch_buf )
  959. YY_FATAL_ERROR(
  960. "fatal error - scanner input buffer overflow" );
  961. yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  962. num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  963. number_to_move - 1;
  964. }
  965. if ( num_to_read > YY_READ_BUF_SIZE )
  966. num_to_read = YY_READ_BUF_SIZE;
  967. /* Read in more data. */
  968. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  969. yyg->yy_n_chars, (size_t) num_to_read );
  970. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  971. }
  972. if ( yyg->yy_n_chars == 0 )
  973. {
  974. if ( number_to_move == YY_MORE_ADJ )
  975. {
  976. ret_val = EOB_ACT_END_OF_FILE;
  977. rcsrestart(yyin ,yyscanner);
  978. }
  979. else
  980. {
  981. ret_val = EOB_ACT_LAST_MATCH;
  982. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  983. YY_BUFFER_EOF_PENDING;
  984. }
  985. }
  986. else
  987. ret_val = EOB_ACT_CONTINUE_SCAN;
  988. if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
  989. /* Extend the array by 50%, plus the number we really need. */
  990. yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
  991. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) rcsrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
  992. if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  993. YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
  994. }
  995. yyg->yy_n_chars += number_to_move;
  996. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  997. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  998. yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  999. return ret_val;
  1000. }
  1001. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1002. static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
  1003. {
  1004. register yy_state_type yy_current_state;
  1005. register char *yy_cp;
  1006. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1007. yy_current_state = yyg->yy_start;
  1008. for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
  1009. {
  1010. register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  1011. if ( yy_accept[yy_current_state] )
  1012. {
  1013. yyg->yy_last_accepting_state = yy_current_state;
  1014. yyg->yy_last_accepting_cpos = yy_cp;
  1015. }
  1016. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1017. {
  1018. yy_current_state = (int) yy_def[yy_current_state];
  1019. if ( yy_current_state >= 89 )
  1020. yy_c = yy_meta[(unsigned int) yy_c];
  1021. }
  1022. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1023. }
  1024. return yy_current_state;
  1025. }
  1026. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1027. *
  1028. * synopsis
  1029. * next_state = yy_try_NUL_trans( current_state );
  1030. */
  1031. static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
  1032. {
  1033. register int yy_is_jam;
  1034. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
  1035. register char *yy_cp = yyg->yy_c_buf_p;
  1036. register YY_CHAR yy_c = 1;
  1037. if ( yy_accept[yy_current_state] )
  1038. {
  1039. yyg->yy_last_accepting_state = yy_current_state;
  1040. yyg->yy_last_accepting_cpos = yy_cp;
  1041. }
  1042. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1043. {
  1044. yy_current_state = (int) yy_def[yy_current_state];
  1045. if ( yy_current_state >= 89 )
  1046. yy_c = yy_meta[(unsigned int) yy_c];
  1047. }
  1048. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1049. yy_is_jam = (yy_current_state == 88);
  1050. return yy_is_jam ? 0 : yy_current_state;
  1051. }
  1052. static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
  1053. {
  1054. register char *yy_cp;
  1055. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1056. yy_cp = yyg->yy_c_buf_p;
  1057. /* undo effects of setting up yytext */
  1058. *yy_cp = yyg->yy_hold_char;
  1059. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1060. { /* need to shift things up to make room */
  1061. /* +2 for EOB chars. */
  1062. register int number_to_move = yyg->yy_n_chars + 2;
  1063. register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
  1064. YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
  1065. register char *source =
  1066. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
  1067. while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1068. *--dest = *--source;
  1069. yy_cp += (int) (dest - source);
  1070. yy_bp += (int) (dest - source);
  1071. YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
  1072. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
  1073. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1074. YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1075. }
  1076. *--yy_cp = (char) c;
  1077. yyg->yytext_ptr = yy_bp;
  1078. yyg->yy_hold_char = *yy_cp;
  1079. yyg->yy_c_buf_p = yy_cp;
  1080. }
  1081. #ifndef YY_NO_INPUT
  1082. #ifdef __cplusplus
  1083. static int yyinput (yyscan_t yyscanner)
  1084. #else
  1085. static int input (yyscan_t yyscanner)
  1086. #endif
  1087. {
  1088. int c;
  1089. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1090. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1091. if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1092. {
  1093. /* yy_c_buf_p now points to the character we want to return.
  1094. * If this occurs *before* the EOB characters, then it's a
  1095. * valid NUL; if not, then we've hit the end of the buffer.
  1096. */
  1097. if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  1098. /* This was really a NUL. */
  1099. *yyg->yy_c_buf_p = '\0';
  1100. else
  1101. { /* need more input */
  1102. int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
  1103. ++yyg->yy_c_buf_p;
  1104. switch ( yy_get_next_buffer( yyscanner ) )
  1105. {
  1106. case EOB_ACT_LAST_MATCH:
  1107. /* This happens because yy_g_n_b()
  1108. * sees that we've accumulated a
  1109. * token and flags that we need to
  1110. * try matching the token before
  1111. * proceeding. But for input(),
  1112. * there's no matching to consider.
  1113. * So convert the EOB_ACT_LAST_MATCH
  1114. * to EOB_ACT_END_OF_FILE.
  1115. */
  1116. /* Reset buffer status. */
  1117. rcsrestart(yyin ,yyscanner);
  1118. /*FALLTHROUGH*/
  1119. case EOB_ACT_END_OF_FILE:
  1120. {
  1121. if ( rcswrap(yyscanner ) )
  1122. return EOF;
  1123. if ( ! yyg->yy_did_buffer_switch_on_eof )
  1124. YY_NEW_FILE;
  1125. #ifdef __cplusplus
  1126. return yyinput(yyscanner);
  1127. #else
  1128. return input(yyscanner);
  1129. #endif
  1130. }
  1131. case EOB_ACT_CONTINUE_SCAN:
  1132. yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
  1133. break;
  1134. }
  1135. }
  1136. }
  1137. c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
  1138. *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
  1139. yyg->yy_hold_char = *++yyg->yy_c_buf_p;
  1140. return c;
  1141. }
  1142. #endif /* ifndef YY_NO_INPUT */
  1143. /** Immediately switch to a different input stream.
  1144. * @param input_file A readable stream.
  1145. * @param yyscanner The scanner object.
  1146. * @note This function does not reset the start condition to @c INITIAL .
  1147. */
  1148. void rcsrestart (FILE * input_file , yyscan_t yyscanner)
  1149. {
  1150. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1151. if ( ! YY_CURRENT_BUFFER ){
  1152. rcsensure_buffer_stack (yyscanner);
  1153. YY_CURRENT_BUFFER_LVALUE =
  1154. rcs_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
  1155. }
  1156. rcs_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
  1157. rcs_load_buffer_state(yyscanner );
  1158. }
  1159. /** Switch to a different input buffer.
  1160. * @param new_buffer The new input buffer.
  1161. * @param yyscanner The scanner object.
  1162. */
  1163. void rcs_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  1164. {
  1165. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1166. /* TODO. We should be able to replace this entire function body
  1167. * with
  1168. * rcspop_buffer_state();
  1169. * rcspush_buffer_state(new_buffer);
  1170. */
  1171. rcsensure_buffer_stack (yyscanner);
  1172. if ( YY_CURRENT_BUFFER == new_buffer )
  1173. return;
  1174. if ( YY_CURRENT_BUFFER )
  1175. {
  1176. /* Flush out information for old buffer. */
  1177. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1178. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  1179. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1180. }
  1181. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1182. rcs_load_buffer_state(yyscanner );
  1183. /* We don't actually know whether we did this switch during
  1184. * EOF (rcswrap()) processing, but the only time this flag
  1185. * is looked at is after rcswrap() is called, so it's safe
  1186. * to go ahead and always set it.
  1187. */
  1188. yyg->yy_did_buffer_switch_on_eof = 1;
  1189. }
  1190. static void rcs_load_buffer_state (yyscan_t yyscanner)
  1191. {
  1192. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1193. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1194. yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  1195. yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  1196. yyg->yy_hold_char = *yyg->yy_c_buf_p;
  1197. }
  1198. /** Allocate and initialize an input buffer state.
  1199. * @param file A readable stream.
  1200. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  1201. * @param yyscanner The scanner object.
  1202. * @return the allocated buffer state.
  1203. */
  1204. YY_BUFFER_STATE rcs_create_buffer (FILE * file, int size , yyscan_t yyscanner)
  1205. {
  1206. YY_BUFFER_STATE b;
  1207. b = (YY_BUFFER_STATE) rcsalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
  1208. if ( ! b )
  1209. YY_FATAL_ERROR( "out of dynamic memory in rcs_create_buffer()" );
  1210. b->yy_buf_size = size;
  1211. /* yy_ch_buf has to be 2 characters longer than the size given because
  1212. * we need to put in 2 end-of-buffer characters.
  1213. */
  1214. b->yy_ch_buf = (char *) rcsalloc(b->yy_buf_size + 2 ,yyscanner );
  1215. if ( ! b->yy_ch_buf )
  1216. YY_FATAL_ERROR( "out of dynamic memory in rcs_create_buffer()" );
  1217. b->yy_is_our_buffer = 1;
  1218. rcs_init_buffer(b,file ,yyscanner);
  1219. return b;
  1220. }
  1221. /** Destroy the buffer.
  1222. * @param b a buffer created with rcs_create_buffer()
  1223. * @param yyscanner The scanner object.
  1224. */
  1225. void rcs_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  1226. {
  1227. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1228. if ( ! b )
  1229. return;
  1230. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  1231. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  1232. if ( b->yy_is_our_buffer )
  1233. rcsfree((void *) b->yy_ch_buf ,yyscanner );
  1234. rcsfree((void *) b ,yyscanner );
  1235. }
  1236. #ifndef __cplusplus
  1237. extern int isatty (int );
  1238. #endif /* __cplusplus */
  1239. /* Initializes or reinitializes a buffer.
  1240. * This function is sometimes called more than once on the same buffer,
  1241. * such as during a rcsrestart() or at EOF.
  1242. */
  1243. static void rcs_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
  1244. {
  1245. int oerrno = errno;
  1246. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1247. rcs_flush_buffer(b ,yyscanner);
  1248. b->yy_input_file = file;
  1249. b->yy_fill_buffer = 1;
  1250. /* If b is the current buffer, then rcs_init_buffer was _probably_
  1251. * called from rcsrestart() or through yy_get_next_buffer.
  1252. * In that case, we don't want to reset the lineno or column.
  1253. */
  1254. if (b != YY_CURRENT_BUFFER){
  1255. b->yy_bs_lineno = 1;
  1256. b->yy_bs_column = 0;
  1257. }
  1258. b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1259. errno = oerrno;
  1260. }
  1261. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  1262. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  1263. * @param yyscanner The scanner object.
  1264. */
  1265. void rcs_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  1266. {
  1267. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1268. if ( ! b )
  1269. return;
  1270. b->yy_n_chars = 0;
  1271. /* We always need two end-of-buffer characters. The first causes
  1272. * a transition to the end-of-buffer state. The second causes
  1273. * a jam in that state.
  1274. */
  1275. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1276. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1277. b->yy_buf_pos = &b->yy_ch_buf[0];
  1278. b->yy_at_bol = 1;
  1279. b->yy_buffer_status = YY_BUFFER_NEW;
  1280. if ( b == YY_CURRENT_BUFFER )
  1281. rcs_load_buffer_state(yyscanner );
  1282. }
  1283. /** Pushes the new state onto the stack. The new state becomes
  1284. * the current state. This function will allocate the stack
  1285. * if necessary.
  1286. * @param new_buffer The new state.
  1287. * @param yyscanner The scanner object.
  1288. */
  1289. void rcspush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  1290. {
  1291. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1292. if (new_buffer == NULL)
  1293. return;
  1294. rcsensure_buffer_stack(yyscanner);
  1295. /* This block is copied from rcs_switch_to_buffer. */
  1296. if ( YY_CURRENT_BUFFER )
  1297. {
  1298. /* Flush out information for old buffer. */
  1299. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1300. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  1301. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1302. }
  1303. /* Only push if top exists. Otherwise, replace top. */
  1304. if (YY_CURRENT_BUFFER)
  1305. yyg->yy_buffer_stack_top++;
  1306. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1307. /* copied from rcs_switch_to_buffer. */
  1308. rcs_load_buffer_state(yyscanner );
  1309. yyg->yy_did_buffer_switch_on_eof = 1;
  1310. }
  1311. /** Removes and deletes the top of the stack, if present.
  1312. * The next element becomes the new top.
  1313. * @param yyscanner The scanner object.
  1314. */
  1315. void rcspop_buffer_state (yyscan_t yyscanner)
  1316. {
  1317. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1318. if (!YY_CURRENT_BUFFER)
  1319. return;
  1320. rcs_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
  1321. YY_CURRENT_BUFFER_LVALUE = NULL;
  1322. if (yyg->yy_buffer_stack_top > 0)
  1323. --yyg->yy_buffer_stack_top;
  1324. if (YY_CURRENT_BUFFER) {
  1325. rcs_load_buffer_state(yyscanner );
  1326. yyg->yy_did_buffer_switch_on_eof = 1;
  1327. }
  1328. }
  1329. /* Allocates the stack if it does not exist.
  1330. * Guarantees space for at least one push.
  1331. */
  1332. static void rcsensure_buffer_stack (yyscan_t yyscanner)
  1333. {
  1334. int num_to_alloc;
  1335. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1336. if (!yyg->yy_buffer_stack) {
  1337. /* First allocation is just for 2 elements, since we don't know if this
  1338. * scanner will even need a stack. We use 2 instead of 1 to avoid an
  1339. * immediate realloc on the next call.
  1340. */
  1341. num_to_alloc = 1;
  1342. yyg->yy_buffer_stack = (struct yy_buffer_state**)rcsalloc
  1343. (num_to_alloc * sizeof(struct yy_buffer_state*)
  1344. , yyscanner);
  1345. if ( ! yyg->yy_buffer_stack )
  1346. YY_FATAL_ERROR( "out of dynamic memory in rcsensure_buffer_stack()" );
  1347. memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  1348. yyg->yy_buffer_stack_max = num_to_alloc;
  1349. yyg->yy_buffer_stack_top = 0;
  1350. return;
  1351. }
  1352. if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
  1353. /* Increase the buffer to prepare for a possible push. */
  1354. int grow_size = 8 /* arbitrary grow size */;
  1355. num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
  1356. yyg->yy_buffer_stack = (struct yy_buffer_state**)rcsrealloc
  1357. (yyg->yy_buffer_stack,
  1358. num_to_alloc * sizeof(struct yy_buffer_state*)
  1359. , yyscanner);
  1360. if ( ! yyg->yy_buffer_stack )
  1361. YY_FATAL_ERROR( "out of dynamic memory in rcsensure_buffer_stack()" );
  1362. /* zero only the new slots.*/
  1363. memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
  1364. yyg->yy_buffer_stack_max = num_to_alloc;
  1365. }
  1366. }
  1367. /** Setup the input buffer state to scan directly from a user-specified character buffer.
  1368. * @param base the character buffer
  1369. * @param size the size in bytes of the character buffer
  1370. * @param yyscanner The scanner object.
  1371. * @return the newly allocated buffer state object.
  1372. */
  1373. YY_BUFFER_STATE rcs_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
  1374. {
  1375. YY_BUFFER_STATE b;
  1376. if ( size < 2 ||
  1377. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1378. base[size-1] != YY_END_OF_BUFFER_CHAR )
  1379. /* They forgot to leave room for the EOB's. */
  1380. return 0;
  1381. b = (YY_BUFFER_STATE) rcsalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
  1382. if ( ! b )
  1383. YY_FATAL_ERROR( "out of dynamic memory in rcs_scan_buffer()" );
  1384. b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
  1385. b->yy_buf_pos = b->yy_ch_buf = base;
  1386. b->yy_is_our_buffer = 0;
  1387. b->yy_input_file = 0;
  1388. b->yy_n_chars = b->yy_buf_size;
  1389. b->yy_is_interactive = 0;
  1390. b->yy_at_bol = 1;
  1391. b->yy_fill_buffer = 0;
  1392. b->yy_buffer_status = YY_BUFFER_NEW;
  1393. rcs_switch_to_buffer(b ,yyscanner );
  1394. return b;
  1395. }
  1396. /** Setup the input buffer state to scan a string. The next call to rcslex() will
  1397. * scan from a @e copy of @a str.
  1398. * @param yystr a NUL-terminated string to scan
  1399. * @param yyscanner The scanner object.
  1400. * @return the newly allocated buffer state object.
  1401. * @note If you want to scan bytes that may contain NUL values, then use
  1402. * rcs_scan_bytes() instead.
  1403. */
  1404. YY_BUFFER_STATE rcs_scan_string (yyconst char * yystr , yyscan_t yyscanner)
  1405. {
  1406. return rcs_scan_bytes(yystr,strlen(yystr) ,yyscanner);
  1407. }
  1408. /** Setup the input buffer state to scan the given bytes. The next call to rcslex() will
  1409. * scan from a @e copy of @a bytes.
  1410. * @param bytes the byte buffer to scan
  1411. * @param len the number of bytes in the buffer pointed to by @a bytes.
  1412. * @param yyscanner The scanner object.
  1413. * @return the newly allocated buffer state object.
  1414. */
  1415. YY_BUFFER_STATE rcs_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
  1416. {
  1417. YY_BUFFER_STATE b;
  1418. char *buf;
  1419. yy_size_t n;
  1420. int i;
  1421. /* Get memory for full buffer, including space for trailing EOB's. */
  1422. n = _yybytes_len + 2;
  1423. buf = (char *) rcsalloc(n ,yyscanner );
  1424. if ( ! buf )
  1425. YY_FATAL_ERROR( "out of dynamic memory in rcs_scan_bytes()" );
  1426. for ( i = 0; i < _yybytes_len; ++i )
  1427. buf[i] = yybytes[i];
  1428. buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
  1429. b = rcs_scan_buffer(buf,n ,yyscanner);
  1430. if ( ! b )
  1431. YY_FATAL_ERROR( "bad buffer in rcs_scan_bytes()" );
  1432. /* It's okay to grow etc. this buffer, and we should throw it
  1433. * away when we're done.
  1434. */
  1435. b->yy_is_our_buffer = 1;
  1436. return b;
  1437. }
  1438. #ifndef YY_EXIT_FAILURE
  1439. #define YY_EXIT_FAILURE 2
  1440. #endif
  1441. static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
  1442. {
  1443. (void) fprintf( stderr, "%s\n", msg );
  1444. exit( YY_EXIT_FAILURE );
  1445. }
  1446. /* Redefine yyless() so it works in section 3 code. */
  1447. #undef yyless
  1448. #define yyless(n) \
  1449. do \
  1450. { \
  1451. /* Undo effects of setting up yytext. */ \
  1452. int yyless_macro_arg = (n); \
  1453. YY_LESS_LINENO(yyless_macro_arg);\
  1454. yytext[yyleng] = yyg->yy_hold_char; \
  1455. yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
  1456. yyg->yy_hold_char = *yyg->yy_c_buf_p; \
  1457. *yyg->yy_c_buf_p = '\0'; \
  1458. yyleng = yyless_macro_arg; \
  1459. } \
  1460. while ( 0 )
  1461. /* Accessor methods (get/set functions) to struct members. */
  1462. /** Get the user-defined data for this scanner.
  1463. * @param yyscanner The scanner object.
  1464. */
  1465. YY_EXTRA_TYPE rcsget_extra (yyscan_t yyscanner)
  1466. {
  1467. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1468. return yyextra;
  1469. }
  1470. /** Get the current line number.
  1471. * @param yyscanner The scanner object.
  1472. */
  1473. int rcsget_lineno (yyscan_t yyscanner)
  1474. {
  1475. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1476. if (! YY_CURRENT_BUFFER)
  1477. return 0;
  1478. return yylineno;
  1479. }
  1480. /** Get the current column number.
  1481. * @param yyscanner The scanner object.
  1482. */
  1483. int rcsget_column (yyscan_t yyscanner)
  1484. {
  1485. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1486. if (! YY_CURRENT_BUFFER)
  1487. return 0;
  1488. return yycolumn;
  1489. }
  1490. /** Get the input stream.
  1491. * @param yyscanner The scanner object.
  1492. */
  1493. FILE *rcsget_in (yyscan_t yyscanner)
  1494. {
  1495. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1496. return yyin;
  1497. }
  1498. /** Get the output stream.
  1499. * @param yyscanner The scanner object.
  1500. */
  1501. FILE *rcsget_out (yyscan_t yyscanner)
  1502. {
  1503. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1504. return yyout;
  1505. }
  1506. /** Get the length of the current token.
  1507. * @param yyscanner The scanner object.
  1508. */
  1509. int rcsget_leng (yyscan_t yyscanner)
  1510. {
  1511. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1512. return yyleng;
  1513. }
  1514. /** Get the current token.
  1515. * @param yyscanner The scanner object.
  1516. */
  1517. char *rcsget_text (yyscan_t yyscanner)
  1518. {
  1519. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1520. return yytext;
  1521. }
  1522. /** Set the user-defined data. This data is never touched by the scanner.
  1523. * @param user_defined The data to be associated with this scanner.
  1524. * @param yyscanner The scanner object.
  1525. */
  1526. void rcsset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
  1527. {
  1528. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1529. yyextra = user_defined ;
  1530. }
  1531. /** Set the current line number.
  1532. * @param line_number
  1533. * @param yyscanner The scanner object.
  1534. */
  1535. void rcsset_lineno (int line_number , yyscan_t yyscanner)
  1536. {
  1537. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1538. /* lineno is only valid if an input buffer exists. */
  1539. if (! YY_CURRENT_BUFFER )
  1540. yy_fatal_error( "rcsset_lineno called with no buffer" , yyscanner);
  1541. yylineno = line_number;
  1542. }
  1543. /** Set the current column.
  1544. * @param line_number
  1545. * @param yyscanner The scanner object.
  1546. */
  1547. void rcsset_column (int column_no , yyscan_t yyscanner)
  1548. {
  1549. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1550. /* column is only valid if an input buffer exists. */
  1551. if (! YY_CURRENT_BUFFER )
  1552. yy_fatal_error( "rcsset_column called with no buffer" , yyscanner);
  1553. yycolumn = column_no;
  1554. }
  1555. /** Set the input stream. This does not discard the current
  1556. * input buffer.
  1557. * @param in_str A readable stream.
  1558. * @param yyscanner The scanner object.
  1559. * @see rcs_switch_to_buffer
  1560. */
  1561. void rcsset_in (FILE * in_str , yyscan_t yyscanner)
  1562. {
  1563. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1564. yyin = in_str ;
  1565. }
  1566. void rcsset_out (FILE * out_str , yyscan_t yyscanner)
  1567. {
  1568. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1569. yyout = out_str ;
  1570. }
  1571. int rcsget_debug (yyscan_t yyscanner)
  1572. {
  1573. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1574. return yy_flex_debug;
  1575. }
  1576. void rcsset_debug (int bdebug , yyscan_t yyscanner)
  1577. {
  1578. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1579. yy_flex_debug = bdebug ;
  1580. }
  1581. /* Accessor methods for yylval and yylloc */
  1582. /* User-visible API */
  1583. /* rcslex_init is special because it creates the scanner itself, so it is
  1584. * the ONLY reentrant function that doesn't take the scanner as the last argument.
  1585. * That's why we explicitly handle the declaration, instead of using our macros.
  1586. */
  1587. int rcslex_init(yyscan_t* ptr_yy_globals)
  1588. {
  1589. if (ptr_yy_globals == NULL){
  1590. errno = EINVAL;
  1591. return 1;
  1592. }
  1593. *ptr_yy_globals = (yyscan_t) rcsalloc ( sizeof( struct yyguts_t ), NULL );
  1594. if (*ptr_yy_globals == NULL){
  1595. errno = ENOMEM;
  1596. return 1;
  1597. }
  1598. /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
  1599. memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  1600. return yy_init_globals ( *ptr_yy_globals );
  1601. }
  1602. /* rcslex_init_extra has the same functionality as rcslex_init, but follows the
  1603. * convention of taking the scanner as the last argument. Note however, that
  1604. * this is a *pointer* to a scanner, as it will be allocated by this call (and
  1605. * is the reason, too, why this function also must handle its own declaration).
  1606. * The user defined value in the first argument will be available to rcsalloc in
  1607. * the yyextra field.
  1608. */
  1609. int rcslex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
  1610. {
  1611. struct yyguts_t dummy_yyguts;
  1612. rcsset_extra (yy_user_defined, &dummy_yyguts);
  1613. if (ptr_yy_globals == NULL){
  1614. errno = EINVAL;
  1615. return 1;
  1616. }
  1617. *ptr_yy_globals = (yyscan_t) rcsalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
  1618. if (*ptr_yy_globals == NULL){
  1619. errno = ENOMEM;
  1620. return 1;
  1621. }
  1622. /* By setting to 0xAA, we expose bugs in
  1623. yy_init_globals. Leave at 0x00 for releases. */
  1624. memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  1625. rcsset_extra (yy_user_defined, *ptr_yy_globals);
  1626. return yy_init_globals ( *ptr_yy_globals );
  1627. }
  1628. static int yy_init_globals (yyscan_t yyscanner)
  1629. {
  1630. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1631. /* Initialization is the same as for the non-reentrant scanner.
  1632. * This function is called from rcslex_destroy(), so don't allocate here.
  1633. */
  1634. yyg->yy_buffer_stack = 0;
  1635. yyg->yy_buffer_stack_top = 0;
  1636. yyg->yy_buffer_stack_max = 0;
  1637. yyg->yy_c_buf_p = (char *) 0;
  1638. yyg->yy_init = 0;
  1639. yyg->yy_start = 0;
  1640. yyg->yy_start_stack_ptr = 0;
  1641. yyg->yy_start_stack_depth = 0;
  1642. yyg->yy_start_stack = NULL;
  1643. /* Defined in main.c */
  1644. #ifdef YY_STDINIT
  1645. yyin = stdin;
  1646. yyout = stdout;
  1647. #else
  1648. yyin = (FILE *) 0;
  1649. yyout = (FILE *) 0;
  1650. #endif
  1651. /* For future reference: Set errno on error, since we are called by
  1652. * rcslex_init()
  1653. */
  1654. return 0;
  1655. }
  1656. /* rcslex_destroy is for both reentrant and non-reentrant scanners. */
  1657. int rcslex_destroy (yyscan_t yyscanner)
  1658. {
  1659. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1660. /* Pop the buffer stack, destroying each element. */
  1661. while(YY_CURRENT_BUFFER){
  1662. rcs_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
  1663. YY_CURRENT_BUFFER_LVALUE = NULL;
  1664. rcspop_buffer_state(yyscanner);
  1665. }
  1666. /* Destroy the stack itself. */
  1667. rcsfree(yyg->yy_buffer_stack ,yyscanner);
  1668. yyg->yy_buffer_stack = NULL;
  1669. /* Destroy the start condition stack. */
  1670. rcsfree(yyg->yy_start_stack ,yyscanner );
  1671. yyg->yy_start_stack = NULL;
  1672. /* Reset the globals. This is important in a non-reentrant scanner so the next time
  1673. * rcslex() is called, initialization will occur. */
  1674. yy_init_globals( yyscanner);
  1675. /* Destroy the main struct (reentrant only). */
  1676. rcsfree ( yyscanner , yyscanner );
  1677. yyscanner = NULL;
  1678. return 0;
  1679. }
  1680. /*
  1681. * Internal utility routines.
  1682. */
  1683. #ifndef yytext_ptr
  1684. static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
  1685. {
  1686. register int i;
  1687. for ( i = 0; i < n; ++i )
  1688. s1[i] = s2[i];
  1689. }
  1690. #endif
  1691. #ifdef YY_NEED_STRLEN
  1692. static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
  1693. {
  1694. register int n;
  1695. for ( n = 0; s[n]; ++n )
  1696. ;
  1697. return n;
  1698. }
  1699. #endif
  1700. void *rcsalloc (yy_size_t size , yyscan_t yyscanner)
  1701. {
  1702. return (void *) malloc( size );
  1703. }
  1704. void *rcsrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
  1705. {
  1706. /* The cast to (char *) in the following accommodates both
  1707. * implementations that use char* generic pointers, and those
  1708. * that use void* generic pointers. It works with the latter
  1709. * because both ANSI C and C++ allow castless assignment from
  1710. * any pointer type to void*, and deal with argument conversions
  1711. * as though doing an assignment.
  1712. */
  1713. return (void *) realloc( (char *) ptr, size );
  1714. }
  1715. void rcsfree (void * ptr , yyscan_t yyscanner)
  1716. {
  1717. free( (char *) ptr ); /* see rcsrealloc() for (char *) cast */
  1718. }
  1719. #define YYTABLES_NAME "yytables"
  1720. #line 73 "rcstokenizer.l"