Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

2277 рядки
63 KiB

  1. #line 2 "generated/easymesh-scanner.cpp"
  2. #line 4 "generated/easymesh-scanner.cpp"
  3. #define YY_INT_ALIGNED short int
  4. /* A lexical scanner generated by flex */
  5. #define FLEX_SCANNER
  6. #define YY_FLEX_MAJOR_VERSION 2
  7. #define YY_FLEX_MINOR_VERSION 5
  8. #define YY_FLEX_SUBMINOR_VERSION 35
  9. #if YY_FLEX_SUBMINOR_VERSION > 0
  10. #define FLEX_BETA
  11. #endif
  12. /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
  13. * following macro. This is required in order to pass the c++-multiple-scanners
  14. * test in the regression suite. We get reports that it breaks inheritance.
  15. * We will address this in a future release of flex, or omit the C++ scanner
  16. * altogether.
  17. */
  18. #define yyFlexLexer EasyMeshFlexLexer
  19. /* First, we deal with platform-specific or compiler-specific issues. */
  20. /* begin standard C headers. */
  21. /* end standard C headers. */
  22. /* flex integer type definitions */
  23. #ifndef FLEXINT_H
  24. #define FLEXINT_H
  25. /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
  26. #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  27. /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
  28. * if you want the limit (max/min) macros for int types.
  29. */
  30. #ifndef __STDC_LIMIT_MACROS
  31. #define __STDC_LIMIT_MACROS 1
  32. #endif
  33. #include <inttypes.h>
  34. typedef int8_t flex_int8_t;
  35. typedef uint8_t flex_uint8_t;
  36. typedef int16_t flex_int16_t;
  37. typedef uint16_t flex_uint16_t;
  38. typedef int32_t flex_int32_t;
  39. typedef uint32_t flex_uint32_t;
  40. #else
  41. typedef signed char flex_int8_t;
  42. typedef short int flex_int16_t;
  43. typedef int flex_int32_t;
  44. typedef unsigned char flex_uint8_t;
  45. typedef unsigned short int flex_uint16_t;
  46. typedef unsigned int flex_uint32_t;
  47. /* Limits of integral types. */
  48. #ifndef INT8_MIN
  49. #define INT8_MIN (-128)
  50. #endif
  51. #ifndef INT16_MIN
  52. #define INT16_MIN (-32767-1)
  53. #endif
  54. #ifndef INT32_MIN
  55. #define INT32_MIN (-2147483647-1)
  56. #endif
  57. #ifndef INT8_MAX
  58. #define INT8_MAX (127)
  59. #endif
  60. #ifndef INT16_MAX
  61. #define INT16_MAX (32767)
  62. #endif
  63. #ifndef INT32_MAX
  64. #define INT32_MAX (2147483647)
  65. #endif
  66. #ifndef UINT8_MAX
  67. #define UINT8_MAX (255U)
  68. #endif
  69. #ifndef UINT16_MAX
  70. #define UINT16_MAX (65535U)
  71. #endif
  72. #ifndef UINT32_MAX
  73. #define UINT32_MAX (4294967295U)
  74. #endif
  75. #endif /* ! C99 */
  76. #endif /* ! FLEXINT_H */
  77. /* begin standard C++ headers. */
  78. #include <iostream>
  79. #include <errno.h>
  80. #include <cstdlib>
  81. #include <cstdio>
  82. #include <cstring>
  83. /* end standard C++ headers. */
  84. #ifdef __cplusplus
  85. /* The "const" storage-class-modifier is valid. */
  86. #define YY_USE_CONST
  87. #else /* ! __cplusplus */
  88. /* C99 requires __STDC__ to be defined as 1. */
  89. #if defined (__STDC__)
  90. #define YY_USE_CONST
  91. #endif /* defined (__STDC__) */
  92. #endif /* ! __cplusplus */
  93. #ifdef YY_USE_CONST
  94. #define yyconst const
  95. #else
  96. #define yyconst
  97. #endif
  98. /* Returned upon end-of-file. */
  99. #define YY_NULL 0
  100. /* Promotes a possibly negative, possibly signed char to an unsigned
  101. * integer for use as an array index. If the signed char is negative,
  102. * we want to instead treat it as an 8-bit unsigned char, hence the
  103. * double cast.
  104. */
  105. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  106. /* Enter a start condition. This macro really ought to take a parameter,
  107. * but we do it the disgusting crufty way forced on us by the ()-less
  108. * definition of BEGIN.
  109. */
  110. #define BEGIN (yy_start) = 1 + 2 *
  111. /* Translate the current start state into a value that can be later handed
  112. * to BEGIN to return to the state. The YYSTATE alias is for lex
  113. * compatibility.
  114. */
  115. #define YY_START (((yy_start) - 1) / 2)
  116. #define YYSTATE YY_START
  117. /* Action number for EOF rule of a given start state. */
  118. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  119. /* Special action meaning "start processing a new file". */
  120. #define YY_NEW_FILE yyrestart( yyin )
  121. #define YY_END_OF_BUFFER_CHAR 0
  122. /* Size of default input buffer. */
  123. #ifndef YY_BUF_SIZE
  124. #ifdef __ia64__
  125. /* On IA-64, the buffer size is 16k, not 8k.
  126. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
  127. * Ditto for the __ia64__ case accordingly.
  128. */
  129. #define YY_BUF_SIZE 32768
  130. #else
  131. #define YY_BUF_SIZE 16384
  132. #endif /* __ia64__ */
  133. #endif
  134. /* The state buf must be large enough to hold one state per character in the main buffer.
  135. */
  136. #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
  137. #ifndef YY_TYPEDEF_YY_BUFFER_STATE
  138. #define YY_TYPEDEF_YY_BUFFER_STATE
  139. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  140. #endif
  141. extern int yyleng;
  142. #define EOB_ACT_CONTINUE_SCAN 0
  143. #define EOB_ACT_END_OF_FILE 1
  144. #define EOB_ACT_LAST_MATCH 2
  145. #define YY_LESS_LINENO(n)
  146. /* Return all but the first "n" matched characters back to the input stream. */
  147. #define yyless(n) \
  148. do \
  149. { \
  150. /* Undo effects of setting up yytext. */ \
  151. int yyless_macro_arg = (n); \
  152. YY_LESS_LINENO(yyless_macro_arg);\
  153. *yy_cp = (yy_hold_char); \
  154. YY_RESTORE_YY_MORE_OFFSET \
  155. (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  156. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  157. } \
  158. while ( 0 )
  159. #define unput(c) yyunput( c, (yytext_ptr) )
  160. #ifndef YY_TYPEDEF_YY_SIZE_T
  161. #define YY_TYPEDEF_YY_SIZE_T
  162. typedef size_t yy_size_t;
  163. #endif
  164. #ifndef YY_STRUCT_YY_BUFFER_STATE
  165. #define YY_STRUCT_YY_BUFFER_STATE
  166. struct yy_buffer_state
  167. {
  168. std::istream* yy_input_file;
  169. char *yy_ch_buf; /* input buffer */
  170. char *yy_buf_pos; /* current position in input buffer */
  171. /* Size of input buffer in bytes, not including room for EOB
  172. * characters.
  173. */
  174. yy_size_t yy_buf_size;
  175. /* Number of characters read into yy_ch_buf, not including EOB
  176. * characters.
  177. */
  178. int yy_n_chars;
  179. /* Whether we "own" the buffer - i.e., we know we created it,
  180. * and can realloc() it to grow it, and should free() it to
  181. * delete it.
  182. */
  183. int yy_is_our_buffer;
  184. /* Whether this is an "interactive" input source; if so, and
  185. * if we're using stdio for input, then we want to use getc()
  186. * instead of fread(), to make sure we stop fetching input after
  187. * each newline.
  188. */
  189. int yy_is_interactive;
  190. /* Whether we're considered to be at the beginning of a line.
  191. * If so, '^' rules will be active on the next match, otherwise
  192. * not.
  193. */
  194. int yy_at_bol;
  195. int yy_bs_lineno; /**< The line count. */
  196. int yy_bs_column; /**< The column count. */
  197. /* Whether to try to fill the input buffer when we reach the
  198. * end of it.
  199. */
  200. int yy_fill_buffer;
  201. int yy_buffer_status;
  202. #define YY_BUFFER_NEW 0
  203. #define YY_BUFFER_NORMAL 1
  204. /* When an EOF's been seen but there's still some text to process
  205. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  206. * shouldn't try reading from the input source any more. We might
  207. * still have a bunch of tokens to match, though, because of
  208. * possible backing-up.
  209. *
  210. * When we actually see the EOF, we change the status to "new"
  211. * (via yyrestart()), so that the user can continue scanning by
  212. * just pointing yyin at a new input file.
  213. */
  214. #define YY_BUFFER_EOF_PENDING 2
  215. };
  216. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  217. /* We provide macros for accessing buffer states in case in the
  218. * future we want to put the buffer states in a more general
  219. * "scanner state".
  220. *
  221. * Returns the top of the stack, or NULL.
  222. */
  223. #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
  224. ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
  225. : NULL)
  226. /* Same as previous macro, but useful when we know that the buffer stack is not
  227. * NULL or when we need an lvalue. For internal use only.
  228. */
  229. #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
  230. void *EasyMeshalloc (yy_size_t );
  231. void *EasyMeshrealloc (void *,yy_size_t );
  232. void EasyMeshfree (void * );
  233. #define yy_new_buffer yy_create_buffer
  234. #define yy_set_interactive(is_interactive) \
  235. { \
  236. if ( ! YY_CURRENT_BUFFER ){ \
  237. yyensure_buffer_stack (); \
  238. YY_CURRENT_BUFFER_LVALUE = \
  239. yy_create_buffer( yyin, YY_BUF_SIZE ); \
  240. } \
  241. YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  242. }
  243. #define yy_set_bol(at_bol) \
  244. { \
  245. if ( ! YY_CURRENT_BUFFER ){\
  246. yyensure_buffer_stack (); \
  247. YY_CURRENT_BUFFER_LVALUE = \
  248. yy_create_buffer( yyin, YY_BUF_SIZE ); \
  249. } \
  250. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  251. }
  252. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  253. /* Begin user sect3 */
  254. typedef unsigned char YY_CHAR;
  255. #define yytext_ptr yytext
  256. #include <FlexLexer.h>
  257. /* Done after the current pattern has been matched and before the
  258. * corresponding action - sets up yytext.
  259. */
  260. #define YY_DO_BEFORE_ACTION \
  261. (yytext_ptr) = yy_bp; \
  262. yyleng = (size_t) (yy_cp - yy_bp); \
  263. (yy_hold_char) = *yy_cp; \
  264. *yy_cp = '\0'; \
  265. (yy_c_buf_p) = yy_cp;
  266. #define YY_NUM_RULES 87
  267. #define YY_END_OF_BUFFER 88
  268. /* This struct is not used in this scanner,
  269. but its presence is necessary. */
  270. struct yy_trans_info
  271. {
  272. flex_int32_t yy_verify;
  273. flex_int32_t yy_nxt;
  274. };
  275. static yyconst flex_int16_t yy_accept[376] =
  276. { 0,
  277. 0, 0, 88, 86, 85, 84, 86, 78, 79, 86,
  278. 77, 86, 86, 75, 86, 82, 83, 86, 86, 86,
  279. 86, 86, 86, 86, 24, 47, 20, 86, 80, 81,
  280. 0, 0, 75, 74, 76, 0, 59, 55, 64, 0,
  281. 0, 66, 62, 65, 0, 0, 51, 0, 0, 0,
  282. 0, 6, 0, 48, 49, 50, 0, 25, 0, 21,
  283. 22, 23, 7, 0, 0, 0, 0, 0, 44, 45,
  284. 46, 0, 0, 0, 0, 0, 0, 0, 0, 17,
  285. 18, 19, 0, 15, 16, 0, 0, 76, 0, 0,
  286. 67, 0, 63, 0, 0, 0, 58, 0, 0, 0,
  287. 0, 0, 0, 54, 0, 0, 0, 0, 0, 8,
  288. 9, 10, 0, 0, 32, 33, 34, 0, 0, 0,
  289. 0, 35, 36, 37, 0, 26, 27, 28, 0, 0,
  290. 12, 0, 0, 11, 0, 0, 29, 30, 31, 0,
  291. 68, 0, 74, 0, 57, 0, 0, 0, 0, 0,
  292. 0, 0, 0, 61, 60, 56, 38, 39, 40, 41,
  293. 42, 43, 0, 0, 4, 2, 1, 5, 0, 0,
  294. 0, 0, 0, 0, 0, 0, 0, 53, 0, 52,
  295. 0, 0, 0, 0, 0, 0, 13, 0, 72, 14,
  296. 0, 0, 69, 0, 0, 0, 0, 0, 0, 0,
  297. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  298. 0, 0, 3, 0, 0, 0, 73, 0, 0, 0,
  299. 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  300. 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
  301. 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,
  302. 0, 5, 0, 0, 0, 24, 0, 0, 0, 0,
  303. 0, 0, 0, 0, 0, 0, 70, 0, 0, 64,
  304. 0, 0, 0, 0, 62, 0, 0, 51, 0, 0,
  305. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  306. 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
  307. 0, 0, 7, 0, 0, 0, 0, 0, 0, 0,
  308. 0, 71, 0, 0, 0, 0, 0, 0, 54, 0,
  309. 8, 0, 0, 0, 0, 0, 20, 0, 0, 0,
  310. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  311. 55, 0, 0, 0, 65, 0, 0, 0, 0, 0,
  312. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  313. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  314. 0, 0, 0, 0, 0
  315. } ;
  316. static yyconst flex_int32_t yy_ec[256] =
  317. { 0,
  318. 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
  319. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  320. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  321. 1, 3, 1, 1, 4, 1, 1, 1, 1, 5,
  322. 6, 1, 7, 3, 8, 9, 10, 11, 11, 11,
  323. 11, 11, 11, 11, 11, 11, 11, 1, 1, 1,
  324. 1, 1, 1, 1, 12, 12, 13, 12, 14, 12,
  325. 1, 1, 1, 1, 1, 15, 1, 1, 1, 1,
  326. 1, 1, 16, 1, 1, 1, 1, 1, 1, 1,
  327. 17, 1, 18, 1, 1, 1, 19, 20, 21, 22,
  328. 23, 24, 25, 26, 27, 28, 1, 29, 30, 31,
  329. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
  330. 42, 43, 44, 1, 45, 1, 1, 1, 1, 1,
  331. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  332. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  333. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  334. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  335. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  336. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  337. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  338. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  339. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  340. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  341. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  342. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  343. 1, 1, 1, 1, 1
  344. } ;
  345. static yyconst flex_int32_t yy_meta[46] =
  346. { 0,
  347. 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
  348. 3, 3, 3, 3, 1, 1, 1, 1, 3, 3,
  349. 3, 3, 3, 3, 1, 1, 1, 1, 1, 1,
  350. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  351. 1, 1, 1, 1, 1
  352. } ;
  353. static yyconst flex_int16_t yy_base[385] =
  354. { 0,
  355. 0, 0, 455, 456, 456, 456, 0, 456, 456, 37,
  356. 38, 443, 443, 41, 416, 456, 456, 33, 36, 25,
  357. 413, 431, 30, 33, 45, 68, 93, 42, 456, 456,
  358. 0, 438, 57, 69, 0, 423, 456, 60, 425, 410,
  359. 424, 456, 60, 412, 54, 412, 423, 416, 407, 410,
  360. 406, 456, 402, 456, 456, 456, 414, 456, 398, 456,
  361. 456, 456, 80, 397, 61, 76, 404, 79, 456, 456,
  362. 456, 74, 403, 411, 390, 52, 389, 397, 96, 456,
  363. 456, 456, 392, 456, 456, 0, 133, 0, 410, 392,
  364. 456, 125, 456, 404, 403, 396, 456, 82, 109, 89,
  365. 399, 390, 132, 390, 382, 384, 381, 388, 395, 384,
  366. 456, 456, 391, 392, 456, 456, 456, 378, 383, 116,
  367. 385, 456, 456, 456, 384, 456, 456, 456, 121, 375,
  368. 456, 374, 381, 456, 382, 366, 456, 456, 456, 364,
  369. 0, 389, 388, 360, 456, 365, 137, 369, 354, 365,
  370. 355, 134, 131, 456, 456, 456, 456, 456, 456, 456,
  371. 456, 456, 133, 368, 360, 361, 358, 356, 360, 363,
  372. 353, 365, 346, 359, 349, 345, 342, 456, 341, 456,
  373. 340, 341, 339, 336, 352, 349, 456, 335, 456, 456,
  374. 333, 142, 0, 349, 327, 334, 341, 336, 328, 330,
  375. 343, 342, 328, 333, 339, 322, 329, 138, 141, 144,
  376. 332, 332, 456, 326, 317, 330, 456, 315, 320, 325,
  377. 146, 318, 149, 320, 308, 323, 152, 306, 323, 322,
  378. 305, 310, 155, 315, 314, 0, 321, 299, 307, 312,
  379. 313, 294, 308, 297, 305, 292, 288, 306, 289, 456,
  380. 291, 456, 303, 158, 293, 161, 288, 284, 292, 297,
  381. 294, 286, 277, 294, 277, 278, 0, 272, 278, 456,
  382. 277, 286, 269, 270, 456, 268, 272, 456, 271, 264,
  383. 273, 264, 271, 164, 259, 256, 272, 263, 256, 267,
  384. 272, 0, 261, 267, 266, 261, 260, 262, 259, 456,
  385. 260, 245, 189, 262, 253, 256, 238, 245, 253, 252,
  386. 239, 456, 250, 249, 248, 251, 248, 239, 456, 230,
  387. 456, 235, 236, 237, 236, 241, 169, 242, 225, 237,
  388. 228, 231, 233, 232, 229, 231, 227, 220, 221, 212,
  389. 456, 212, 223, 227, 456, 210, 215, 212, 216, 219,
  390. 217, 216, 201, 217, 206, 212, 202, 196, 213, 211,
  391. 195, 202, 190, 193, 188, 181, 201, 190, 181, 186,
  392. 198, 183, 174, 185, 456, 210, 180, 228, 174, 162,
  393. 155, 139, 103, 79
  394. } ;
  395. static yyconst flex_int16_t yy_def[385] =
  396. { 0,
  397. 375, 1, 375, 375, 375, 375, 376, 375, 375, 375,
  398. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  399. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  400. 377, 375, 375, 375, 378, 375, 375, 375, 375, 375,
  401. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  402. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  403. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  404. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  405. 375, 375, 375, 375, 375, 379, 375, 378, 375, 375,
  406. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  407. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  408. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  409. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  410. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  411. 380, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  412. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  413. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  414. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  415. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  416. 375, 375, 381, 375, 375, 375, 375, 375, 375, 375,
  417. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  418. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  419. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  420. 375, 375, 375, 375, 375, 382, 375, 375, 375, 375,
  421. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  422. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  423. 375, 375, 375, 375, 375, 375, 383, 375, 375, 375,
  424. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  425. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  426. 375, 384, 375, 375, 375, 375, 375, 375, 375, 375,
  427. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  428. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  429. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  430. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  431. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  432. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  433. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  434. 375, 375, 375, 375, 0, 375, 375, 375, 375, 375,
  435. 375, 375, 375, 375
  436. } ;
  437. static yyconst flex_int16_t yy_nxt[502] =
  438. { 0,
  439. 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
  440. 14, 4, 15, 4, 4, 4, 16, 17, 18, 19,
  441. 20, 21, 4, 22, 4, 4, 4, 4, 23, 24,
  442. 4, 4, 4, 4, 25, 26, 27, 4, 28, 4,
  443. 4, 4, 4, 29, 30, 32, 32, 33, 33, 32,
  444. 47, 33, 37, 38, 39, 40, 41, 45, 46, 53,
  445. 48, 51, 52, 57, 83, 32, 42, 33, 43, 44,
  446. 132, 84, 58, 54, 55, 56, 59, 85, 90, 34,
  447. 95, 312, 87, 114, 91, 60, 61, 62, 63, 133,
  448. 64, 87, 96, 65, 98, 99, 100, 66, 110, 111,
  449. 67, 115, 116, 117, 68, 292, 125, 118, 69, 70,
  450. 71, 72, 119, 121, 126, 127, 128, 73, 112, 122,
  451. 123, 124, 136, 157, 158, 74, 75, 76, 77, 161,
  452. 162, 78, 79, 80, 81, 82, 137, 138, 139, 142,
  453. 142, 267, 179, 143, 146, 147, 148, 149, 150, 159,
  454. 165, 160, 180, 183, 184, 196, 185, 236, 151, 186,
  455. 152, 153, 206, 203, 193, 207, 204, 166, 197, 167,
  456. 205, 234, 168, 208, 209, 210, 141, 235, 198, 157,
  457. 158, 159, 86, 160, 161, 162, 69, 70, 71, 115,
  458. 116, 117, 126, 127, 128, 137, 138, 139, 54, 55,
  459. 56, 60, 61, 62, 122, 123, 124, 321, 111, 80,
  460. 81, 82, 31, 187, 155, 190, 374, 373, 372, 371,
  461. 370, 154, 93, 369, 368, 367, 366, 112, 88, 365,
  462. 88, 364, 131, 363, 180, 362, 361, 360, 85, 359,
  463. 134, 358, 357, 356, 58, 355, 354, 353, 352, 351,
  464. 350, 349, 348, 347, 346, 345, 344, 343, 342, 341,
  465. 340, 339, 338, 337, 336, 335, 334, 333, 332, 331,
  466. 330, 329, 145, 328, 84, 327, 326, 325, 324, 323,
  467. 322, 320, 319, 318, 156, 317, 316, 315, 314, 313,
  468. 311, 310, 309, 308, 307, 306, 305, 304, 303, 302,
  469. 301, 300, 299, 97, 298, 297, 296, 295, 294, 293,
  470. 291, 290, 289, 288, 287, 286, 285, 284, 283, 282,
  471. 281, 280, 279, 278, 277, 276, 275, 274, 273, 42,
  472. 272, 271, 270, 269, 268, 213, 266, 265, 264, 263,
  473. 262, 261, 260, 259, 258, 178, 257, 256, 255, 254,
  474. 253, 252, 251, 250, 249, 248, 247, 246, 245, 244,
  475. 243, 242, 241, 240, 239, 91, 238, 37, 237, 233,
  476. 232, 231, 230, 229, 228, 227, 226, 225, 224, 223,
  477. 222, 221, 220, 219, 218, 217, 216, 215, 214, 213,
  478. 212, 211, 202, 201, 200, 199, 195, 194, 143, 143,
  479. 192, 191, 190, 189, 188, 187, 182, 181, 178, 177,
  480. 176, 175, 174, 173, 172, 171, 52, 170, 169, 164,
  481. 163, 156, 155, 154, 145, 144, 140, 135, 134, 131,
  482. 130, 129, 120, 113, 109, 108, 107, 106, 105, 104,
  483. 103, 102, 101, 97, 94, 93, 92, 89, 34, 50,
  484. 49, 36, 35, 34, 375, 3, 375, 375, 375, 375,
  485. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  486. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  487. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  488. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  489. 375
  490. } ;
  491. static yyconst flex_int16_t yy_chk[502] =
  492. { 0,
  493. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  494. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  495. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  496. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  497. 1, 1, 1, 1, 1, 10, 11, 10, 11, 14,
  498. 20, 14, 18, 18, 18, 18, 18, 19, 19, 24,
  499. 20, 23, 23, 25, 28, 33, 18, 33, 18, 18,
  500. 76, 28, 25, 24, 24, 24, 25, 28, 38, 34,
  501. 43, 384, 34, 65, 38, 25, 25, 25, 26, 76,
  502. 26, 34, 43, 26, 45, 45, 45, 26, 63, 63,
  503. 26, 65, 65, 65, 26, 383, 72, 66, 26, 26,
  504. 26, 27, 66, 68, 72, 72, 72, 27, 63, 68,
  505. 68, 68, 79, 98, 98, 27, 27, 27, 27, 100,
  506. 100, 27, 27, 27, 27, 27, 79, 79, 79, 87,
  507. 87, 382, 120, 87, 92, 92, 92, 92, 92, 99,
  508. 103, 99, 120, 129, 129, 147, 129, 381, 92, 129,
  509. 92, 92, 153, 152, 380, 153, 152, 103, 147, 103,
  510. 152, 192, 103, 163, 163, 163, 379, 192, 147, 208,
  511. 208, 209, 377, 209, 210, 210, 221, 221, 221, 223,
  512. 223, 223, 227, 227, 227, 233, 233, 233, 254, 254,
  513. 254, 256, 256, 256, 284, 284, 284, 303, 303, 327,
  514. 327, 327, 376, 374, 373, 372, 371, 370, 369, 368,
  515. 367, 366, 365, 364, 363, 362, 361, 303, 378, 360,
  516. 378, 359, 358, 357, 356, 355, 354, 353, 352, 351,
  517. 350, 349, 348, 347, 346, 344, 343, 342, 340, 339,
  518. 338, 337, 336, 335, 334, 333, 332, 331, 330, 329,
  519. 328, 326, 325, 324, 323, 322, 320, 318, 317, 316,
  520. 315, 314, 313, 311, 310, 309, 308, 307, 306, 305,
  521. 304, 302, 301, 299, 298, 297, 296, 295, 294, 293,
  522. 291, 290, 289, 288, 287, 286, 285, 283, 282, 281,
  523. 280, 279, 277, 276, 274, 273, 272, 271, 269, 268,
  524. 266, 265, 264, 263, 262, 261, 260, 259, 258, 257,
  525. 255, 253, 251, 249, 248, 247, 246, 245, 244, 243,
  526. 242, 241, 240, 239, 238, 237, 235, 234, 232, 231,
  527. 230, 229, 228, 226, 225, 224, 222, 220, 219, 218,
  528. 216, 215, 214, 212, 211, 207, 206, 205, 204, 203,
  529. 202, 201, 200, 199, 198, 197, 196, 195, 194, 191,
  530. 188, 186, 185, 184, 183, 182, 181, 179, 177, 176,
  531. 175, 174, 173, 172, 171, 170, 169, 168, 167, 166,
  532. 165, 164, 151, 150, 149, 148, 146, 144, 143, 142,
  533. 140, 136, 135, 133, 132, 130, 125, 121, 119, 118,
  534. 114, 113, 110, 109, 108, 107, 106, 105, 104, 102,
  535. 101, 96, 95, 94, 90, 89, 83, 78, 77, 75,
  536. 74, 73, 67, 64, 59, 57, 53, 51, 50, 49,
  537. 48, 47, 46, 44, 41, 40, 39, 36, 32, 22,
  538. 21, 15, 13, 12, 3, 375, 375, 375, 375, 375,
  539. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  540. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  541. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  542. 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
  543. 375
  544. } ;
  545. /* The intent behind this definition is that it'll catch
  546. * any uses of REJECT which flex missed.
  547. */
  548. #define REJECT reject_used_but_not_detected
  549. #define yymore() yymore_used_but_not_detected
  550. #define YY_MORE_ADJ 0
  551. #define YY_RESTORE_YY_MORE_OFFSET
  552. #line 1 "easymesh/easymesh-scanner.l"
  553. #line 2 "easymesh/easymesh-scanner.l"
  554. //
  555. // Lol Engine
  556. //
  557. // Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
  558. // (c) 2009-2013 Cédric Lecacheur <jordx@free.fr>
  559. // (c) 2009-2013 Benjamin "Touky" Huet <huet.benjamin@gmail.com>
  560. // This program is free software; you can redistribute it and/or
  561. // modify it under the terms of the Do What The Fuck You Want To
  562. // Public License, Version 2, as published by Sam Hocevar. See
  563. // http://www.wtfpl.net/ for more details.
  564. //
  565. #include <lol/engine-internal.h>
  566. #include <cstdlib>
  567. using std::exit;
  568. using std::malloc;
  569. using std::realloc;
  570. using std::free;
  571. #include "easymesh/easymesh-compiler.h"
  572. typedef lol::EasyMeshParser::token token;
  573. typedef lol::EasyMeshParser::token_type token_type;
  574. #ifndef YY_DECL
  575. # define YY_DECL lol::EasyMeshParser::token_type \
  576. lol::EasyMeshScanner::lex(lol::EasyMeshParser::semantic_type* yylval, \
  577. lol::EasyMeshParser::location_type* yylloc)
  578. #endif
  579. #define yyterminate() return token::T_END
  580. #define YY_NO_UNISTD_H
  581. #define YY_USER_ACTION yylloc->columns(yyleng);
  582. #line 687 "generated/easymesh-scanner.cpp"
  583. #define INITIAL 0
  584. #ifndef YY_NO_UNISTD_H
  585. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  586. * down here because we want the user's section 1 to have been scanned first.
  587. * The user has a chance to override it with an option.
  588. */
  589. #include <unistd.h>
  590. #endif
  591. #ifndef YY_EXTRA_TYPE
  592. #define YY_EXTRA_TYPE void *
  593. #endif
  594. #ifndef yytext_ptr
  595. static void yy_flex_strncpy (char *,yyconst char *,int );
  596. #endif
  597. #ifdef YY_NEED_STRLEN
  598. static int yy_flex_strlen (yyconst char * );
  599. #endif
  600. #ifndef YY_NO_INPUT
  601. #endif
  602. /* Amount of stuff to slurp up with each read. */
  603. #ifndef YY_READ_BUF_SIZE
  604. #ifdef __ia64__
  605. /* On IA-64, the buffer size is 16k, not 8k */
  606. #define YY_READ_BUF_SIZE 16384
  607. #else
  608. #define YY_READ_BUF_SIZE 8192
  609. #endif /* __ia64__ */
  610. #endif
  611. /* Copy whatever the last rule matched to the standard output. */
  612. #ifndef ECHO
  613. #define ECHO LexerOutput( yytext, yyleng )
  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. \
  621. if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
  622. YY_FATAL_ERROR( "input in flex scanner failed" );
  623. #endif
  624. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  625. * we don't want an extra ';' after the "return" because that will cause
  626. * some compilers to complain about unreachable statements.
  627. */
  628. #ifndef yyterminate
  629. #define yyterminate() return YY_NULL
  630. #endif
  631. /* Number of entries by which start-condition stack grows. */
  632. #ifndef YY_START_STACK_INCR
  633. #define YY_START_STACK_INCR 25
  634. #endif
  635. /* Report a fatal error. */
  636. #ifndef YY_FATAL_ERROR
  637. #define YY_FATAL_ERROR(msg) LexerError( msg )
  638. #endif
  639. /* end tables serialization structures and prototypes */
  640. /* Default declaration of generated scanner - a define so the user can
  641. * easily add parameters.
  642. */
  643. #ifndef YY_DECL
  644. #define YY_DECL_IS_OURS 1
  645. #define YY_DECL int yyFlexLexer::yylex()
  646. #endif /* !YY_DECL */
  647. /* Code executed at the beginning of each rule, after yytext and yyleng
  648. * have been set up.
  649. */
  650. #ifndef YY_USER_ACTION
  651. #define YY_USER_ACTION
  652. #endif
  653. /* Code executed at the end of each rule. */
  654. #ifndef YY_BREAK
  655. #define YY_BREAK break;
  656. #endif
  657. #define YY_RULE_SETUP \
  658. YY_USER_ACTION
  659. /** The main scanner function which does all the work.
  660. */
  661. YY_DECL
  662. {
  663. register yy_state_type yy_current_state;
  664. register char *yy_cp, *yy_bp;
  665. register int yy_act;
  666. #line 44 "easymesh/easymesh-scanner.l"
  667. /* reset location at the beginning of yylex() */
  668. yylloc->step();
  669. #line 799 "generated/easymesh-scanner.cpp"
  670. if ( !(yy_init) )
  671. {
  672. (yy_init) = 1;
  673. #ifdef YY_USER_INIT
  674. YY_USER_INIT;
  675. #endif
  676. if ( ! (yy_start) )
  677. (yy_start) = 1; /* first start state */
  678. if ( ! yyin )
  679. yyin = & std::cin;
  680. if ( ! yyout )
  681. yyout = & std::cout;
  682. if ( ! YY_CURRENT_BUFFER ) {
  683. yyensure_buffer_stack ();
  684. YY_CURRENT_BUFFER_LVALUE =
  685. yy_create_buffer( yyin, YY_BUF_SIZE );
  686. }
  687. yy_load_buffer_state( );
  688. }
  689. while ( 1 ) /* loops until end-of-file is reached */
  690. {
  691. yy_cp = (yy_c_buf_p);
  692. /* Support of yytext. */
  693. *yy_cp = (yy_hold_char);
  694. /* yy_bp points to the position in yy_ch_buf of the start of
  695. * the current run.
  696. */
  697. yy_bp = yy_cp;
  698. yy_current_state = (yy_start);
  699. yy_match:
  700. do
  701. {
  702. register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
  703. if ( yy_accept[yy_current_state] )
  704. {
  705. (yy_last_accepting_state) = yy_current_state;
  706. (yy_last_accepting_cpos) = yy_cp;
  707. }
  708. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  709. {
  710. yy_current_state = (int) yy_def[yy_current_state];
  711. if ( yy_current_state >= 376 )
  712. yy_c = yy_meta[(unsigned int) yy_c];
  713. }
  714. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  715. ++yy_cp;
  716. }
  717. while ( yy_current_state != 375 );
  718. yy_cp = (yy_last_accepting_cpos);
  719. yy_current_state = (yy_last_accepting_state);
  720. yy_find_action:
  721. yy_act = yy_accept[yy_current_state];
  722. YY_DO_BEFORE_ACTION;
  723. do_action: /* This label is used only to access EOF actions. */
  724. switch ( yy_act )
  725. { /* beginning of action switch */
  726. case 0: /* must back up */
  727. /* undo the effects of YY_DO_BEFORE_ACTION */
  728. *yy_cp = (yy_hold_char);
  729. yy_cp = (yy_last_accepting_cpos);
  730. yy_current_state = (yy_last_accepting_state);
  731. goto yy_find_action;
  732. case 1:
  733. YY_RULE_SETUP
  734. #line 50 "easymesh/easymesh-scanner.l"
  735. { return token::T_CSGUNION; }
  736. YY_BREAK
  737. case 2:
  738. YY_RULE_SETUP
  739. #line 51 "easymesh/easymesh-scanner.l"
  740. { return token::T_CSGSUBSTRACT; }
  741. YY_BREAK
  742. case 3:
  743. YY_RULE_SETUP
  744. #line 52 "easymesh/easymesh-scanner.l"
  745. { return token::T_CSGSUBSTRACTLOSS; }
  746. YY_BREAK
  747. case 4:
  748. YY_RULE_SETUP
  749. #line 53 "easymesh/easymesh-scanner.l"
  750. { return token::T_CSGAND; }
  751. YY_BREAK
  752. case 5:
  753. YY_RULE_SETUP
  754. #line 54 "easymesh/easymesh-scanner.l"
  755. { return token::T_CSGXOR; }
  756. YY_BREAK
  757. case 6:
  758. YY_RULE_SETUP
  759. #line 56 "easymesh/easymesh-scanner.l"
  760. { return token::T_LOOP; }
  761. YY_BREAK
  762. case 7:
  763. YY_RULE_SETUP
  764. #line 57 "easymesh/easymesh-scanner.l"
  765. { return token::T_COLOR; }
  766. YY_BREAK
  767. case 8:
  768. YY_RULE_SETUP
  769. #line 58 "easymesh/easymesh-scanner.l"
  770. { return token::T_ACOLOR; }
  771. YY_BREAK
  772. case 9:
  773. YY_RULE_SETUP
  774. #line 59 "easymesh/easymesh-scanner.l"
  775. { return token::T_BCOLOR; }
  776. YY_BREAK
  777. case 10:
  778. YY_RULE_SETUP
  779. #line 60 "easymesh/easymesh-scanner.l"
  780. { return token::T_VCOLOR; }
  781. YY_BREAK
  782. case 11:
  783. YY_RULE_SETUP
  784. #line 62 "easymesh/easymesh-scanner.l"
  785. { return token::T_TOGGLESCALEWINDING; }
  786. YY_BREAK
  787. case 12:
  788. YY_RULE_SETUP
  789. #line 63 "easymesh/easymesh-scanner.l"
  790. { return token::T_TOGGLEQUADWEIGHTING; }
  791. YY_BREAK
  792. case 13:
  793. YY_RULE_SETUP
  794. #line 64 "easymesh/easymesh-scanner.l"
  795. { return token::T_TOGGLEPOSTBUILDNORMAL; }
  796. YY_BREAK
  797. case 14:
  798. YY_RULE_SETUP
  799. #line 65 "easymesh/easymesh-scanner.l"
  800. { return token::T_TOGGLEVERTNOCLEANUP; }
  801. YY_BREAK
  802. case 15:
  803. YY_RULE_SETUP
  804. #line 67 "easymesh/easymesh-scanner.l"
  805. { return token::T_VERTMERGE; }
  806. YY_BREAK
  807. case 16:
  808. YY_RULE_SETUP
  809. #line 68 "easymesh/easymesh-scanner.l"
  810. { return token::T_VERTSEPARATE; }
  811. YY_BREAK
  812. case 17:
  813. YY_RULE_SETUP
  814. #line 70 "easymesh/easymesh-scanner.l"
  815. { return token::T_TRANSLATEX; }
  816. YY_BREAK
  817. case 18:
  818. YY_RULE_SETUP
  819. #line 71 "easymesh/easymesh-scanner.l"
  820. { return token::T_TRANSLATEY; }
  821. YY_BREAK
  822. case 19:
  823. YY_RULE_SETUP
  824. #line 72 "easymesh/easymesh-scanner.l"
  825. { return token::T_TRANSLATEZ; }
  826. YY_BREAK
  827. case 20:
  828. YY_RULE_SETUP
  829. #line 73 "easymesh/easymesh-scanner.l"
  830. { return token::T_TRANSLATE; }
  831. YY_BREAK
  832. case 21:
  833. YY_RULE_SETUP
  834. #line 74 "easymesh/easymesh-scanner.l"
  835. { return token::T_ROTATEX; }
  836. YY_BREAK
  837. case 22:
  838. YY_RULE_SETUP
  839. #line 75 "easymesh/easymesh-scanner.l"
  840. { return token::T_ROTATEY; }
  841. YY_BREAK
  842. case 23:
  843. YY_RULE_SETUP
  844. #line 76 "easymesh/easymesh-scanner.l"
  845. { return token::T_ROTATEZ; }
  846. YY_BREAK
  847. case 24:
  848. YY_RULE_SETUP
  849. #line 77 "easymesh/easymesh-scanner.l"
  850. { return token::T_ROTATE; }
  851. YY_BREAK
  852. case 25:
  853. YY_RULE_SETUP
  854. #line 78 "easymesh/easymesh-scanner.l"
  855. { return token::T_RADIALJITTER; }
  856. YY_BREAK
  857. case 26:
  858. YY_RULE_SETUP
  859. #line 79 "easymesh/easymesh-scanner.l"
  860. { return token::T_TAPERX; }
  861. YY_BREAK
  862. case 27:
  863. YY_RULE_SETUP
  864. #line 80 "easymesh/easymesh-scanner.l"
  865. { return token::T_TAPERY; }
  866. YY_BREAK
  867. case 28:
  868. YY_RULE_SETUP
  869. #line 81 "easymesh/easymesh-scanner.l"
  870. { return token::T_TAPERZ; }
  871. YY_BREAK
  872. case 29:
  873. YY_RULE_SETUP
  874. #line 82 "easymesh/easymesh-scanner.l"
  875. { return token::T_TWISTX; }
  876. YY_BREAK
  877. case 30:
  878. YY_RULE_SETUP
  879. #line 83 "easymesh/easymesh-scanner.l"
  880. { return token::T_TWISTY; }
  881. YY_BREAK
  882. case 31:
  883. YY_RULE_SETUP
  884. #line 84 "easymesh/easymesh-scanner.l"
  885. { return token::T_TWISTZ; }
  886. YY_BREAK
  887. case 32:
  888. YY_RULE_SETUP
  889. #line 85 "easymesh/easymesh-scanner.l"
  890. { return token::T_SHEARX; }
  891. YY_BREAK
  892. case 33:
  893. YY_RULE_SETUP
  894. #line 86 "easymesh/easymesh-scanner.l"
  895. { return token::T_SHEARY; }
  896. YY_BREAK
  897. case 34:
  898. YY_RULE_SETUP
  899. #line 87 "easymesh/easymesh-scanner.l"
  900. { return token::T_SHEARZ; }
  901. YY_BREAK
  902. case 35:
  903. YY_RULE_SETUP
  904. #line 88 "easymesh/easymesh-scanner.l"
  905. { return token::T_STRETCHX; }
  906. YY_BREAK
  907. case 36:
  908. YY_RULE_SETUP
  909. #line 89 "easymesh/easymesh-scanner.l"
  910. { return token::T_STRETCHY; }
  911. YY_BREAK
  912. case 37:
  913. YY_RULE_SETUP
  914. #line 90 "easymesh/easymesh-scanner.l"
  915. { return token::T_STRETCHZ; }
  916. YY_BREAK
  917. case 38:
  918. YY_RULE_SETUP
  919. #line 91 "easymesh/easymesh-scanner.l"
  920. { return token::T_BENDXY; }
  921. YY_BREAK
  922. case 39:
  923. YY_RULE_SETUP
  924. #line 92 "easymesh/easymesh-scanner.l"
  925. { return token::T_BENDXZ; }
  926. YY_BREAK
  927. case 40:
  928. YY_RULE_SETUP
  929. #line 93 "easymesh/easymesh-scanner.l"
  930. { return token::T_BENDYX; }
  931. YY_BREAK
  932. case 41:
  933. YY_RULE_SETUP
  934. #line 94 "easymesh/easymesh-scanner.l"
  935. { return token::T_BENDYZ; }
  936. YY_BREAK
  937. case 42:
  938. YY_RULE_SETUP
  939. #line 95 "easymesh/easymesh-scanner.l"
  940. { return token::T_BENDZX; }
  941. YY_BREAK
  942. case 43:
  943. YY_RULE_SETUP
  944. #line 96 "easymesh/easymesh-scanner.l"
  945. { return token::T_BENDZY; }
  946. YY_BREAK
  947. case 44:
  948. YY_RULE_SETUP
  949. #line 97 "easymesh/easymesh-scanner.l"
  950. { return token::T_SCALEX; }
  951. YY_BREAK
  952. case 45:
  953. YY_RULE_SETUP
  954. #line 98 "easymesh/easymesh-scanner.l"
  955. { return token::T_SCALEY; }
  956. YY_BREAK
  957. case 46:
  958. YY_RULE_SETUP
  959. #line 99 "easymesh/easymesh-scanner.l"
  960. { return token::T_SCALEZ; }
  961. YY_BREAK
  962. case 47:
  963. YY_RULE_SETUP
  964. #line 100 "easymesh/easymesh-scanner.l"
  965. { return token::T_SCALE; }
  966. YY_BREAK
  967. case 48:
  968. YY_RULE_SETUP
  969. #line 101 "easymesh/easymesh-scanner.l"
  970. { return token::T_MIRRORX; }
  971. YY_BREAK
  972. case 49:
  973. YY_RULE_SETUP
  974. #line 102 "easymesh/easymesh-scanner.l"
  975. { return token::T_MIRRORY; }
  976. YY_BREAK
  977. case 50:
  978. YY_RULE_SETUP
  979. #line 103 "easymesh/easymesh-scanner.l"
  980. { return token::T_MIRRORZ; }
  981. YY_BREAK
  982. case 51:
  983. YY_RULE_SETUP
  984. #line 104 "easymesh/easymesh-scanner.l"
  985. { return token::T_CHAMFER; }
  986. YY_BREAK
  987. case 52:
  988. YY_RULE_SETUP
  989. #line 105 "easymesh/easymesh-scanner.l"
  990. { return token::T_SPLITTRIANGLE; }
  991. YY_BREAK
  992. case 53:
  993. YY_RULE_SETUP
  994. #line 106 "easymesh/easymesh-scanner.l"
  995. { return token::T_SMOOTHMESH; }
  996. YY_BREAK
  997. case 54:
  998. YY_RULE_SETUP
  999. #line 107 "easymesh/easymesh-scanner.l"
  1000. { return token::T_DUPLICATE; }
  1001. YY_BREAK
  1002. case 55:
  1003. YY_RULE_SETUP
  1004. #line 109 "easymesh/easymesh-scanner.l"
  1005. { return token::T_CYLINDER; }
  1006. YY_BREAK
  1007. case 56:
  1008. YY_RULE_SETUP
  1009. #line 110 "easymesh/easymesh-scanner.l"
  1010. { return token::T_SPHERE; }
  1011. YY_BREAK
  1012. case 57:
  1013. YY_RULE_SETUP
  1014. #line 111 "easymesh/easymesh-scanner.l"
  1015. { return token::T_CAPSULE; }
  1016. YY_BREAK
  1017. case 58:
  1018. YY_RULE_SETUP
  1019. #line 112 "easymesh/easymesh-scanner.l"
  1020. { return token::T_TORUS; }
  1021. YY_BREAK
  1022. case 59:
  1023. YY_RULE_SETUP
  1024. #line 113 "easymesh/easymesh-scanner.l"
  1025. { return token::T_BOX; }
  1026. YY_BREAK
  1027. case 60:
  1028. YY_RULE_SETUP
  1029. #line 114 "easymesh/easymesh-scanner.l"
  1030. { return token::T_SMOOTHCHAMFBOX; }
  1031. YY_BREAK
  1032. case 61:
  1033. YY_RULE_SETUP
  1034. #line 115 "easymesh/easymesh-scanner.l"
  1035. { return token::T_FLATCHAMFBOX; }
  1036. YY_BREAK
  1037. case 62:
  1038. YY_RULE_SETUP
  1039. #line 116 "easymesh/easymesh-scanner.l"
  1040. { return token::T_STAR; }
  1041. YY_BREAK
  1042. case 63:
  1043. YY_RULE_SETUP
  1044. #line 117 "easymesh/easymesh-scanner.l"
  1045. { return token::T_EXPANDEDSTAR; }
  1046. YY_BREAK
  1047. case 64:
  1048. YY_RULE_SETUP
  1049. #line 118 "easymesh/easymesh-scanner.l"
  1050. { return token::T_DISC; }
  1051. YY_BREAK
  1052. case 65:
  1053. YY_RULE_SETUP
  1054. #line 119 "easymesh/easymesh-scanner.l"
  1055. { return token::T_TRIANGLE; }
  1056. YY_BREAK
  1057. case 66:
  1058. YY_RULE_SETUP
  1059. #line 120 "easymesh/easymesh-scanner.l"
  1060. { return token::T_QUAD; }
  1061. YY_BREAK
  1062. case 67:
  1063. YY_RULE_SETUP
  1064. #line 121 "easymesh/easymesh-scanner.l"
  1065. { return token::T_COG; }
  1066. YY_BREAK
  1067. /* ======= BASE COLOR TYPES ========================================= */
  1068. /* COLOR */
  1069. case 68:
  1070. YY_RULE_SETUP
  1071. #line 125 "easymesh/easymesh-scanner.l"
  1072. {
  1073. uint32_t tmp = std::strtol(yytext + 1, nullptr, 16);
  1074. yylval->u32val = 0x11000000u * (tmp >> 8)
  1075. | 0x00110000u * ((tmp >> 4) & 0xf)
  1076. | 0x00001100u * (tmp & 0xf)
  1077. | 0x000000ffu;
  1078. return token::COLOR; }
  1079. YY_BREAK
  1080. case 69:
  1081. YY_RULE_SETUP
  1082. #line 132 "easymesh/easymesh-scanner.l"
  1083. {
  1084. uint32_t tmp = std::strtol(yytext + 1, nullptr, 16);
  1085. yylval->u32val = 0x11000000u * (tmp >> 12)
  1086. | 0x00110000u * ((tmp >> 8) & 0xf)
  1087. | 0x00001100u * ((tmp >> 4) & 0xf)
  1088. | 0x00000011u * (tmp & 0xf);
  1089. return token::COLOR; }
  1090. YY_BREAK
  1091. case 70:
  1092. YY_RULE_SETUP
  1093. #line 139 "easymesh/easymesh-scanner.l"
  1094. {
  1095. yylval->u32val = 0xffu
  1096. | 0x100u * (uint32_t)std::strtol(yytext + 1, nullptr, 16);
  1097. return token::COLOR; }
  1098. YY_BREAK
  1099. case 71:
  1100. YY_RULE_SETUP
  1101. #line 143 "easymesh/easymesh-scanner.l"
  1102. {
  1103. yylval->u32val = (uint32_t)std::strtol(yytext + 1, nullptr, 16);
  1104. return token::COLOR; }
  1105. YY_BREAK
  1106. /* ======= BASE DATA TYPES ========================================= */
  1107. /* BOOL */
  1108. case 72:
  1109. YY_RULE_SETUP
  1110. #line 149 "easymesh/easymesh-scanner.l"
  1111. { yylval->bval = true; return token::BOOLEAN; }
  1112. YY_BREAK
  1113. case 73:
  1114. YY_RULE_SETUP
  1115. #line 150 "easymesh/easymesh-scanner.l"
  1116. { yylval->bval = false; return token::BOOLEAN; }
  1117. YY_BREAK
  1118. /* FLOAT */
  1119. case 74:
  1120. YY_RULE_SETUP
  1121. #line 152 "easymesh/easymesh-scanner.l"
  1122. {
  1123. yylval->fval = (float)std::atof(yytext); return token::F_NUMBER; }
  1124. YY_BREAK
  1125. /* INT */
  1126. case 75:
  1127. YY_RULE_SETUP
  1128. #line 155 "easymesh/easymesh-scanner.l"
  1129. {
  1130. yylval->ival = std::atoi(yytext); return token::I_NUMBER; }
  1131. YY_BREAK
  1132. /* ======= COMMENTS ======= */
  1133. case 76:
  1134. YY_RULE_SETUP
  1135. #line 159 "easymesh/easymesh-scanner.l"
  1136. { /* ignore this */ }
  1137. YY_BREAK
  1138. /* Semantics tokens */
  1139. case 77:
  1140. YY_RULE_SETUP
  1141. #line 162 "easymesh/easymesh-scanner.l"
  1142. { return token_type('-'); }
  1143. YY_BREAK
  1144. case 78:
  1145. YY_RULE_SETUP
  1146. #line 163 "easymesh/easymesh-scanner.l"
  1147. { return token_type('('); }
  1148. YY_BREAK
  1149. case 79:
  1150. YY_RULE_SETUP
  1151. #line 164 "easymesh/easymesh-scanner.l"
  1152. { return token_type(')'); }
  1153. YY_BREAK
  1154. case 80:
  1155. YY_RULE_SETUP
  1156. #line 165 "easymesh/easymesh-scanner.l"
  1157. { return token_type('{'); }
  1158. YY_BREAK
  1159. case 81:
  1160. YY_RULE_SETUP
  1161. #line 166 "easymesh/easymesh-scanner.l"
  1162. { return token_type('}'); }
  1163. YY_BREAK
  1164. case 82:
  1165. YY_RULE_SETUP
  1166. #line 167 "easymesh/easymesh-scanner.l"
  1167. { return token_type('['); }
  1168. YY_BREAK
  1169. case 83:
  1170. YY_RULE_SETUP
  1171. #line 168 "easymesh/easymesh-scanner.l"
  1172. { return token_type(']'); }
  1173. YY_BREAK
  1174. case 84:
  1175. YY_RULE_SETUP
  1176. #line 169 "easymesh/easymesh-scanner.l"
  1177. { /* ignore this */ }
  1178. YY_BREAK
  1179. case 85:
  1180. /* rule 85 can match eol */
  1181. YY_RULE_SETUP
  1182. #line 170 "easymesh/easymesh-scanner.l"
  1183. { /* ignore this */ }
  1184. YY_BREAK
  1185. case 86:
  1186. YY_RULE_SETUP
  1187. #line 171 "easymesh/easymesh-scanner.l"
  1188. { return token::T_ERROR; }
  1189. YY_BREAK
  1190. case 87:
  1191. YY_RULE_SETUP
  1192. #line 173 "easymesh/easymesh-scanner.l"
  1193. ECHO;
  1194. YY_BREAK
  1195. #line 1341 "generated/easymesh-scanner.cpp"
  1196. case YY_STATE_EOF(INITIAL):
  1197. yyterminate();
  1198. case YY_END_OF_BUFFER:
  1199. {
  1200. /* Amount of text matched not including the EOB char. */
  1201. int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
  1202. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  1203. *yy_cp = (yy_hold_char);
  1204. YY_RESTORE_YY_MORE_OFFSET
  1205. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  1206. {
  1207. /* We're scanning a new file or input source. It's
  1208. * possible that this happened because the user
  1209. * just pointed yyin at a new source and called
  1210. * yylex(). If so, then we have to assure
  1211. * consistency between YY_CURRENT_BUFFER and our
  1212. * globals. Here is the right place to do so, because
  1213. * this is the first action (other than possibly a
  1214. * back-up) that will match for the new input source.
  1215. */
  1216. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1217. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  1218. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  1219. }
  1220. /* Note that here we test for yy_c_buf_p "<=" to the position
  1221. * of the first EOB in the buffer, since yy_c_buf_p will
  1222. * already have been incremented past the NUL character
  1223. * (since all states make transitions on EOB to the
  1224. * end-of-buffer state). Contrast this with the test
  1225. * in input().
  1226. */
  1227. if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
  1228. { /* This was really a NUL. */
  1229. yy_state_type yy_next_state;
  1230. (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
  1231. yy_current_state = yy_get_previous_state( );
  1232. /* Okay, we're now positioned to make the NUL
  1233. * transition. We couldn't have
  1234. * yy_get_previous_state() go ahead and do it
  1235. * for us because it doesn't know how to deal
  1236. * with the possibility of jamming (and we don't
  1237. * want to build jamming into it because then it
  1238. * will run more slowly).
  1239. */
  1240. yy_next_state = yy_try_NUL_trans( yy_current_state );
  1241. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  1242. if ( yy_next_state )
  1243. {
  1244. /* Consume the NUL. */
  1245. yy_cp = ++(yy_c_buf_p);
  1246. yy_current_state = yy_next_state;
  1247. goto yy_match;
  1248. }
  1249. else
  1250. {
  1251. yy_cp = (yy_last_accepting_cpos);
  1252. yy_current_state = (yy_last_accepting_state);
  1253. goto yy_find_action;
  1254. }
  1255. }
  1256. else switch ( yy_get_next_buffer( ) )
  1257. {
  1258. case EOB_ACT_END_OF_FILE:
  1259. {
  1260. (yy_did_buffer_switch_on_eof) = 0;
  1261. if ( yywrap( ) )
  1262. {
  1263. /* Note: because we've taken care in
  1264. * yy_get_next_buffer() to have set up
  1265. * yytext, we can now set up
  1266. * yy_c_buf_p so that if some total
  1267. * hoser (like flex itself) wants to
  1268. * call the scanner after we return the
  1269. * YY_NULL, it'll still work - another
  1270. * YY_NULL will get returned.
  1271. */
  1272. (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
  1273. yy_act = YY_STATE_EOF(YY_START);
  1274. goto do_action;
  1275. }
  1276. else
  1277. {
  1278. if ( ! (yy_did_buffer_switch_on_eof) )
  1279. YY_NEW_FILE;
  1280. }
  1281. break;
  1282. }
  1283. case EOB_ACT_CONTINUE_SCAN:
  1284. (yy_c_buf_p) =
  1285. (yytext_ptr) + yy_amount_of_matched_text;
  1286. yy_current_state = yy_get_previous_state( );
  1287. yy_cp = (yy_c_buf_p);
  1288. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  1289. goto yy_match;
  1290. case EOB_ACT_LAST_MATCH:
  1291. (yy_c_buf_p) =
  1292. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
  1293. yy_current_state = yy_get_previous_state( );
  1294. yy_cp = (yy_c_buf_p);
  1295. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  1296. goto yy_find_action;
  1297. }
  1298. break;
  1299. }
  1300. default:
  1301. YY_FATAL_ERROR(
  1302. "fatal flex scanner internal error--no action found" );
  1303. } /* end of action switch */
  1304. } /* end of scanning one token */
  1305. } /* end of yylex */
  1306. /* The contents of this function are C++ specific, so the () macro is not used.
  1307. */
  1308. yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )
  1309. {
  1310. yyin = arg_yyin;
  1311. yyout = arg_yyout;
  1312. yy_c_buf_p = 0;
  1313. yy_init = 0;
  1314. yy_start = 0;
  1315. yy_flex_debug = 0;
  1316. yylineno = 1; // this will only get updated if %option yylineno
  1317. yy_did_buffer_switch_on_eof = 0;
  1318. yy_looking_for_trail_begin = 0;
  1319. yy_more_flag = 0;
  1320. yy_more_len = 0;
  1321. yy_more_offset = yy_prev_more_offset = 0;
  1322. yy_start_stack_ptr = yy_start_stack_depth = 0;
  1323. yy_start_stack = NULL;
  1324. yy_buffer_stack = 0;
  1325. yy_buffer_stack_top = 0;
  1326. yy_buffer_stack_max = 0;
  1327. yy_state_buf = 0;
  1328. }
  1329. /* The contents of this function are C++ specific, so the () macro is not used.
  1330. */
  1331. yyFlexLexer::~yyFlexLexer()
  1332. {
  1333. delete [] yy_state_buf;
  1334. EasyMeshfree(yy_start_stack );
  1335. yy_delete_buffer( YY_CURRENT_BUFFER );
  1336. EasyMeshfree(yy_buffer_stack );
  1337. }
  1338. /* The contents of this function are C++ specific, so the () macro is not used.
  1339. */
  1340. void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
  1341. {
  1342. if ( new_in )
  1343. {
  1344. yy_delete_buffer( YY_CURRENT_BUFFER );
  1345. yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
  1346. }
  1347. if ( new_out )
  1348. yyout = new_out;
  1349. }
  1350. #ifdef YY_INTERACTIVE
  1351. int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
  1352. #else
  1353. int yyFlexLexer::LexerInput( char* buf, int max_size )
  1354. #endif
  1355. {
  1356. if ( yyin->eof() || yyin->fail() )
  1357. return 0;
  1358. #ifdef YY_INTERACTIVE
  1359. yyin->get( buf[0] );
  1360. if ( yyin->eof() )
  1361. return 0;
  1362. if ( yyin->bad() )
  1363. return -1;
  1364. return 1;
  1365. #else
  1366. (void) yyin->read( buf, max_size );
  1367. if ( yyin->bad() )
  1368. return -1;
  1369. else
  1370. return yyin->gcount();
  1371. #endif
  1372. }
  1373. void yyFlexLexer::LexerOutput( const char* buf, int size )
  1374. {
  1375. (void) yyout->write( buf, size );
  1376. }
  1377. /* yy_get_next_buffer - try to read in a new buffer
  1378. *
  1379. * Returns a code representing an action:
  1380. * EOB_ACT_LAST_MATCH -
  1381. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  1382. * EOB_ACT_END_OF_FILE - end of file
  1383. */
  1384. int yyFlexLexer::yy_get_next_buffer()
  1385. {
  1386. register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  1387. register char *source = (yytext_ptr);
  1388. register int number_to_move, i;
  1389. int ret_val;
  1390. if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
  1391. YY_FATAL_ERROR(
  1392. "fatal flex scanner internal error--end of buffer missed" );
  1393. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  1394. { /* Don't try to fill the buffer, so this is an EOF. */
  1395. if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
  1396. {
  1397. /* We matched a single character, the EOB, so
  1398. * treat this as a final EOF.
  1399. */
  1400. return EOB_ACT_END_OF_FILE;
  1401. }
  1402. else
  1403. {
  1404. /* We matched some text prior to the EOB, first
  1405. * process it.
  1406. */
  1407. return EOB_ACT_LAST_MATCH;
  1408. }
  1409. }
  1410. /* Try to read more data. */
  1411. /* First move last chars to start of buffer. */
  1412. number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
  1413. for ( i = 0; i < number_to_move; ++i )
  1414. *(dest++) = *(source++);
  1415. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  1416. /* don't do the read, it's not guaranteed to return an EOF,
  1417. * just force an EOF
  1418. */
  1419. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
  1420. else
  1421. {
  1422. int num_to_read =
  1423. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  1424. while ( num_to_read <= 0 )
  1425. { /* Not enough room in the buffer - grow it. */
  1426. /* just a shorter name for the current buffer */
  1427. YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
  1428. int yy_c_buf_p_offset =
  1429. (int) ((yy_c_buf_p) - b->yy_ch_buf);
  1430. if ( b->yy_is_our_buffer )
  1431. {
  1432. int new_size = b->yy_buf_size * 2;
  1433. if ( new_size <= 0 )
  1434. b->yy_buf_size += b->yy_buf_size / 8;
  1435. else
  1436. b->yy_buf_size *= 2;
  1437. b->yy_ch_buf = (char *)
  1438. /* Include room in for 2 EOB chars. */
  1439. EasyMeshrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
  1440. }
  1441. else
  1442. /* Can't grow it, we don't own it. */
  1443. b->yy_ch_buf = 0;
  1444. if ( ! b->yy_ch_buf )
  1445. YY_FATAL_ERROR(
  1446. "fatal error - scanner input buffer overflow" );
  1447. (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
  1448. num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  1449. number_to_move - 1;
  1450. }
  1451. if ( num_to_read > YY_READ_BUF_SIZE )
  1452. num_to_read = YY_READ_BUF_SIZE;
  1453. /* Read in more data. */
  1454. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  1455. (yy_n_chars), (size_t) num_to_read );
  1456. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1457. }
  1458. if ( (yy_n_chars) == 0 )
  1459. {
  1460. if ( number_to_move == YY_MORE_ADJ )
  1461. {
  1462. ret_val = EOB_ACT_END_OF_FILE;
  1463. yyrestart( yyin );
  1464. }
  1465. else
  1466. {
  1467. ret_val = EOB_ACT_LAST_MATCH;
  1468. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  1469. YY_BUFFER_EOF_PENDING;
  1470. }
  1471. }
  1472. else
  1473. ret_val = EOB_ACT_CONTINUE_SCAN;
  1474. if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
  1475. /* Extend the array by 50%, plus the number we really need. */
  1476. yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
  1477. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) EasyMeshrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
  1478. if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1479. YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
  1480. }
  1481. (yy_n_chars) += number_to_move;
  1482. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
  1483. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
  1484. (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  1485. return ret_val;
  1486. }
  1487. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1488. yy_state_type yyFlexLexer::yy_get_previous_state()
  1489. {
  1490. register yy_state_type yy_current_state;
  1491. register char *yy_cp;
  1492. yy_current_state = (yy_start);
  1493. for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
  1494. {
  1495. register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  1496. if ( yy_accept[yy_current_state] )
  1497. {
  1498. (yy_last_accepting_state) = yy_current_state;
  1499. (yy_last_accepting_cpos) = yy_cp;
  1500. }
  1501. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1502. {
  1503. yy_current_state = (int) yy_def[yy_current_state];
  1504. if ( yy_current_state >= 376 )
  1505. yy_c = yy_meta[(unsigned int) yy_c];
  1506. }
  1507. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1508. }
  1509. return yy_current_state;
  1510. }
  1511. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1512. *
  1513. * synopsis
  1514. * next_state = yy_try_NUL_trans( current_state );
  1515. */
  1516. yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
  1517. {
  1518. register int yy_is_jam;
  1519. register char *yy_cp = (yy_c_buf_p);
  1520. register YY_CHAR yy_c = 1;
  1521. if ( yy_accept[yy_current_state] )
  1522. {
  1523. (yy_last_accepting_state) = yy_current_state;
  1524. (yy_last_accepting_cpos) = yy_cp;
  1525. }
  1526. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1527. {
  1528. yy_current_state = (int) yy_def[yy_current_state];
  1529. if ( yy_current_state >= 376 )
  1530. yy_c = yy_meta[(unsigned int) yy_c];
  1531. }
  1532. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1533. yy_is_jam = (yy_current_state == 375);
  1534. return yy_is_jam ? 0 : yy_current_state;
  1535. }
  1536. void yyFlexLexer::yyunput( int c, register char* yy_bp)
  1537. {
  1538. register char *yy_cp;
  1539. yy_cp = (yy_c_buf_p);
  1540. /* undo effects of setting up yytext */
  1541. *yy_cp = (yy_hold_char);
  1542. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1543. { /* need to shift things up to make room */
  1544. /* +2 for EOB chars. */
  1545. register int number_to_move = (yy_n_chars) + 2;
  1546. register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
  1547. YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
  1548. register char *source =
  1549. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
  1550. while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1551. *--dest = *--source;
  1552. yy_cp += (int) (dest - source);
  1553. yy_bp += (int) (dest - source);
  1554. YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
  1555. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
  1556. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1557. YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1558. }
  1559. *--yy_cp = (char) c;
  1560. (yytext_ptr) = yy_bp;
  1561. (yy_hold_char) = *yy_cp;
  1562. (yy_c_buf_p) = yy_cp;
  1563. }
  1564. int yyFlexLexer::yyinput()
  1565. {
  1566. int c;
  1567. *(yy_c_buf_p) = (yy_hold_char);
  1568. if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
  1569. {
  1570. /* yy_c_buf_p now points to the character we want to return.
  1571. * If this occurs *before* the EOB characters, then it's a
  1572. * valid NUL; if not, then we've hit the end of the buffer.
  1573. */
  1574. if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
  1575. /* This was really a NUL. */
  1576. *(yy_c_buf_p) = '\0';
  1577. else
  1578. { /* need more input */
  1579. int offset = (yy_c_buf_p) - (yytext_ptr);
  1580. ++(yy_c_buf_p);
  1581. switch ( yy_get_next_buffer( ) )
  1582. {
  1583. case EOB_ACT_LAST_MATCH:
  1584. /* This happens because yy_g_n_b()
  1585. * sees that we've accumulated a
  1586. * token and flags that we need to
  1587. * try matching the token before
  1588. * proceeding. But for input(),
  1589. * there's no matching to consider.
  1590. * So convert the EOB_ACT_LAST_MATCH
  1591. * to EOB_ACT_END_OF_FILE.
  1592. */
  1593. /* Reset buffer status. */
  1594. yyrestart( yyin );
  1595. /*FALLTHROUGH*/
  1596. case EOB_ACT_END_OF_FILE:
  1597. {
  1598. if ( yywrap( ) )
  1599. return EOF;
  1600. if ( ! (yy_did_buffer_switch_on_eof) )
  1601. YY_NEW_FILE;
  1602. #ifdef __cplusplus
  1603. return yyinput();
  1604. #else
  1605. return input();
  1606. #endif
  1607. }
  1608. case EOB_ACT_CONTINUE_SCAN:
  1609. (yy_c_buf_p) = (yytext_ptr) + offset;
  1610. break;
  1611. }
  1612. }
  1613. }
  1614. c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
  1615. *(yy_c_buf_p) = '\0'; /* preserve yytext */
  1616. (yy_hold_char) = *++(yy_c_buf_p);
  1617. return c;
  1618. }
  1619. /** Immediately switch to a different input stream.
  1620. * @param input_file A readable stream.
  1621. *
  1622. * @note This function does not reset the start condition to @c INITIAL .
  1623. */
  1624. void yyFlexLexer::yyrestart( std::istream* input_file )
  1625. {
  1626. if ( ! YY_CURRENT_BUFFER ){
  1627. yyensure_buffer_stack ();
  1628. YY_CURRENT_BUFFER_LVALUE =
  1629. yy_create_buffer( yyin, YY_BUF_SIZE );
  1630. }
  1631. yy_init_buffer( YY_CURRENT_BUFFER, input_file );
  1632. yy_load_buffer_state( );
  1633. }
  1634. /** Switch to a different input buffer.
  1635. * @param new_buffer The new input buffer.
  1636. *
  1637. */
  1638. void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1639. {
  1640. /* TODO. We should be able to replace this entire function body
  1641. * with
  1642. * yypop_buffer_state();
  1643. * yypush_buffer_state(new_buffer);
  1644. */
  1645. yyensure_buffer_stack ();
  1646. if ( YY_CURRENT_BUFFER == new_buffer )
  1647. return;
  1648. if ( YY_CURRENT_BUFFER )
  1649. {
  1650. /* Flush out information for old buffer. */
  1651. *(yy_c_buf_p) = (yy_hold_char);
  1652. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
  1653. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1654. }
  1655. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1656. yy_load_buffer_state( );
  1657. /* We don't actually know whether we did this switch during
  1658. * EOF (yywrap()) processing, but the only time this flag
  1659. * is looked at is after yywrap() is called, so it's safe
  1660. * to go ahead and always set it.
  1661. */
  1662. (yy_did_buffer_switch_on_eof) = 1;
  1663. }
  1664. void yyFlexLexer::yy_load_buffer_state()
  1665. {
  1666. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1667. (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  1668. yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  1669. (yy_hold_char) = *(yy_c_buf_p);
  1670. }
  1671. /** Allocate and initialize an input buffer state.
  1672. * @param file A readable stream.
  1673. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  1674. *
  1675. * @return the allocated buffer state.
  1676. */
  1677. YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
  1678. {
  1679. YY_BUFFER_STATE b;
  1680. b = (YY_BUFFER_STATE) EasyMeshalloc(sizeof( struct yy_buffer_state ) );
  1681. if ( ! b )
  1682. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1683. b->yy_buf_size = size;
  1684. /* yy_ch_buf has to be 2 characters longer than the size given because
  1685. * we need to put in 2 end-of-buffer characters.
  1686. */
  1687. b->yy_ch_buf = (char *) EasyMeshalloc(b->yy_buf_size + 2 );
  1688. if ( ! b->yy_ch_buf )
  1689. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1690. b->yy_is_our_buffer = 1;
  1691. yy_init_buffer( b, file );
  1692. return b;
  1693. }
  1694. /** Destroy the buffer.
  1695. * @param b a buffer created with yy_create_buffer()
  1696. *
  1697. */
  1698. void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
  1699. {
  1700. if ( ! b )
  1701. return;
  1702. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  1703. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  1704. if ( b->yy_is_our_buffer )
  1705. EasyMeshfree((void *) b->yy_ch_buf );
  1706. EasyMeshfree((void *) b );
  1707. }
  1708. extern "C" int isatty (int );
  1709. /* Initializes or reinitializes a buffer.
  1710. * This function is sometimes called more than once on the same buffer,
  1711. * such as during a yyrestart() or at EOF.
  1712. */
  1713. void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )
  1714. {
  1715. int oerrno = errno;
  1716. yy_flush_buffer( b );
  1717. b->yy_input_file = file;
  1718. b->yy_fill_buffer = 1;
  1719. /* If b is the current buffer, then yy_init_buffer was _probably_
  1720. * called from yyrestart() or through yy_get_next_buffer.
  1721. * In that case, we don't want to reset the lineno or column.
  1722. */
  1723. if (b != YY_CURRENT_BUFFER){
  1724. b->yy_bs_lineno = 1;
  1725. b->yy_bs_column = 0;
  1726. }
  1727. b->yy_is_interactive = 0;
  1728. errno = oerrno;
  1729. }
  1730. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  1731. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  1732. *
  1733. */
  1734. void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
  1735. {
  1736. if ( ! b )
  1737. return;
  1738. b->yy_n_chars = 0;
  1739. /* We always need two end-of-buffer characters. The first causes
  1740. * a transition to the end-of-buffer state. The second causes
  1741. * a jam in that state.
  1742. */
  1743. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1744. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1745. b->yy_buf_pos = &b->yy_ch_buf[0];
  1746. b->yy_at_bol = 1;
  1747. b->yy_buffer_status = YY_BUFFER_NEW;
  1748. if ( b == YY_CURRENT_BUFFER )
  1749. yy_load_buffer_state( );
  1750. }
  1751. /** Pushes the new state onto the stack. The new state becomes
  1752. * the current state. This function will allocate the stack
  1753. * if necessary.
  1754. * @param new_buffer The new state.
  1755. *
  1756. */
  1757. void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer)
  1758. {
  1759. if (new_buffer == NULL)
  1760. return;
  1761. yyensure_buffer_stack();
  1762. /* This block is copied from yy_switch_to_buffer. */
  1763. if ( YY_CURRENT_BUFFER )
  1764. {
  1765. /* Flush out information for old buffer. */
  1766. *(yy_c_buf_p) = (yy_hold_char);
  1767. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
  1768. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1769. }
  1770. /* Only push if top exists. Otherwise, replace top. */
  1771. if (YY_CURRENT_BUFFER)
  1772. (yy_buffer_stack_top)++;
  1773. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1774. /* copied from yy_switch_to_buffer. */
  1775. yy_load_buffer_state( );
  1776. (yy_did_buffer_switch_on_eof) = 1;
  1777. }
  1778. /** Removes and deletes the top of the stack, if present.
  1779. * The next element becomes the new top.
  1780. *
  1781. */
  1782. void yyFlexLexer::yypop_buffer_state (void)
  1783. {
  1784. if (!YY_CURRENT_BUFFER)
  1785. return;
  1786. yy_delete_buffer(YY_CURRENT_BUFFER );
  1787. YY_CURRENT_BUFFER_LVALUE = NULL;
  1788. if ((yy_buffer_stack_top) > 0)
  1789. --(yy_buffer_stack_top);
  1790. if (YY_CURRENT_BUFFER) {
  1791. yy_load_buffer_state( );
  1792. (yy_did_buffer_switch_on_eof) = 1;
  1793. }
  1794. }
  1795. /* Allocates the stack if it does not exist.
  1796. * Guarantees space for at least one push.
  1797. */
  1798. void yyFlexLexer::yyensure_buffer_stack(void)
  1799. {
  1800. int num_to_alloc;
  1801. if (!(yy_buffer_stack)) {
  1802. /* First allocation is just for 2 elements, since we don't know if this
  1803. * scanner will even need a stack. We use 2 instead of 1 to avoid an
  1804. * immediate realloc on the next call.
  1805. */
  1806. num_to_alloc = 1;
  1807. (yy_buffer_stack) = (struct yy_buffer_state**)EasyMeshalloc
  1808. (num_to_alloc * sizeof(struct yy_buffer_state*)
  1809. );
  1810. if ( ! (yy_buffer_stack) )
  1811. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1812. memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  1813. (yy_buffer_stack_max) = num_to_alloc;
  1814. (yy_buffer_stack_top) = 0;
  1815. return;
  1816. }
  1817. if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
  1818. /* Increase the buffer to prepare for a possible push. */
  1819. int grow_size = 8 /* arbitrary grow size */;
  1820. num_to_alloc = (yy_buffer_stack_max) + grow_size;
  1821. (yy_buffer_stack) = (struct yy_buffer_state**)EasyMeshrealloc
  1822. ((yy_buffer_stack),
  1823. num_to_alloc * sizeof(struct yy_buffer_state*)
  1824. );
  1825. if ( ! (yy_buffer_stack) )
  1826. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1827. /* zero only the new slots.*/
  1828. memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
  1829. (yy_buffer_stack_max) = num_to_alloc;
  1830. }
  1831. }
  1832. void yyFlexLexer::yy_push_state( int new_state )
  1833. {
  1834. if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
  1835. {
  1836. yy_size_t new_size;
  1837. (yy_start_stack_depth) += YY_START_STACK_INCR;
  1838. new_size = (yy_start_stack_depth) * sizeof( int );
  1839. if ( ! (yy_start_stack) )
  1840. (yy_start_stack) = (int *) EasyMeshalloc(new_size );
  1841. else
  1842. (yy_start_stack) = (int *) EasyMeshrealloc((void *) (yy_start_stack),new_size );
  1843. if ( ! (yy_start_stack) )
  1844. YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
  1845. }
  1846. (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
  1847. BEGIN(new_state);
  1848. }
  1849. void yyFlexLexer::yy_pop_state()
  1850. {
  1851. if ( --(yy_start_stack_ptr) < 0 )
  1852. YY_FATAL_ERROR( "start-condition stack underflow" );
  1853. BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
  1854. }
  1855. int yyFlexLexer::yy_top_state()
  1856. {
  1857. return (yy_start_stack)[(yy_start_stack_ptr) - 1];
  1858. }
  1859. #ifndef YY_EXIT_FAILURE
  1860. #define YY_EXIT_FAILURE 2
  1861. #endif
  1862. void yyFlexLexer::LexerError( yyconst char msg[] )
  1863. {
  1864. std::cerr << msg << std::endl;
  1865. exit( YY_EXIT_FAILURE );
  1866. }
  1867. /* Redefine yyless() so it works in section 3 code. */
  1868. #undef yyless
  1869. #define yyless(n) \
  1870. do \
  1871. { \
  1872. /* Undo effects of setting up yytext. */ \
  1873. int yyless_macro_arg = (n); \
  1874. YY_LESS_LINENO(yyless_macro_arg);\
  1875. yytext[yyleng] = (yy_hold_char); \
  1876. (yy_c_buf_p) = yytext + yyless_macro_arg; \
  1877. (yy_hold_char) = *(yy_c_buf_p); \
  1878. *(yy_c_buf_p) = '\0'; \
  1879. yyleng = yyless_macro_arg; \
  1880. } \
  1881. while ( 0 )
  1882. /* Accessor methods (get/set functions) to struct members. */
  1883. /*
  1884. * Internal utility routines.
  1885. */
  1886. #ifndef yytext_ptr
  1887. static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
  1888. {
  1889. register int i;
  1890. for ( i = 0; i < n; ++i )
  1891. s1[i] = s2[i];
  1892. }
  1893. #endif
  1894. #ifdef YY_NEED_STRLEN
  1895. static int yy_flex_strlen (yyconst char * s )
  1896. {
  1897. register int n;
  1898. for ( n = 0; s[n]; ++n )
  1899. ;
  1900. return n;
  1901. }
  1902. #endif
  1903. void *EasyMeshalloc (yy_size_t size )
  1904. {
  1905. return (void *) malloc( size );
  1906. }
  1907. void *EasyMeshrealloc (void * ptr, yy_size_t size )
  1908. {
  1909. /* The cast to (char *) in the following accommodates both
  1910. * implementations that use char* generic pointers, and those
  1911. * that use void* generic pointers. It works with the latter
  1912. * because both ANSI C and C++ allow castless assignment from
  1913. * any pointer type to void*, and deal with argument conversions
  1914. * as though doing an assignment.
  1915. */
  1916. return (void *) realloc( (char *) ptr, size );
  1917. }
  1918. void EasyMeshfree (void * ptr )
  1919. {
  1920. free( (char *) ptr ); /* see EasyMeshrealloc() for (char *) cast */
  1921. }
  1922. #define YYTABLES_NAME "yytables"
  1923. #line 173 "easymesh/easymesh-scanner.l"
  1924. lol::EasyMeshScanner::EasyMeshScanner(char const *command)
  1925. : EasyMeshFlexLexer(0, 0),
  1926. m_input(command)
  1927. {
  1928. }
  1929. lol::EasyMeshScanner::~EasyMeshScanner()
  1930. {
  1931. }
  1932. int lol::EasyMeshScanner::LexerInput(char* buf, int max_size)
  1933. {
  1934. (void)max_size; /* unused for now */
  1935. buf[0] = m_input[0];
  1936. if (buf[0])
  1937. ++m_input;
  1938. return buf[0] ? 1 : 0;
  1939. }
  1940. #ifdef yylex
  1941. #undef yylex
  1942. #endif
  1943. int EasyMeshFlexLexer::yylex()
  1944. {
  1945. std::cerr << "in EasyMeshFlexLexer::yylex() !" << std::endl;
  1946. return 0;
  1947. }
  1948. int EasyMeshFlexLexer::yywrap()
  1949. {
  1950. return 1;
  1951. }