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.

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