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.

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