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.

2451 lines
61 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 75
  314. #define YY_END_OF_BUFFER 76
  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[158] =
  323. { 0,
  324. 0, 0, 76, 75, 74, 36, 75, 70, 25, 28,
  325. 75, 64, 65, 23, 21, 69, 22, 66, 24, 2,
  326. 67, 68, 53, 42, 54, 72, 72, 72, 72, 61,
  327. 62, 30, 72, 72, 72, 72, 72, 72, 72, 72,
  328. 72, 72, 72, 72, 72, 72, 59, 29, 60, 31,
  329. 74, 63, 74, 0, 52, 0, 3, 32, 48, 0,
  330. 4, 27, 45, 43, 0, 44, 46, 1, 2, 58,
  331. 55, 51, 56, 57, 72, 72, 72, 72, 50, 72,
  332. 72, 72, 12, 72, 72, 72, 72, 72, 5, 11,
  333. 72, 72, 72, 72, 35, 72, 72, 72, 72, 49,
  334. 34, 74, 63, 71, 47, 0, 73, 1, 72, 72,
  335. 72, 33, 72, 72, 72, 19, 72, 10, 72, 72,
  336. 72, 26, 37, 72, 72, 72, 72, 72, 20, 39,
  337. 72, 72, 7, 72, 13, 72, 72, 72, 6, 38,
  338. 72, 41, 17, 72, 72, 40, 72, 14, 72, 9,
  339. 72, 8, 15, 16, 72, 18, 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[162] =
  380. { 0,
  381. 0, 51, 175, 176, 52, 52, 169, 176, 176, 49,
  382. 164, 176, 176, 46, 150, 176, 44, 176, 149, 44,
  383. 176, 176, 42, 148, 47, 0, 138, 125, 123, 176,
  384. 176, 144, 123, 120, 120, 119, 25, 41, 37, 130,
  385. 44, 117, 115, 123, 39, 120, 176, 55, 176, 176,
  386. 79, 176, 83, 152, 176, 150, 176, 176, 176, 145,
  387. 176, 131, 176, 176, 149, 176, 176, 133, 62, 176,
  388. 176, 176, 176, 176, 0, 110, 107, 101, 176, 113,
  389. 111, 103, 0, 99, 109, 102, 97, 98, 0, 0,
  390. 98, 105, 103, 90, 0, 89, 99, 86, 94, 176,
  391. 176, 88, 176, 176, 176, 128, 176, 112, 84, 93,
  392. 92, 0, 95, 79, 89, 0, 78, 0, 89, 89,
  393. 76, 0, 0, 72, 76, 82, 76, 80, 0, 0,
  394. 75, 75, 74, 69, 0, 69, 59, 57, 0, 0,
  395. 65, 0, 0, 57, 61, 0, 65, 0, 53, 0,
  396. 47, 0, 0, 0, 58, 0, 176, 105, 107, 90,
  397. 109
  398. } ;
  399. static const flex_int16_t yy_def[162] =
  400. { 0,
  401. 157, 1, 157, 157, 157, 157, 158, 157, 157, 157,
  402. 159, 157, 157, 157, 157, 157, 157, 157, 157, 157,
  403. 157, 157, 157, 157, 157, 160, 160, 160, 160, 157,
  404. 157, 157, 160, 160, 160, 160, 160, 160, 160, 160,
  405. 160, 160, 160, 160, 160, 160, 157, 157, 157, 157,
  406. 157, 157, 157, 157, 157, 158, 157, 157, 157, 159,
  407. 157, 157, 157, 157, 161, 157, 157, 157, 157, 157,
  408. 157, 157, 157, 157, 160, 160, 160, 160, 157, 160,
  409. 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
  410. 160, 160, 160, 160, 160, 160, 160, 160, 160, 157,
  411. 157, 157, 157, 157, 157, 161, 157, 157, 160, 160,
  412. 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
  413. 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
  414. 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
  415. 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
  416. 160, 160, 160, 160, 160, 160, 0, 157, 157, 157,
  417. 157
  418. } ;
  419. static const flex_int16_t yy_nxt[229] =
  420. { 0,
  421. 4, 5, 5, 6, 7, 8, 9, 10, 11, 12,
  422. 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
  423. 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
  424. 33, 34, 35, 36, 37, 38, 26, 39, 26, 40,
  425. 41, 42, 43, 44, 26, 45, 26, 46, 47, 48,
  426. 49, 50, 51, 53, 53, 54, 58, 62, 65, 68,
  427. 52, 69, 70, 71, 84, 66, 85, 63, 73, 74,
  428. 59, 86, 89, 55, 92, 97, 100, 68, 90, 69,
  429. 102, 53, 98, 87, 53, 53, 93, 88, 103, 102,
  430. 53, 75, 156, 155, 154, 153, 152, 103, 151, 150,
  431. 149, 148, 147, 146, 101, 56, 56, 60, 60, 106,
  432. 106, 145, 144, 143, 142, 141, 140, 139, 138, 137,
  433. 136, 135, 134, 133, 132, 131, 130, 129, 128, 108,
  434. 107, 127, 126, 125, 124, 123, 122, 121, 120, 119,
  435. 118, 117, 116, 115, 114, 113, 112, 111, 110, 109,
  436. 108, 107, 105, 61, 57, 104, 99, 96, 95, 94,
  437. 91, 83, 82, 81, 80, 79, 78, 77, 76, 72,
  438. 67, 64, 61, 57, 157, 3, 157, 157, 157, 157,
  439. 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
  440. 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
  441. 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
  442. 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
  443. 157, 157, 157, 157, 157, 157, 157, 157
  444. } ;
  445. static const flex_int16_t yy_chk[229] =
  446. { 0,
  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, 1, 1, 1, 1, 1, 1, 1, 1,
  451. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  452. 1, 1, 2, 5, 5, 6, 10, 14, 17, 20,
  453. 2, 20, 23, 23, 37, 17, 37, 14, 25, 25,
  454. 10, 38, 39, 6, 41, 45, 48, 69, 39, 69,
  455. 51, 51, 45, 38, 53, 53, 41, 38, 51, 102,
  456. 102, 160, 155, 151, 149, 147, 145, 102, 144, 141,
  457. 138, 137, 136, 134, 48, 158, 158, 159, 159, 161,
  458. 161, 133, 132, 131, 128, 127, 126, 125, 124, 121,
  459. 120, 119, 117, 115, 114, 113, 111, 110, 109, 108,
  460. 106, 99, 98, 97, 96, 94, 93, 92, 91, 88,
  461. 87, 86, 85, 84, 82, 81, 80, 78, 77, 76,
  462. 68, 65, 62, 60, 56, 54, 46, 44, 43, 42,
  463. 40, 36, 35, 34, 33, 32, 29, 28, 27, 24,
  464. 19, 15, 11, 7, 3, 157, 157, 157, 157, 157,
  465. 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
  466. 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
  467. 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
  468. 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
  469. 157, 157, 157, 157, 157, 157, 157, 157
  470. } ;
  471. static yy_state_type yy_last_accepting_state;
  472. static char *yy_last_accepting_cpos;
  473. extern int yy_flex_debug;
  474. int yy_flex_debug = 0;
  475. /* The intent behind this definition is that it'll catch
  476. * any uses of REJECT which flex missed.
  477. */
  478. #define REJECT reject_used_but_not_detected
  479. #define yymore() yymore_used_but_not_detected
  480. #define YY_MORE_ADJ 0
  481. #define YY_RESTORE_YY_MORE_OFFSET
  482. char *yytext;
  483. #line 1 "tokenizer.lex"
  484. #line 2 "tokenizer.lex"
  485. #define YYSTYPE void *
  486. #include "ast.h"
  487. #include "parser.tab.h"
  488. #include <stdlib.h>
  489. #include <string.h>
  490. #include <stdio.h>
  491. void yyerror(YYLTYPE *, stmt_node **, char *);
  492. int yywrap(void);
  493. char *str, *curptr;
  494. int cursz, chars;
  495. #define SZMUL 128
  496. int writing_html = 0;
  497. void str_init(void) {
  498. str = malloc(SZMUL);
  499. curptr = str;
  500. cursz = SZMUL;
  501. chars = 0;
  502. }
  503. void str_putc(char c) {
  504. *curptr++ = c;
  505. chars++;
  506. if(chars >= cursz) {
  507. str = realloc(str, cursz + SZMUL);
  508. curptr = str + chars;
  509. cursz += SZMUL;
  510. }
  511. }
  512. /* http://stackoverflow.com/questions/656703/how-does-flex-support-bison-location-exactly */
  513. /* Many thanks to hugomg and David Elson! */
  514. static void update_loc(YYLTYPE *yylloc, char *yytext){
  515. int curr_line;
  516. int curr_col;
  517. curr_line = yylloc->first_line = yylloc->last_line;
  518. curr_col = yylloc->first_column = yylloc->last_column;
  519. {char * s; for(s = yytext; *s != '\0'; s++){
  520. if(*s == '\n'){
  521. curr_line++;
  522. curr_col = 1;
  523. }else{
  524. curr_col++;
  525. }
  526. }}
  527. yylloc->last_line = curr_line;
  528. yylloc->last_column = curr_col-1;
  529. }
  530. char *FONTS[] = {
  531. "Adobe Courier",
  532. "Adobe Helvetica",
  533. "Adobe New Century Schoolbook",
  534. "Adobe Times",
  535. "Andale Mono",
  536. "Arial",
  537. "Arial Black",
  538. "C059",
  539. "Cantarell",
  540. "Century Schoolbook L",
  541. "Comic Sans MS",
  542. "Courier New",
  543. "cursor.pcf",
  544. "D050000L",
  545. "DejaVu Math TeX Gyre",
  546. "DejaVu Sans",
  547. "DejaVu Sans,DejaVu Sans Condensed",
  548. "DejaVu Sans,DejaVu Sans Light",
  549. "DejaVu Sans Mono",
  550. "DejaVu Serif",
  551. "DejaVu Serif,DejaVu Serif Condensed",
  552. "Denemo",
  553. "Dingbats",
  554. "Emmentaler",
  555. "feta26",
  556. "Georgia",
  557. "GNU Unifont",
  558. "GNU Unifont CSUR",
  559. "GNU Unifont Sample",
  560. "Impact",
  561. "Misc Fixed",
  562. "Misc Fixed Wide",
  563. "Nimbus Mono L",
  564. "Nimbus Mono PS",
  565. "Nimbus Roman",
  566. "Nimbus Roman No9 L",
  567. "NimbusSans",
  568. "Nimbus Sans",
  569. "Nimbus Sans L",
  570. "Nimbus Sans Narrow",
  571. "P052",
  572. "Standard Symbols L",
  573. "Standard Symbols PS",
  574. "Times New Roman",
  575. "Trebuchet MS",
  576. "Unifont",
  577. "Unifont CSUR",
  578. "Unifont Sample",
  579. "Unifont Upper",
  580. "URW Bookman",
  581. "URW Bookman L",
  582. "URW Chancery L",
  583. "URW Gothic",
  584. "URW Gothic L",
  585. "URW Palladio L",
  586. "Verdana",
  587. "Webdings",
  588. "Z003",
  589. };
  590. static void write_html(char *yytext) {
  591. if(writing_html) {
  592. printf("<span style=\"font-family: %s;%s%s%s%s\">%s</span>",
  593. FONTS[rand() % (sizeof(FONTS) / sizeof(*FONTS))],
  594. rand() & 1 ? "font-weight: bold;" : "",
  595. rand() & 1 ? "font-style: italic;" : "",
  596. rand() & 1 ? "text-decoration: underline;" : "",
  597. rand() & 1 ? "font-variant: small-caps;" : "",
  598. yytext
  599. );
  600. }
  601. }
  602. #define YY_USER_ACTION update_loc(yylloc, yytext); write_html(yytext);
  603. #line 701 "lex.yy.c"
  604. /* This is the right way to do it, but it keeps generating token $undefined.
  605. %x STRING
  606. \" { str_init(); BEGIN STRING; }
  607. <STRING>\\n { str_putc('\n'); }
  608. <STRING>\\t { str_putc('\t'); }
  609. <STRING>\\b { str_putc('\b'); }
  610. <STRING>\\r { str_putc('\r'); }
  611. <STRING>\\x{HEXDIGIT}{HEXDIGIT} { str_putc(strtol(yytext+2, NULL, 16)); }
  612. <STRING>\\\" { str_putc('"'); }
  613. <STRING>\" { str_putc('\0'); yylval = str; BEGIN 0; return STRING; }
  614. <STRING>. { str_putc(*yytext); }
  615. */
  616. #line 717 "lex.yy.c"
  617. #define INITIAL 0
  618. #ifndef YY_NO_UNISTD_H
  619. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  620. * down here because we want the user's section 1 to have been scanned first.
  621. * The user has a chance to override it with an option.
  622. */
  623. #include <unistd.h>
  624. #endif
  625. #ifndef YY_EXTRA_TYPE
  626. #define YY_EXTRA_TYPE void *
  627. #endif
  628. static int yy_init_globals ( void );
  629. /* Accessor methods to globals.
  630. These are made visible to non-reentrant scanners for convenience. */
  631. int yylex_destroy ( void );
  632. int yyget_debug ( void );
  633. void yyset_debug ( int debug_flag );
  634. YY_EXTRA_TYPE yyget_extra ( void );
  635. void yyset_extra ( YY_EXTRA_TYPE user_defined );
  636. FILE *yyget_in ( void );
  637. void yyset_in ( FILE * _in_str );
  638. FILE *yyget_out ( void );
  639. void yyset_out ( FILE * _out_str );
  640. int yyget_leng ( void );
  641. char *yyget_text ( void );
  642. int yyget_lineno ( void );
  643. void yyset_lineno ( int _line_number );
  644. YYSTYPE * yyget_lval ( void );
  645. void yyset_lval ( YYSTYPE * yylval_param );
  646. YYLTYPE *yyget_lloc ( void );
  647. void yyset_lloc ( YYLTYPE * yylloc_param );
  648. /* Macros after this point can all be overridden by user definitions in
  649. * section 1.
  650. */
  651. #ifndef YY_SKIP_YYWRAP
  652. #ifdef __cplusplus
  653. extern "C" int yywrap ( void );
  654. #else
  655. extern int yywrap ( void );
  656. #endif
  657. #endif
  658. #ifndef YY_NO_UNPUT
  659. static void yyunput ( int c, char *buf_ptr );
  660. #endif
  661. #ifndef yytext_ptr
  662. static void yy_flex_strncpy ( char *, const char *, int );
  663. #endif
  664. #ifdef YY_NEED_STRLEN
  665. static int yy_flex_strlen ( const char * );
  666. #endif
  667. #ifndef YY_NO_INPUT
  668. #ifdef __cplusplus
  669. static int yyinput ( void );
  670. #else
  671. static int input ( void );
  672. #endif
  673. #endif
  674. /* Amount of stuff to slurp up with each read. */
  675. #ifndef YY_READ_BUF_SIZE
  676. #ifdef __ia64__
  677. /* On IA-64, the buffer size is 16k, not 8k */
  678. #define YY_READ_BUF_SIZE 16384
  679. #else
  680. #define YY_READ_BUF_SIZE 8192
  681. #endif /* __ia64__ */
  682. #endif
  683. /* Copy whatever the last rule matched to the standard output. */
  684. #ifndef ECHO
  685. /* This used to be an fputs(), but since the string might contain NUL's,
  686. * we now use fwrite().
  687. */
  688. #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
  689. #endif
  690. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  691. * is returned in "result".
  692. */
  693. #ifndef YY_INPUT
  694. #define YY_INPUT(buf,result,max_size) \
  695. if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  696. { \
  697. int c = '*'; \
  698. int n; \
  699. for ( n = 0; n < max_size && \
  700. (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  701. buf[n] = (char) c; \
  702. if ( c == '\n' ) \
  703. buf[n++] = (char) c; \
  704. if ( c == EOF && ferror( yyin ) ) \
  705. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  706. result = n; \
  707. } \
  708. else \
  709. { \
  710. errno=0; \
  711. while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
  712. { \
  713. if( errno != EINTR) \
  714. { \
  715. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  716. break; \
  717. } \
  718. errno=0; \
  719. clearerr(yyin); \
  720. } \
  721. }\
  722. \
  723. #endif
  724. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  725. * we don't want an extra ';' after the "return" because that will cause
  726. * some compilers to complain about unreachable statements.
  727. */
  728. #ifndef yyterminate
  729. #define yyterminate() return YY_NULL
  730. #endif
  731. /* Number of entries by which start-condition stack grows. */
  732. #ifndef YY_START_STACK_INCR
  733. #define YY_START_STACK_INCR 25
  734. #endif
  735. /* Report a fatal error. */
  736. #ifndef YY_FATAL_ERROR
  737. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
  738. #endif
  739. /* end tables serialization structures and prototypes */
  740. /* Default declaration of generated scanner - a define so the user can
  741. * easily add parameters.
  742. */
  743. #ifndef YY_DECL
  744. #define YY_DECL_IS_OURS 1
  745. extern int yylex \
  746. (YYSTYPE * yylval_param, YYLTYPE * yylloc_param );
  747. #define YY_DECL int yylex \
  748. (YYSTYPE * yylval_param, YYLTYPE * yylloc_param )
  749. #endif /* !YY_DECL */
  750. /* Code executed at the beginning of each rule, after yytext and yyleng
  751. * have been set up.
  752. */
  753. #ifndef YY_USER_ACTION
  754. #define YY_USER_ACTION
  755. #endif
  756. /* Code executed at the end of each rule. */
  757. #ifndef YY_BREAK
  758. #define YY_BREAK /*LINTED*/break;
  759. #endif
  760. #define YY_RULE_SETUP \
  761. if ( yyleng > 0 ) \
  762. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
  763. (yytext[yyleng - 1] == '\n'); \
  764. YY_USER_ACTION
  765. /** The main scanner function which does all the work.
  766. */
  767. YY_DECL
  768. {
  769. yy_state_type yy_current_state;
  770. char *yy_cp, *yy_bp;
  771. int yy_act;
  772. YYSTYPE * yylval;
  773. YYLTYPE * yylloc;
  774. yylval = yylval_param;
  775. yylloc = yylloc_param;
  776. if ( !(yy_init) )
  777. {
  778. (yy_init) = 1;
  779. #ifdef YY_USER_INIT
  780. YY_USER_INIT;
  781. #endif
  782. if ( ! (yy_start)