The Sol Programming Language!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2303 lines
57 KiB

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