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.

2357 lines
59 KiB

  1. #line 2 "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 4
  8. #if YY_FLEX_SUBMINOR_VERSION > 0
  9. #define FLEX_BETA
  10. #endif
  11. #ifdef yyget_lval
  12. #define yyget_lval_ALREADY_DEFINED
  13. #else
  14. #define yyget_lval yyget_lval
  15. #endif
  16. #ifdef yyset_lval
  17. #define yyset_lval_ALREADY_DEFINED
  18. #else
  19. #define yyset_lval yyset_lval
  20. #endif
  21. #ifdef yyget_lloc
  22. #define yyget_lloc_ALREADY_DEFINED
  23. #else
  24. #define yyget_lloc yyget_lloc
  25. #endif
  26. #ifdef yyset_lloc
  27. #define yyset_lloc_ALREADY_DEFINED
  28. #else
  29. #define yyset_lloc yyset_lloc
  30. #endif
  31. /* First, we deal with platform-specific or compiler-specific issues. */
  32. /* begin standard C headers. */
  33. #include <stdio.h>
  34. #include <string.h>
  35. #include <errno.h>
  36. #include <stdlib.h>
  37. /* end standard C headers. */
  38. /* flex integer type definitions */
  39. #ifndef FLEXINT_H
  40. #define FLEXINT_H
  41. /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
  42. #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  43. /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
  44. * if you want the limit (max/min) macros for int types.
  45. */
  46. #ifndef __STDC_LIMIT_MACROS
  47. #define __STDC_LIMIT_MACROS 1
  48. #endif
  49. #include <inttypes.h>
  50. typedef int8_t flex_int8_t;
  51. typedef uint8_t flex_uint8_t;
  52. typedef int16_t flex_int16_t;
  53. typedef uint16_t flex_uint16_t;
  54. typedef int32_t flex_int32_t;
  55. typedef uint32_t flex_uint32_t;
  56. #else
  57. typedef signed char flex_int8_t;
  58. typedef short int flex_int16_t;
  59. typedef int flex_int32_t;
  60. typedef unsigned char flex_uint8_t;
  61. typedef unsigned short int flex_uint16_t;
  62. typedef unsigned int flex_uint32_t;
  63. /* Limits of integral types. */
  64. #ifndef INT8_MIN
  65. #define INT8_MIN (-128)
  66. #endif
  67. #ifndef INT16_MIN
  68. #define INT16_MIN (-32767-1)
  69. #endif
  70. #ifndef INT32_MIN
  71. #define INT32_MIN (-2147483647-1)
  72. #endif
  73. #ifndef INT8_MAX
  74. #define INT8_MAX (127)
  75. #endif
  76. #ifndef INT16_MAX
  77. #define INT16_MAX (32767)
  78. #endif
  79. #ifndef INT32_MAX
  80. #define INT32_MAX (2147483647)
  81. #endif
  82. #ifndef UINT8_MAX
  83. #define UINT8_MAX (255U)
  84. #endif
  85. #ifndef UINT16_MAX
  86. #define UINT16_MAX (65535U)
  87. #endif
  88. #ifndef UINT32_MAX
  89. #define UINT32_MAX (4294967295U)
  90. #endif
  91. #ifndef SIZE_MAX
  92. #define SIZE_MAX (~(size_t)0)
  93. #endif
  94. #endif /* ! C99 */
  95. #endif /* ! FLEXINT_H */
  96. /* begin standard C++ headers. */
  97. /* TODO: this is always defined, so inline it */
  98. #define yyconst const
  99. #if defined(__GNUC__) && __GNUC__ >= 3
  100. #define yynoreturn __attribute__((__noreturn__))
  101. #else
  102. #define yynoreturn
  103. #endif
  104. /* Returned upon end-of-file. */
  105. #define YY_NULL 0
  106. /* Promotes a possibly negative, possibly signed char to an
  107. * integer in range [0..255] for use as an array index.
  108. */
  109. #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
  110. /* Enter a start condition. This macro really ought to take a parameter,
  111. * but we do it the disgusting crufty way forced on us by the ()-less
  112. * definition of BEGIN.
  113. */
  114. #define BEGIN (yy_start) = 1 + 2 *
  115. /* Translate the current start state into a value that can be later handed
  116. * to BEGIN to return to the state. The YYSTATE alias is for lex
  117. * compatibility.
  118. */
  119. #define YY_START (((yy_start) - 1) / 2)
  120. #define YYSTATE YY_START
  121. /* Action number for EOF rule of a given start state. */
  122. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  123. /* Special action meaning "start processing a new file". */
  124. #define YY_NEW_FILE yyrestart( yyin )
  125. #define YY_END_OF_BUFFER_CHAR 0
  126. /* Size of default input buffer. */
  127. #ifndef YY_BUF_SIZE
  128. #ifdef __ia64__
  129. /* On IA-64, the buffer size is 16k, not 8k.
  130. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
  131. * Ditto for the __ia64__ case accordingly.
  132. */
  133. #define YY_BUF_SIZE 32768
  134. #else
  135. #define YY_BUF_SIZE 16384
  136. #endif /* __ia64__ */
  137. #endif
  138. /* The state buf must be large enough to hold one state per character in the main buffer.
  139. */
  140. #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
  141. #ifndef YY_TYPEDEF_YY_BUFFER_STATE
  142. #define YY_TYPEDEF_YY_BUFFER_STATE
  143. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  144. #endif
  145. #ifndef YY_TYPEDEF_YY_SIZE_T
  146. #define YY_TYPEDEF_YY_SIZE_T
  147. typedef size_t yy_size_t;
  148. #endif
  149. extern int yyleng;
  150. extern FILE *yyin, *yyout;
  151. #define EOB_ACT_CONTINUE_SCAN 0
  152. #define EOB_ACT_END_OF_FILE 1
  153. #define EOB_ACT_LAST_MATCH 2
  154. #define YY_LESS_LINENO(n)
  155. #define YY_LINENO_REWIND_TO(ptr)
  156. /* Return all but the first "n" matched characters back to the input stream. */
  157. #define yyless(n) \
  158. do \
  159. { \
  160. /* Undo effects of setting up yytext. */ \
  161. int yyless_macro_arg = (n); \
  162. YY_LESS_LINENO(yyless_macro_arg);\
  163. *yy_cp = (yy_hold_char); \
  164. YY_RESTORE_YY_MORE_OFFSET \
  165. (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  166. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  167. } \
  168. while ( 0 )
  169. #define unput(c) yyunput( c, (yytext_ptr) )
  170. #ifndef YY_STRUCT_YY_BUFFER_STATE
  171. #define YY_STRUCT_YY_BUFFER_STATE
  172. struct yy_buffer_state
  173. {
  174. FILE *yy_input_file;
  175. char *yy_ch_buf; /* input buffer */
  176. char *yy_buf_pos; /* current position in input buffer */
  177. /* Size of input buffer in bytes, not including room for EOB
  178. * characters.
  179. */
  180. int yy_buf_size;
  181. /* Number of characters read into yy_ch_buf, not including EOB
  182. * characters.
  183. */
  184. int yy_n_chars;
  185. /* Whether we "own" the buffer - i.e., we know we created it,
  186. * and can realloc() it to grow it, and should free() it to
  187. * delete it.
  188. */
  189. int yy_is_our_buffer;
  190. /* Whether this is an "interactive" input source; if so, and
  191. * if we're using stdio for input, then we want to use getc()
  192. * instead of fread(), to make sure we stop fetching input after
  193. * each newline.
  194. */
  195. int yy_is_interactive;
  196. /* Whether we're considered to be at the beginning of a line.
  197. * If so, '^' rules will be active on the next match, otherwise
  198. * not.
  199. */
  200. int yy_at_bol;
  201. int yy_bs_lineno; /**< The line count. */
  202. int yy_bs_column; /**< The column count. */
  203. /* Whether to try to fill the input buffer when we reach the
  204. * end of it.
  205. */
  206. int yy_fill_buffer;
  207. int yy_buffer_status;
  208. #define YY_BUFFER_NEW 0
  209. #define YY_BUFFER_NORMAL 1
  210. /* When an EOF's been seen but there's still some text to process
  211. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  212. * shouldn't try reading from the input source any more. We might
  213. * still have a bunch of tokens to match, though, because of
  214. * possible backing-up.
  215. *
  216. * When we actually see the EOF, we change the status to "new"
  217. * (via yyrestart()), so that the user can continue scanning by
  218. * just pointing yyin at a new input file.
  219. */
  220. #define YY_BUFFER_EOF_PENDING 2
  221. };
  222. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  223. /* Stack of input buffers. */
  224. static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
  225. static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
  226. static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
  227. /* We provide macros for accessing buffer states in case in the
  228. * future we want to put the buffer states in a more general
  229. * "scanner state".
  230. *
  231. * Returns the top of the stack, or NULL.
  232. */
  233. #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
  234. ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
  235. : NULL)
  236. /* Same as previous macro, but useful when we know that the buffer stack is not
  237. * NULL or when we need an lvalue. For internal use only.
  238. */
  239. #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
  240. /* yy_hold_char holds the character lost when yytext is formed. */
  241. static char yy_hold_char;
  242. static int yy_n_chars; /* number of characters read into yy_ch_buf */
  243. int yyleng;
  244. /* Points to current character in buffer. */
  245. static char *yy_c_buf_p = NULL;
  246. static int yy_init = 0; /* whether we need to initialize */
  247. static int yy_start = 0; /* start state number */
  248. /* Flag which is used to allow yywrap()'s to do buffer switches
  249. * instead of setting up a fresh yyin. A bit of a hack ...
  250. */
  251. static int yy_did_buffer_switch_on_eof;
  252. void yyrestart ( FILE *input_file );
  253. void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
  254. YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
  255. void yy_delete_buffer ( YY_BUFFER_STATE b );
  256. void yy_flush_buffer ( YY_BUFFER_STATE b );
  257. void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
  258. void yypop_buffer_state ( void );
  259. static void yyensure_buffer_stack ( void );
  260. static void yy_load_buffer_state ( void );
  261. static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
  262. #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
  263. YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
  264. YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
  265. YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
  266. void *yyalloc ( yy_size_t );
  267. void *yyrealloc ( void *, yy_size_t );
  268. void yyfree ( void * );
  269. #define yy_new_buffer yy_create_buffer
  270. #define yy_set_interactive(is_interactive) \
  271. { \
  272. if ( ! YY_CURRENT_BUFFER ){ \
  273. yyensure_buffer_stack (); \
  274. YY_CURRENT_BUFFER_LVALUE = \
  275. yy_create_buffer( yyin, YY_BUF_SIZE ); \
  276. } \
  277. YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  278. }
  279. #define yy_set_bol(at_bol) \
  280. { \
  281. if ( ! YY_CURRENT_BUFFER ){\
  282. yyensure_buffer_stack (); \
  283. YY_CURRENT_BUFFER_LVALUE = \
  284. yy_create_buffer( yyin, YY_BUF_SIZE ); \
  285. } \
  286. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  287. }
  288. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  289. /* Begin user sect3 */
  290. typedef flex_uint8_t YY_CHAR;
  291. FILE *yyin = NULL, *yyout = NULL;
  292. typedef int yy_state_type;
  293. extern int yylineno;
  294. int yylineno = 1;
  295. extern char *yytext;
  296. #ifdef yytext_ptr
  297. #undef yytext_ptr
  298. #endif
  299. #define yytext_ptr yytext
  300. static yy_state_type yy_get_previous_state ( void );
  301. static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
  302. static int yy_get_next_buffer ( void );
  303. static void yynoreturn yy_fatal_error ( const char* msg );
  304. /* Done after the current pattern has been matched and before the
  305. * corresponding action - sets up yytext.
  306. */
  307. #define YY_DO_BEFORE_ACTION \
  308. (yytext_ptr) = yy_bp; \
  309. yyleng = (int) (yy_cp - yy_bp); \
  310. (yy_hold_char) = *yy_cp; \
  311. *yy_cp = '\0'; \
  312. (yy_c_buf_p) = yy_cp;
  313. #define YY_NUM_RULES 74
  314. #define YY_END_OF_BUFFER 75
  315. /* This struct is not used in this scanner,
  316. but its presence is necessary. */
  317. struct yy_trans_info
  318. {
  319. flex_int32_t yy_verify;
  320. flex_int32_t yy_nxt;
  321. };
  322. static const flex_int16_t yy_accept[154] =
  323. { 0,
  324. 0, 0, 75, 74, 73, 35, 74, 69, 24, 27,
  325. 74, 63, 64, 22, 20, 68, 21, 65, 23, 2,
  326. 66, 67, 52, 41, 53, 71, 71, 71, 71, 60,
  327. 61, 29, 71, 71, 71, 71, 71, 71, 71, 71,
  328. 71, 71, 71, 71, 71, 71, 58, 28, 59, 30,
  329. 73, 62, 73, 0, 51, 0, 3, 31, 47, 0,
  330. 4, 26, 44, 42, 0, 43, 45, 1, 2, 57,
  331. 54, 50, 55, 56, 71, 71, 71, 71, 49, 71,
  332. 71, 71, 12, 71, 71, 71, 71, 71, 5, 11,
  333. 71, 71, 71, 34, 71, 71, 71, 71, 48, 33,
  334. 73, 62, 70, 46, 0, 72, 1, 71, 71, 71,
  335. 32, 71, 71, 71, 18, 71, 10, 71, 71, 25,
  336. 36, 71, 71, 71, 71, 71, 19, 38, 71, 71,
  337. 7, 71, 13, 71, 71, 6, 37, 71, 40, 16,
  338. 71, 71, 39, 71, 71, 9, 71, 8, 14, 15,
  339. 71, 17, 0
  340. } ;
  341. static const YY_CHAR yy_ec[256] =
  342. { 0,
  343. 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
  344. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  345. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  346. 1, 2, 4, 5, 6, 1, 7, 8, 9, 10,
  347. 11, 12, 13, 14, 15, 16, 17, 18, 18, 18,
  348. 18, 18, 18, 18, 18, 18, 18, 19, 20, 21,
  349. 22, 23, 1, 1, 24, 24, 24, 24, 24, 25,
  350. 24, 24, 24, 24, 24, 24, 24, 26, 24, 24,
  351. 24, 24, 24, 27, 24, 24, 24, 24, 24, 24,
  352. 28, 1, 29, 30, 24, 1, 31, 32, 33, 34,
  353. 35, 36, 24, 37, 38, 24, 39, 40, 41, 42,
  354. 43, 24, 24, 44, 45, 46, 47, 24, 48, 24,
  355. 24, 24, 49, 50, 51, 52, 1, 1, 1, 1,
  356. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  357. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  358. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  359. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  360. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  361. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  362. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  363. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  364. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  365. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  366. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  367. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  368. 1, 1, 1, 1, 1
  369. } ;
  370. static const YY_CHAR yy_meta[53] =
  371. { 0,
  372. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  373. 1, 1, 1, 1, 1, 1, 1, 2, 1, 1,
  374. 1, 1, 1, 2, 2, 2, 2, 1, 1, 1,
  375. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  376. 2, 2, 2, 2, 2, 2, 2, 2, 1, 1,
  377. 1, 1
  378. } ;
  379. static const flex_int16_t yy_base[158] =
  380. { 0,
  381. 0, 51, 171, 172, 52, 52, 165, 172, 172, 49,
  382. 160, 172, 172, 46, 146, 172, 44, 172, 145, 44,
  383. 172, 172, 42, 144, 47, 0, 134, 121, 119, 172,
  384. 172, 140, 119, 116, 116, 115, 25, 41, 37, 126,
  385. 113, 112, 110, 118, 38, 115, 172, 54, 172, 172,
  386. 75, 172, 78, 147, 172, 145, 172, 172, 172, 140,
  387. 172, 126, 172, 172, 144, 172, 172, 128, 71, 172,
  388. 172, 172, 172, 172, 0, 105, 102, 96, 172, 108,
  389. 106, 98, 0, 94, 104, 97, 92, 93, 0, 0,
  390. 93, 99, 86, 0, 85, 95, 82, 90, 172, 172,
  391. 88, 172, 172, 172, 124, 172, 108, 80, 89, 88,
  392. 0, 91, 75, 85, 0, 74, 0, 85, 85, 0,
  393. 0, 69, 73, 79, 73, 77, 0, 0, 72, 65,
  394. 64, 66, 0, 66, 55, 0, 0, 62, 0, 0,
  395. 54, 59, 0, 63, 51, 0, 45, 0, 0, 0,
  396. 51, 0, 172, 104, 106, 81, 108
  397. } ;
  398. static const flex_int16_t yy_def[158] =
  399. { 0,
  400. 153, 1, 153, 153, 153, 153, 154, 153, 153, 153,
  401. 155, 153, 153, 153, 153, 153, 153, 153, 153, 153,
  402. 153, 153, 153, 153, 153, 156, 156, 156, 156, 153,
  403. 153, 153, 156, 156, 156, 156, 156, 156, 156, 156,
  404. 156, 156, 156, 156, 156, 156, 153, 153, 153, 153,
  405. 153, 153, 153, 153, 153, 154, 153, 153, 153, 155,
  406. 153, 153, 153, 153, 157, 153, 153, 153, 153, 153,
  407. 153, 153, 153, 153, 156, 156, 156, 156, 153, 156,
  408. 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
  409. 156, 156, 156, 156, 156, 156, 156, 156, 153, 153,
  410. 153, 153, 153, 153, 157, 153, 153, 156, 156, 156,
  411. 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
  412. 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
  413. 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
  414. 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
  415. 156, 156, 0, 153, 153, 153, 153
  416. } ;
  417. static const flex_int16_t yy_nxt[225] =
  418. { 0,
  419. 4, 5, 5, 6, 7, 8, 9, 10, 11, 12,
  420. 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
  421. 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
  422. 33, 34, 35, 36, 37, 38, 26, 39, 26, 40,
  423. 41, 42, 43, 44, 26, 45, 26, 46, 47, 48,
  424. 49, 50, 51, 53, 53, 54, 58, 62, 65, 68,
  425. 52, 69, 70, 71, 84, 66, 85, 63, 73, 74,
  426. 59, 86, 89, 55, 96, 99, 101, 53, 90, 53,
  427. 53, 97, 75, 87, 102, 152, 68, 88, 69, 101,
  428. 53, 151, 150, 149, 148, 147, 146, 102, 145, 144,
  429. 143, 142, 141, 100, 56, 56, 60, 60, 105, 105,
  430. 140, 139, 138, 137, 136, 135, 134, 133, 132, 131,
  431. 130, 129, 128, 127, 126, 107, 106, 125, 124, 123,
  432. 122, 121, 120, 119, 118, 117, 116, 115, 114, 113,
  433. 112, 111, 110, 109, 108, 107, 106, 104, 61, 57,
  434. 103, 98, 95, 94, 93, 92, 91, 83, 82, 81,
  435. 80, 79, 78, 77, 76, 72, 67, 64, 61, 57,
  436. 153, 3, 153, 153, 153, 153, 153, 153, 153, 153,
  437. 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
  438. 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
  439. 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
  440. 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
  441. 153, 153, 153, 153
  442. } ;
  443. static const flex_int16_t yy_chk[225] =
  444. { 0,
  445. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  446. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  447. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  448. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  449. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  450. 1, 1, 2, 5, 5, 6, 10, 14, 17, 20,
  451. 2, 20, 23, 23, 37, 17, 37, 14, 25, 25,
  452. 10, 38, 39, 6, 45, 48, 51, 51, 39, 53,
  453. 53, 45, 156, 38, 51, 151, 69, 38, 69, 101,
  454. 101, 147, 145, 144, 142, 141, 138, 101, 135, 134,
  455. 132, 131, 130, 48, 154, 154, 155, 155, 157, 157,
  456. 129, 126, 125, 124, 123, 122, 119, 118, 116, 114,
  457. 113, 112, 110, 109, 108, 107, 105, 98, 97, 96,
  458. 95, 93, 92, 91, 88, 87, 86, 85, 84, 82,
  459. 81, 80, 78, 77, 76, 68, 65, 62, 60, 56,
  460. 54, 46, 44, 43, 42, 41, 40, 36, 35, 34,
  461. 33, 32, 29, 28, 27, 24, 19, 15, 11, 7,
  462. 3, 153, 153, 153, 153, 153, 153, 153, 153, 153,
  463. 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
  464. 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
  465. 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
  466. 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
  467. 153, 153, 153, 153
  468. } ;
  469. static yy_state_type yy_last_accepting_state;
  470. static char *yy_last_accepting_cpos;
  471. extern int yy_flex_debug;
  472. int yy_flex_debug = 0;
  473. /* The intent behind this definition is that it'll catch
  474. * any uses of REJECT which flex missed.
  475. */
  476. #define REJECT reject_used_but_not_detected
  477. #define yymore() yymore_used_but_not_detected
  478. #define YY_MORE_ADJ 0
  479. #define YY_RESTORE_YY_MORE_OFFSET
  480. char *yytext;
  481. #line 1 "tokenizer.lex"
  482. #line 2 "tokenizer.lex"
  483. #define YYSTYPE void *
  484. #include "ast.h"
  485. #include "parser.tab.h"
  486. #include <stdlib.h>
  487. #include <string.h>
  488. #include <stdio.h>
  489. void yyerror(YYLTYPE *, stmt_node **, char *);
  490. int yywrap(void);
  491. char *str, *curptr;
  492. int cursz, chars;
  493. #define SZMUL 128
  494. void str_init(void) {
  495. str = malloc(SZMUL);
  496. curptr = str;
  497. cursz = SZMUL;
  498. chars = 0;
  499. }
  500. void str_putc(char c) {
  501. *curptr++ = c;
  502. chars++;
  503. if(chars >= cursz) {
  504. str = realloc(str, cursz + SZMUL);
  505. curptr = str + chars;
  506. cursz += SZMUL;
  507. }
  508. }
  509. /* http://stackoverflow.com/questions/656703/how-does-flex-support-bison-location-exactly */
  510. /* Many thanks to hugomg and David Elson! */
  511. static void update_loc(YYLTYPE *yylloc, char *yytext){
  512. int curr_line;
  513. int curr_col;
  514. curr_line = yylloc->first_line = yylloc->last_line;
  515. curr_col = yylloc->first_column = yylloc->last_column;
  516. {char * s; for(s = yytext; *s != '\0'; s++){
  517. if(*s == '\n'){
  518. curr_line++;
  519. curr_col = 1;
  520. }else{
  521. curr_col++;
  522. }
  523. }}
  524. yylloc->last_line = curr_line;
  525. yylloc->last_column = curr_col-1;
  526. }
  527. #define YY_USER_ACTION update_loc(yylloc, yytext);
  528. #line 624 "lex.yy.c"
  529. /* This is the right way to do it, but it keeps generating token $undefined.
  530. %x STRING
  531. \" { str_init(); BEGIN STRING; }
  532. <STRING>\\n { str_putc('\n'); }
  533. <STRING>\\t { str_putc('\t'); }
  534. <STRING>\\b { str_putc('\b'); }
  535. <STRING>\\r { str_putc('\r'); }
  536. <STRING>\\x{HEXDIGIT}{HEXDIGIT} { str_putc(strtol(yytext+2, NULL, 16)); }
  537. <STRING>\\\" { str_putc('"'); }
  538. <STRING>\" { str_putc('\0'); yylval = str; BEGIN 0; return STRING; }
  539. <STRING>. { str_putc(*yytext); }
  540. */
  541. #line 640 "lex.yy.c"
  542. #define INITIAL 0
  543. #ifndef YY_NO_UNISTD_H
  544. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  545. * down here because we want the user's section 1 to have been scanned first.
  546. * The user has a chance to override it with an option.
  547. */
  548. #include <unistd.h>
  549. #endif
  550. #ifndef YY_EXTRA_TYPE
  551. #define YY_EXTRA_TYPE void *
  552. #endif
  553. static int yy_init_globals ( void );
  554. /* Accessor methods to globals.
  555. These are made visible to non-reentrant scanners for convenience. */
  556. int yylex_destroy ( void );
  557. int yyget_debug ( void );
  558. void yyset_debug ( int debug_flag );
  559. YY_EXTRA_TYPE yyget_extra ( void );
  560. void yyset_extra ( YY_EXTRA_TYPE user_defined );
  561. FILE *yyget_in ( void );
  562. void yyset_in ( FILE * _in_str );
  563. FILE *yyget_out ( void );
  564. void yyset_out ( FILE * _out_str );
  565. int yyget_leng ( void );
  566. char *yyget_text ( void );
  567. int yyget_lineno ( void );
  568. void yyset_lineno ( int _line_number );
  569. YYSTYPE * yyget_lval ( void );
  570. void yyset_lval ( YYSTYPE * yylval_param );
  571. YYLTYPE *yyget_lloc ( void );
  572. void yyset_lloc ( YYLTYPE * yylloc_param );
  573. /* Macros after this point can all be overridden by user definitions in
  574. * section 1.
  575. */
  576. #ifndef YY_SKIP_YYWRAP
  577. #ifdef __cplusplus
  578. extern "C" int yywrap ( void );
  579. #else
  580. extern int yywrap ( void );
  581. #endif
  582. #endif
  583. #ifndef YY_NO_UNPUT
  584. static void yyunput ( int c, char *buf_ptr );
  585. #endif
  586. #ifndef yytext_ptr
  587. static void yy_flex_strncpy ( char *, const char *, int );
  588. #endif
  589. #ifdef YY_NEED_STRLEN
  590. static int yy_flex_strlen ( const char * );
  591. #endif
  592. #ifndef YY_NO_INPUT
  593. #ifdef __cplusplus
  594. static int yyinput ( void );
  595. #else
  596. static int input ( void );
  597. #endif
  598. #endif
  599. /* Amount of stuff to slurp up with each read. */
  600. #ifndef YY_READ_BUF_SIZE
  601. #ifdef __ia64__
  602. /* On IA-64, the buffer size is 16k, not 8k */
  603. #define YY_READ_BUF_SIZE 16384
  604. #else
  605. #define YY_READ_BUF_SIZE 8192
  606. #endif /* __ia64__ */
  607. #endif
  608. /* Copy whatever the last rule matched to the standard output. */
  609. #ifndef ECHO
  610. /* This used to be an fputs(), but since the string might contain NUL's,
  611. * we now use fwrite().
  612. */
  613. #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
  614. #endif
  615. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  616. * is returned in "result".
  617. */
  618. #ifndef YY_INPUT
  619. #define YY_INPUT(buf,result,max_size) \
  620. if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  621. { \
  622. int c = '*'; \
  623. int n; \
  624. for ( n = 0; n < max_size && \
  625. (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  626. buf[n] = (char) c; \
  627. if ( c == '\n' ) \
  628. buf[n++] = (char) c; \
  629. if ( c == EOF && ferror( yyin ) ) \
  630. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  631. result = n; \
  632. } \
  633. else \
  634. { \
  635. errno=0; \
  636. while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
  637. { \
  638. if( errno != EINTR) \
  639. { \
  640. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  641. break; \
  642. } \
  643. errno=0; \
  644. clearerr(yyin); \
  645. } \
  646. }\