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.

easymesh-scanner.cpp 48 KiB

пре 12 година
пре 12 година
пре 12 година
пре 12 година
пре 12 година
пре 12 година
пре 12 година
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874
  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 45
  267. #define YY_END_OF_BUFFER 46
  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[73] =
  276. { 0,
  277. 0, 0, 46, 44, 43, 42, 44, 44, 39, 44,
  278. 38, 40, 41, 44, 44, 44, 44, 17, 7, 0,
  279. 0, 38, 38, 0, 21, 22, 25, 0, 0, 28,
  280. 29, 32, 3, 18, 19, 20, 8, 9, 10, 1,
  281. 14, 15, 16, 0, 4, 5, 6, 0, 0, 38,
  282. 0, 24, 26, 0, 0, 0, 33, 2, 11, 12,
  283. 13, 34, 23, 27, 30, 31, 35, 0, 36, 0,
  284. 37, 0
  285. } ;
  286. static yyconst flex_int32_t yy_ec[256] =
  287. { 0,
  288. 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
  289. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  290. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  291. 1, 3, 1, 1, 4, 1, 1, 1, 1, 1,
  292. 1, 1, 5, 3, 6, 7, 1, 8, 8, 8,
  293. 8, 8, 8, 8, 8, 8, 8, 1, 1, 1,
  294. 1, 1, 1, 1, 9, 9, 9, 9, 10, 9,
  295. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  296. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  297. 11, 1, 12, 1, 1, 1, 13, 14, 15, 16,
  298. 17, 18, 19, 20, 1, 1, 1, 1, 21, 1,
  299. 22, 23, 24, 25, 26, 27, 1, 1, 1, 28,
  300. 29, 30, 1, 1, 1, 1, 1, 1, 1, 1,
  301. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  302. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  303. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  304. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  305. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  306. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  307. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  308. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  309. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  310. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  311. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  312. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  313. 1, 1, 1, 1, 1
  314. } ;
  315. static yyconst flex_int32_t yy_meta[31] =
  316. { 0,
  317. 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
  318. 1, 1, 2, 2, 2, 2, 2, 2, 1, 1,
  319. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
  320. } ;
  321. static yyconst flex_int16_t yy_base[81] =
  322. { 0,
  323. 0, 0, 99, 100, 100, 100, 0, 24, 26, 90,
  324. 28, 100, 100, 32, 77, 11, 14, 36, 24, 0,
  325. 88, 53, 59, 66, 100, 49, 100, 69, 79, 100,
  326. 58, 71, 100, 100, 100, 100, 100, 100, 100, 78,
  327. 100, 100, 100, 49, 100, 100, 100, 0, 83, 82,
  328. 66, 100, 100, 74, 73, 66, 100, 100, 100, 100,
  329. 100, 0, 100, 100, 100, 100, 0, 0, 0, 0,
  330. 100, 100, 83, 82, 81, 80, 78, 73, 55, 53
  331. } ;
  332. static yyconst flex_int16_t yy_def[81] =
  333. { 0,
  334. 72, 1, 72, 72, 72, 72, 73, 72, 72, 72,
  335. 72, 72, 72, 72, 72, 72, 72, 72, 72, 74,
  336. 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
  337. 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
  338. 72, 72, 72, 72, 72, 72, 72, 75, 72, 72,
  339. 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
  340. 72, 76, 72, 72, 72, 72, 77, 78, 79, 80,
  341. 72, 0, 72, 72, 72, 72, 72, 72, 72, 72
  342. } ;
  343. static yyconst flex_int16_t yy_nxt[131] =
  344. { 0,
  345. 4, 5, 6, 7, 8, 9, 10, 11, 4, 4,
  346. 12, 13, 14, 4, 15, 4, 4, 4, 4, 4,
  347. 16, 4, 4, 4, 17, 18, 19, 4, 4, 4,
  348. 21, 22, 21, 22, 21, 22, 44, 24, 34, 35,
  349. 36, 37, 38, 39, 24, 25, 26, 27, 28, 29,
  350. 40, 45, 46, 47, 71, 30, 70, 31, 32, 21,
  351. 22, 51, 24, 41, 42, 43, 23, 52, 24, 24,
  352. 49, 49, 55, 50, 69, 24, 59, 60, 61, 68,
  353. 56, 67, 62, 48, 20, 66, 65, 64, 63, 50,
  354. 50, 58, 57, 54, 53, 23, 33, 23, 72, 3,
  355. 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
  356. 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
  357. 72, 72, 72, 72, 72, 72, 72, 72, 72, 72
  358. } ;
  359. static yyconst flex_int16_t yy_chk[131] =
  360. { 0,
  361. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  362. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  363. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  364. 8, 8, 9, 9, 11, 11, 19, 11, 16, 16,
  365. 16, 17, 17, 17, 11, 14, 14, 14, 14, 14,
  366. 18, 19, 19, 19, 80, 14, 79, 14, 14, 22,
  367. 22, 26, 22, 18, 18, 18, 23, 26, 23, 22,
  368. 24, 24, 31, 24, 78, 23, 44, 44, 44, 77,
  369. 31, 76, 75, 74, 73, 56, 55, 54, 51, 50,
  370. 49, 40, 32, 29, 28, 21, 15, 10, 3, 72,
  371. 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
  372. 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
  373. 72, 72, 72, 72, 72, 72, 72, 72, 72, 72
  374. } ;
  375. /* The intent behind this definition is that it'll catch
  376. * any uses of REJECT which flex missed.
  377. */
  378. #define REJECT reject_used_but_not_detected
  379. #define yymore() yymore_used_but_not_detected
  380. #define YY_MORE_ADJ 0
  381. #define YY_RESTORE_YY_MORE_OFFSET
  382. #line 1 "easymesh/easymesh-scanner.l"
  383. #line 2 "easymesh/easymesh-scanner.l"
  384. //
  385. // Lol Engine
  386. //
  387. // Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
  388. // (c) 2009-2012 Cédric Lecacheur <jordx@free.fr>
  389. // (c) 2009-2012 Benjamin Huet <huet.benjamin@gmail.com>
  390. // This program is free software; you can redistribute it and/or
  391. // modify it under the terms of the Do What The Fuck You Want To
  392. // Public License, Version 2, as published by Sam Hocevar. See
  393. // http://sam.zoy.org/projects/COPYING.WTFPL for more details.
  394. //
  395. #if defined HAVE_CONFIG_H
  396. # include "config.h"
  397. #endif
  398. #include <cstdlib>
  399. using std::exit;
  400. using std::malloc;
  401. using std::realloc;
  402. using std::free;
  403. #include "core.h"
  404. #include "easymesh/easymesh-compiler.h"
  405. typedef lol::EasyMeshParser::token token;
  406. typedef lol::EasyMeshParser::token_type token_type;
  407. #ifndef YY_DECL
  408. # define YY_DECL lol::EasyMeshParser::token_type \
  409. lol::EasyMeshScanner::lex(lol::EasyMeshParser::semantic_type* yylval, \
  410. lol::EasyMeshParser::location_type* yylloc)
  411. #endif
  412. #define yyterminate() return token::T_END
  413. #define YY_NO_UNISTD_H
  414. #define YY_USER_ACTION yylloc->columns(yyleng);
  415. #line 500 "generated/easymesh-scanner.cpp"
  416. #define INITIAL 0
  417. #ifndef YY_NO_UNISTD_H
  418. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  419. * down here because we want the user's section 1 to have been scanned first.
  420. * The user has a chance to override it with an option.
  421. */
  422. #include <unistd.h>
  423. #endif
  424. #ifndef YY_EXTRA_TYPE
  425. #define YY_EXTRA_TYPE void *
  426. #endif
  427. #ifndef yytext_ptr
  428. static void yy_flex_strncpy (char *,yyconst char *,int );
  429. #endif
  430. #ifdef YY_NEED_STRLEN
  431. static int yy_flex_strlen (yyconst char * );
  432. #endif
  433. #ifndef YY_NO_INPUT
  434. #endif
  435. /* Amount of stuff to slurp up with each read. */
  436. #ifndef YY_READ_BUF_SIZE
  437. #ifdef __ia64__
  438. /* On IA-64, the buffer size is 16k, not 8k */
  439. #define YY_READ_BUF_SIZE 16384
  440. #else
  441. #define YY_READ_BUF_SIZE 8192
  442. #endif /* __ia64__ */
  443. #endif
  444. /* Copy whatever the last rule matched to the standard output. */
  445. #ifndef ECHO
  446. #define ECHO LexerOutput( yytext, yyleng )
  447. #endif
  448. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  449. * is returned in "result".
  450. */
  451. #ifndef YY_INPUT
  452. #define YY_INPUT(buf,result,max_size) \
  453. \
  454. if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
  455. YY_FATAL_ERROR( "input in flex scanner failed" );
  456. #endif
  457. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  458. * we don't want an extra ';' after the "return" because that will cause
  459. * some compilers to complain about unreachable statements.
  460. */
  461. #ifndef yyterminate
  462. #define yyterminate() return YY_NULL
  463. #endif
  464. /* Number of entries by which start-condition stack grows. */
  465. #ifndef YY_START_STACK_INCR
  466. #define YY_START_STACK_INCR 25
  467. #endif
  468. /* Report a fatal error. */
  469. #ifndef YY_FATAL_ERROR
  470. #define YY_FATAL_ERROR(msg) LexerError( msg )
  471. #endif
  472. /* end tables serialization structures and prototypes */
  473. /* Default declaration of generated scanner - a define so the user can
  474. * easily add parameters.
  475. */
  476. #ifndef YY_DECL
  477. #define YY_DECL_IS_OURS 1
  478. #define YY_DECL int yyFlexLexer::yylex()
  479. #endif /* !YY_DECL */
  480. /* Code executed at the beginning of each rule, after yytext and yyleng
  481. * have been set up.
  482. */
  483. #ifndef YY_USER_ACTION
  484. #define YY_USER_ACTION
  485. #endif
  486. /* Code executed at the end of each rule. */
  487. #ifndef YY_BREAK
  488. #define YY_BREAK break;
  489. #endif
  490. #define YY_RULE_SETUP \
  491. YY_USER_ACTION
  492. /** The main scanner function which does all the work.
  493. */
  494. YY_DECL
  495. {
  496. register yy_state_type yy_current_state;
  497. register char *yy_cp, *yy_bp;
  498. register int yy_act;
  499. #line 44 "easymesh/easymesh-scanner.l"
  500. /* reset location at the beginning of yylex() */
  501. yylloc->step();
  502. #line 613 "generated/easymesh-scanner.cpp"
  503. if ( !(yy_init) )
  504. {
  505. (yy_init) = 1;
  506. #ifdef YY_USER_INIT
  507. YY_USER_INIT;
  508. #endif
  509. if ( ! (yy_start) )
  510. (yy_start) = 1; /* first start state */
  511. if ( ! yyin )
  512. yyin = & std::cin;
  513. if ( ! yyout )
  514. yyout = & std::cout;
  515. if ( ! YY_CURRENT_BUFFER ) {
  516. yyensure_buffer_stack ();
  517. YY_CURRENT_BUFFER_LVALUE =
  518. yy_create_buffer( yyin, YY_BUF_SIZE );
  519. }
  520. yy_load_buffer_state( );
  521. }
  522. while ( 1 ) /* loops until end-of-file is reached */
  523. {
  524. yy_cp = (yy_c_buf_p);
  525. /* Support of yytext. */
  526. *yy_cp = (yy_hold_char);
  527. /* yy_bp points to the position in yy_ch_buf of the start of
  528. * the current run.
  529. */
  530. yy_bp = yy_cp;
  531. yy_current_state = (yy_start);
  532. yy_match:
  533. do
  534. {
  535. register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
  536. if ( yy_accept[yy_current_state] )
  537. {
  538. (yy_last_accepting_state) = yy_current_state;
  539. (yy_last_accepting_cpos) = yy_cp;
  540. }
  541. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  542. {
  543. yy_current_state = (int) yy_def[yy_current_state];
  544. if ( yy_current_state >= 73 )
  545. yy_c = yy_meta[(unsigned int) yy_c];
  546. }
  547. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  548. ++yy_cp;
  549. }
  550. while ( yy_current_state != 72 );
  551. yy_cp = (yy_last_accepting_cpos);
  552. yy_current_state = (yy_last_accepting_state);
  553. yy_find_action:
  554. yy_act = yy_accept[yy_current_state];
  555. YY_DO_BEFORE_ACTION;
  556. do_action: /* This label is used only to access EOF actions. */
  557. switch ( yy_act )
  558. { /* beginning of action switch */
  559. case 0: /* must back up */
  560. /* undo the effects of YY_DO_BEFORE_ACTION */
  561. *yy_cp = (yy_hold_char);
  562. yy_cp = (yy_last_accepting_cpos);
  563. yy_current_state = (yy_last_accepting_state);
  564. goto yy_find_action;
  565. case 1:
  566. YY_RULE_SETUP
  567. #line 51 "easymesh/easymesh-scanner.l"
  568. { return token::T_COLOR; }
  569. YY_BREAK
  570. case 2:
  571. YY_RULE_SETUP
  572. #line 52 "easymesh/easymesh-scanner.l"
  573. { return token::T_BGCOLOR; }
  574. YY_BREAK
  575. case 3:
  576. YY_RULE_SETUP
  577. #line 54 "easymesh/easymesh-scanner.l"
  578. { return token::T_CHAMFER; }
  579. YY_BREAK
  580. case 4:
  581. YY_RULE_SETUP
  582. #line 55 "easymesh/easymesh-scanner.l"
  583. { return token::T_TRANSLATEX; }
  584. YY_BREAK
  585. case 5:
  586. YY_RULE_SETUP
  587. #line 56 "easymesh/easymesh-scanner.l"
  588. { return token::T_TRANSLATEY; }
  589. YY_BREAK
  590. case 6:
  591. YY_RULE_SETUP
  592. #line 57 "easymesh/easymesh-scanner.l"
  593. { return token::T_TRANSLATEZ; }
  594. YY_BREAK
  595. case 7:
  596. YY_RULE_SETUP
  597. #line 58 "easymesh/easymesh-scanner.l"
  598. { return token::T_TRANSLATE; }
  599. YY_BREAK
  600. case 8:
  601. YY_RULE_SETUP
  602. #line 59 "easymesh/easymesh-scanner.l"
  603. { return token::T_ROTATEX; }
  604. YY_BREAK
  605. case 9:
  606. YY_RULE_SETUP
  607. #line 60 "easymesh/easymesh-scanner.l"
  608. { return token::T_ROTATEY; }
  609. YY_BREAK
  610. case 10:
  611. YY_RULE_SETUP
  612. #line 61 "easymesh/easymesh-scanner.l"
  613. { return token::T_ROTATEZ; }
  614. YY_BREAK
  615. case 11:
  616. YY_RULE_SETUP
  617. #line 62 "easymesh/easymesh-scanner.l"
  618. { return token::T_TAPERX; }
  619. YY_BREAK
  620. case 12:
  621. YY_RULE_SETUP
  622. #line 63 "easymesh/easymesh-scanner.l"
  623. { return token::T_TAPERY; }
  624. YY_BREAK
  625. case 13:
  626. YY_RULE_SETUP
  627. #line 64 "easymesh/easymesh-scanner.l"
  628. { return token::T_TAPERZ; }
  629. YY_BREAK
  630. case 14:
  631. YY_RULE_SETUP
  632. #line 65 "easymesh/easymesh-scanner.l"
  633. { return token::T_SCALEX; }
  634. YY_BREAK
  635. case 15:
  636. YY_RULE_SETUP
  637. #line 66 "easymesh/easymesh-scanner.l"
  638. { return token::T_SCALEY; }
  639. YY_BREAK
  640. case 16:
  641. YY_RULE_SETUP
  642. #line 67 "easymesh/easymesh-scanner.l"
  643. { return token::T_SCALEZ; }
  644. YY_BREAK
  645. case 17:
  646. YY_RULE_SETUP
  647. #line 68 "easymesh/easymesh-scanner.l"
  648. { return token::T_SCALE; }
  649. YY_BREAK
  650. case 18:
  651. YY_RULE_SETUP
  652. #line 69 "easymesh/easymesh-scanner.l"
  653. { return token::T_MIRRORX; }
  654. YY_BREAK
  655. case 19:
  656. YY_RULE_SETUP
  657. #line 70 "easymesh/easymesh-scanner.l"
  658. { return token::T_MIRRORY; }
  659. YY_BREAK
  660. case 20:
  661. YY_RULE_SETUP
  662. #line 71 "easymesh/easymesh-scanner.l"
  663. { return token::T_MIRRORZ; }
  664. YY_BREAK
  665. case 21:
  666. YY_RULE_SETUP
  667. #line 73 "easymesh/easymesh-scanner.l"
  668. { return token::T_BOX; }
  669. YY_BREAK
  670. case 22:
  671. YY_RULE_SETUP
  672. #line 74 "easymesh/easymesh-scanner.l"
  673. { return token::T_CYLINDER; }
  674. YY_BREAK
  675. case 23:
  676. YY_RULE_SETUP
  677. #line 75 "easymesh/easymesh-scanner.l"
  678. { return token::T_CAPSULE; }
  679. YY_BREAK
  680. case 24:
  681. YY_RULE_SETUP
  682. #line 76 "easymesh/easymesh-scanner.l"
  683. { return token::T_COG; }
  684. YY_BREAK
  685. case 25:
  686. YY_RULE_SETUP
  687. #line 77 "easymesh/easymesh-scanner.l"
  688. { return token::T_DISC; }
  689. YY_BREAK
  690. case 26:
  691. YY_RULE_SETUP
  692. #line 78 "easymesh/easymesh-scanner.l"
  693. { return token::T_EXPANDEDSTAR; }
  694. YY_BREAK
  695. case 27:
  696. YY_RULE_SETUP
  697. #line 79 "easymesh/easymesh-scanner.l"
  698. { return token::T_FLATCHAMFBOX; }
  699. YY_BREAK
  700. case 28:
  701. YY_RULE_SETUP
  702. #line 80 "easymesh/easymesh-scanner.l"
  703. { return token::T_QUAD; }
  704. YY_BREAK
  705. case 29:
  706. YY_RULE_SETUP
  707. #line 81 "easymesh/easymesh-scanner.l"
  708. { return token::T_STAR; }
  709. YY_BREAK
  710. case 30:
  711. YY_RULE_SETUP
  712. #line 82 "easymesh/easymesh-scanner.l"
  713. { return token::T_SMOOTHCHAMFBOX; }
  714. YY_BREAK
  715. case 31:
  716. YY_RULE_SETUP
  717. #line 83 "easymesh/easymesh-scanner.l"
  718. { return token::T_SPHERE; }
  719. YY_BREAK
  720. case 32:
  721. YY_RULE_SETUP
  722. #line 84 "easymesh/easymesh-scanner.l"
  723. { return token::T_TRIANGLE; }
  724. YY_BREAK
  725. case 33:
  726. YY_RULE_SETUP
  727. #line 85 "easymesh/easymesh-scanner.l"
  728. { return token::T_TORUS; }
  729. YY_BREAK
  730. case 34:
  731. YY_RULE_SETUP
  732. #line 87 "easymesh/easymesh-scanner.l"
  733. {
  734. uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
  735. yylval->u32val = 0x11000000u * (tmp >> 8)
  736. | 0x00110000u * ((tmp >> 4) & 0xf)
  737. | 0x00001100u * (tmp & 0xf)
  738. | 0x000000ffu;
  739. return token::COLOR; }
  740. YY_BREAK
  741. case 35:
  742. YY_RULE_SETUP
  743. #line 94 "easymesh/easymesh-scanner.l"
  744. {
  745. uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
  746. yylval->u32val = 0x11000000u * (tmp >> 12)
  747. | 0x00110000u * ((tmp >> 8) & 0xf)
  748. | 0x00001100u * ((tmp >> 4) & 0xf)
  749. | 0x00000011u * (tmp & 0xf);
  750. return token::COLOR; }
  751. YY_BREAK
  752. case 36:
  753. YY_RULE_SETUP
  754. #line 101 "easymesh/easymesh-scanner.l"
  755. {
  756. yylval->u32val = 0xffu
  757. | 0x100u * (uint32_t)std::strtol(yytext + 1, NULL, 16);
  758. return token::COLOR; }
  759. YY_BREAK
  760. case 37:
  761. YY_RULE_SETUP
  762. #line 105 "easymesh/easymesh-scanner.l"
  763. {
  764. yylval->u32val = (uint32_t)std::strtol(yytext + 1, NULL, 16);
  765. return token::COLOR; }
  766. YY_BREAK
  767. case 38:
  768. YY_RULE_SETUP
  769. #line 108 "easymesh/easymesh-scanner.l"
  770. {
  771. yylval->fval = std::atof(yytext); return token::NUMBER; }
  772. YY_BREAK
  773. case 39:
  774. YY_RULE_SETUP
  775. #line 110 "easymesh/easymesh-scanner.l"
  776. { return token_type('-'); }
  777. YY_BREAK
  778. case 40:
  779. YY_RULE_SETUP
  780. #line 111 "easymesh/easymesh-scanner.l"
  781. { return token_type('['); }
  782. YY_BREAK
  783. case 41:
  784. YY_RULE_SETUP
  785. #line 112 "easymesh/easymesh-scanner.l"
  786. { return token_type(']'); }
  787. YY_BREAK
  788. case 42:
  789. YY_RULE_SETUP
  790. #line 113 "easymesh/easymesh-scanner.l"
  791. { /* ignore this */ }
  792. YY_BREAK
  793. case 43:
  794. /* rule 43 can match eol */
  795. YY_RULE_SETUP
  796. #line 114 "easymesh/easymesh-scanner.l"
  797. { /* ignore this */ }
  798. YY_BREAK
  799. case 44:
  800. YY_RULE_SETUP
  801. #line 115 "easymesh/easymesh-scanner.l"
  802. { return token::T_ERROR; }
  803. YY_BREAK
  804. case 45:
  805. YY_RULE_SETUP
  806. #line 117 "easymesh/easymesh-scanner.l"
  807. ECHO;
  808. YY_BREAK
  809. #line 936 "generated/easymesh-scanner.cpp"
  810. case YY_STATE_EOF(INITIAL):
  811. yyterminate();
  812. case YY_END_OF_BUFFER:
  813. {
  814. /* Amount of text matched not including the EOB char. */
  815. int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
  816. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  817. *yy_cp = (yy_hold_char);
  818. YY_RESTORE_YY_MORE_OFFSET
  819. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  820. {
  821. /* We're scanning a new file or input source. It's
  822. * possible that this happened because the user
  823. * just pointed yyin at a new source and called
  824. * yylex(). If so, then we have to assure
  825. * consistency between YY_CURRENT_BUFFER and our
  826. * globals. Here is the right place to do so, because
  827. * this is the first action (other than possibly a
  828. * back-up) that will match for the new input source.
  829. */
  830. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  831. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  832. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  833. }
  834. /* Note that here we test for yy_c_buf_p "<=" to the position
  835. * of the first EOB in the buffer, since yy_c_buf_p will
  836. * already have been incremented past the NUL character
  837. * (since all states make transitions on EOB to the
  838. * end-of-buffer state). Contrast this with the test
  839. * in input().
  840. */
  841. if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
  842. { /* This was really a NUL. */
  843. yy_state_type yy_next_state;
  844. (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
  845. yy_current_state = yy_get_previous_state( );
  846. /* Okay, we're now positioned to make the NUL
  847. * transition. We couldn't have
  848. * yy_get_previous_state() go ahead and do it
  849. * for us because it doesn't know how to deal
  850. * with the possibility of jamming (and we don't
  851. * want to build jamming into it because then it
  852. * will run more slowly).
  853. */
  854. yy_next_state = yy_try_NUL_trans( yy_current_state );
  855. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  856. if ( yy_next_state )
  857. {
  858. /* Consume the NUL. */
  859. yy_cp = ++(yy_c_buf_p);
  860. yy_current_state = yy_next_state;
  861. goto yy_match;
  862. }
  863. else
  864. {
  865. yy_cp = (yy_last_accepting_cpos);
  866. yy_current_state = (yy_last_accepting_state);
  867. goto yy_find_action;
  868. }
  869. }
  870. else switch ( yy_get_next_buffer( ) )
  871. {
  872. case EOB_ACT_END_OF_FILE:
  873. {
  874. (yy_did_buffer_switch_on_eof) = 0;
  875. if ( yywrap( ) )
  876. {
  877. /* Note: because we've taken care in
  878. * yy_get_next_buffer() to have set up
  879. * yytext, we can now set up
  880. * yy_c_buf_p so that if some total
  881. * hoser (like flex itself) wants to
  882. * call the scanner after we return the
  883. * YY_NULL, it'll still work - another
  884. * YY_NULL will get returned.
  885. */
  886. (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
  887. yy_act = YY_STATE_EOF(YY_START);
  888. goto do_action;
  889. }
  890. else
  891. {
  892. if ( ! (yy_did_buffer_switch_on_eof) )
  893. YY_NEW_FILE;
  894. }
  895. break;
  896. }
  897. case EOB_ACT_CONTINUE_SCAN:
  898. (yy_c_buf_p) =
  899. (yytext_ptr) + yy_amount_of_matched_text;
  900. yy_current_state = yy_get_previous_state( );
  901. yy_cp = (yy_c_buf_p);
  902. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  903. goto yy_match;
  904. case EOB_ACT_LAST_MATCH:
  905. (yy_c_buf_p) =
  906. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
  907. yy_current_state = yy_get_previous_state( );
  908. yy_cp = (yy_c_buf_p);
  909. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  910. goto yy_find_action;
  911. }
  912. break;
  913. }
  914. default:
  915. YY_FATAL_ERROR(
  916. "fatal flex scanner internal error--no action found" );
  917. } /* end of action switch */
  918. } /* end of scanning one token */
  919. } /* end of yylex */
  920. /* The contents of this function are C++ specific, so the () macro is not used.
  921. */
  922. yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )
  923. {
  924. yyin = arg_yyin;
  925. yyout = arg_yyout;
  926. yy_c_buf_p = 0;
  927. yy_init = 0;
  928. yy_start = 0;
  929. yy_flex_debug = 0;
  930. yylineno = 1; // this will only get updated if %option yylineno
  931. yy_did_buffer_switch_on_eof = 0;
  932. yy_looking_for_trail_begin = 0;
  933. yy_more_flag = 0;
  934. yy_more_len = 0;
  935. yy_more_offset = yy_prev_more_offset = 0;
  936. yy_start_stack_ptr = yy_start_stack_depth = 0;
  937. yy_start_stack = NULL;
  938. yy_buffer_stack = 0;
  939. yy_buffer_stack_top = 0;
  940. yy_buffer_stack_max = 0;
  941. yy_state_buf = 0;
  942. }
  943. /* The contents of this function are C++ specific, so the () macro is not used.
  944. */
  945. yyFlexLexer::~yyFlexLexer()
  946. {
  947. delete [] yy_state_buf;
  948. EasyMeshfree(yy_start_stack );
  949. yy_delete_buffer( YY_CURRENT_BUFFER );
  950. EasyMeshfree(yy_buffer_stack );
  951. }
  952. /* The contents of this function are C++ specific, so the () macro is not used.
  953. */
  954. void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
  955. {
  956. if ( new_in )
  957. {
  958. yy_delete_buffer( YY_CURRENT_BUFFER );
  959. yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
  960. }
  961. if ( new_out )
  962. yyout = new_out;
  963. }
  964. #ifdef YY_INTERACTIVE
  965. int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
  966. #else
  967. int yyFlexLexer::LexerInput( char* buf, int max_size )
  968. #endif
  969. {
  970. if ( yyin->eof() || yyin->fail() )
  971. return 0;
  972. #ifdef YY_INTERACTIVE
  973. yyin->get( buf[0] );
  974. if ( yyin->eof() )
  975. return 0;
  976. if ( yyin->bad() )
  977. return -1;
  978. return 1;
  979. #else
  980. (void) yyin->read( buf, max_size );
  981. if ( yyin->bad() )
  982. return -1;
  983. else
  984. return yyin->gcount();
  985. #endif
  986. }
  987. void yyFlexLexer::LexerOutput( const char* buf, int size )
  988. {
  989. (void) yyout->write( buf, size );
  990. }
  991. /* yy_get_next_buffer - try to read in a new buffer
  992. *
  993. * Returns a code representing an action:
  994. * EOB_ACT_LAST_MATCH -
  995. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  996. * EOB_ACT_END_OF_FILE - end of file
  997. */
  998. int yyFlexLexer::yy_get_next_buffer()
  999. {
  1000. register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  1001. register char *source = (yytext_ptr);
  1002. register int number_to_move, i;
  1003. int ret_val;
  1004. if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
  1005. YY_FATAL_ERROR(
  1006. "fatal flex scanner internal error--end of buffer missed" );
  1007. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  1008. { /* Don't try to fill the buffer, so this is an EOF. */
  1009. if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
  1010. {
  1011. /* We matched a single character, the EOB, so
  1012. * treat this as a final EOF.
  1013. */
  1014. return EOB_ACT_END_OF_FILE;
  1015. }
  1016. else
  1017. {
  1018. /* We matched some text prior to the EOB, first
  1019. * process it.
  1020. */
  1021. return EOB_ACT_LAST_MATCH;
  1022. }
  1023. }
  1024. /* Try to read more data. */
  1025. /* First move last chars to start of buffer. */
  1026. number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
  1027. for ( i = 0; i < number_to_move; ++i )
  1028. *(dest++) = *(source++);
  1029. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  1030. /* don't do the read, it's not guaranteed to return an EOF,
  1031. * just force an EOF
  1032. */
  1033. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
  1034. else
  1035. {
  1036. int num_to_read =
  1037. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  1038. while ( num_to_read <= 0 )
  1039. { /* Not enough room in the buffer - grow it. */
  1040. /* just a shorter name for the current buffer */
  1041. YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
  1042. int yy_c_buf_p_offset =
  1043. (int) ((yy_c_buf_p) - b->yy_ch_buf);
  1044. if ( b->yy_is_our_buffer )
  1045. {
  1046. int new_size = b->yy_buf_size * 2;
  1047. if ( new_size <= 0 )
  1048. b->yy_buf_size += b->yy_buf_size / 8;
  1049. else
  1050. b->yy_buf_size *= 2;
  1051. b->yy_ch_buf = (char *)
  1052. /* Include room in for 2 EOB chars. */
  1053. EasyMeshrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
  1054. }
  1055. else
  1056. /* Can't grow it, we don't own it. */
  1057. b->yy_ch_buf = 0;
  1058. if ( ! b->yy_ch_buf )
  1059. YY_FATAL_ERROR(
  1060. "fatal error - scanner input buffer overflow" );
  1061. (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
  1062. num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  1063. number_to_move - 1;
  1064. }
  1065. if ( num_to_read > YY_READ_BUF_SIZE )
  1066. num_to_read = YY_READ_BUF_SIZE;
  1067. /* Read in more data. */
  1068. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  1069. (yy_n_chars), (size_t) num_to_read );
  1070. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1071. }
  1072. if ( (yy_n_chars) == 0 )
  1073. {
  1074. if ( number_to_move == YY_MORE_ADJ )
  1075. {
  1076. ret_val = EOB_ACT_END_OF_FILE;
  1077. yyrestart( yyin );
  1078. }
  1079. else
  1080. {
  1081. ret_val = EOB_ACT_LAST_MATCH;
  1082. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  1083. YY_BUFFER_EOF_PENDING;
  1084. }
  1085. }
  1086. else
  1087. ret_val = EOB_ACT_CONTINUE_SCAN;
  1088. if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
  1089. /* Extend the array by 50%, plus the number we really need. */
  1090. yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
  1091. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) EasyMeshrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
  1092. if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1093. YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
  1094. }
  1095. (yy_n_chars) += number_to_move;
  1096. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
  1097. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
  1098. (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  1099. return ret_val;
  1100. }
  1101. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1102. yy_state_type yyFlexLexer::yy_get_previous_state()
  1103. {
  1104. register yy_state_type yy_current_state;
  1105. register char *yy_cp;
  1106. yy_current_state = (yy_start);
  1107. for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
  1108. {
  1109. register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  1110. if ( yy_accept[yy_current_state] )
  1111. {
  1112. (yy_last_accepting_state) = yy_current_state;
  1113. (yy_last_accepting_cpos) = yy_cp;
  1114. }
  1115. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1116. {
  1117. yy_current_state = (int) yy_def[yy_current_state];
  1118. if ( yy_current_state >= 73 )
  1119. yy_c = yy_meta[(unsigned int) yy_c];
  1120. }
  1121. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1122. }
  1123. return yy_current_state;
  1124. }
  1125. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1126. *
  1127. * synopsis
  1128. * next_state = yy_try_NUL_trans( current_state );
  1129. */
  1130. yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
  1131. {
  1132. register int yy_is_jam;
  1133. register char *yy_cp = (yy_c_buf_p);
  1134. register YY_CHAR yy_c = 1;
  1135. if ( yy_accept[yy_current_state] )
  1136. {
  1137. (yy_last_accepting_state) = yy_current_state;
  1138. (yy_last_accepting_cpos) = yy_cp;
  1139. }
  1140. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1141. {
  1142. yy_current_state = (int) yy_def[yy_current_state];
  1143. if ( yy_current_state >= 73 )
  1144. yy_c = yy_meta[(unsigned int) yy_c];
  1145. }
  1146. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1147. yy_is_jam = (yy_current_state == 72);
  1148. return yy_is_jam ? 0 : yy_current_state;
  1149. }
  1150. void yyFlexLexer::yyunput( int c, register char* yy_bp)
  1151. {
  1152. register char *yy_cp;
  1153. yy_cp = (yy_c_buf_p);
  1154. /* undo effects of setting up yytext */
  1155. *yy_cp = (yy_hold_char);
  1156. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1157. { /* need to shift things up to make room */
  1158. /* +2 for EOB chars. */
  1159. register int number_to_move = (yy_n_chars) + 2;
  1160. register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
  1161. YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
  1162. register char *source =
  1163. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
  1164. while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1165. *--dest = *--source;
  1166. yy_cp += (int) (dest - source);
  1167. yy_bp += (int) (dest - source);
  1168. YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
  1169. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
  1170. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1171. YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1172. }
  1173. *--yy_cp = (char) c;
  1174. (yytext_ptr) = yy_bp;
  1175. (yy_hold_char) = *yy_cp;
  1176. (yy_c_buf_p) = yy_cp;
  1177. }
  1178. int yyFlexLexer::yyinput()
  1179. {
  1180. int c;
  1181. *(yy_c_buf_p) = (yy_hold_char);
  1182. if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
  1183. {
  1184. /* yy_c_buf_p now points to the character we want to return.
  1185. * If this occurs *before* the EOB characters, then it's a
  1186. * valid NUL; if not, then we've hit the end of the buffer.
  1187. */
  1188. if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
  1189. /* This was really a NUL. */
  1190. *(yy_c_buf_p) = '\0';
  1191. else
  1192. { /* need more input */
  1193. int offset = (yy_c_buf_p) - (yytext_ptr);
  1194. ++(yy_c_buf_p);
  1195. switch ( yy_get_next_buffer( ) )
  1196. {
  1197. case EOB_ACT_LAST_MATCH:
  1198. /* This happens because yy_g_n_b()
  1199. * sees that we've accumulated a
  1200. * token and flags that we need to
  1201. * try matching the token before
  1202. * proceeding. But for input(),
  1203. * there's no matching to consider.
  1204. * So convert the EOB_ACT_LAST_MATCH
  1205. * to EOB_ACT_END_OF_FILE.
  1206. */
  1207. /* Reset buffer status. */
  1208. yyrestart( yyin );
  1209. /*FALLTHROUGH*/
  1210. case EOB_ACT_END_OF_FILE:
  1211. {
  1212. if ( yywrap( ) )
  1213. return EOF;
  1214. if ( ! (yy_did_buffer_switch_on_eof) )
  1215. YY_NEW_FILE;
  1216. #ifdef __cplusplus
  1217. return yyinput();
  1218. #else
  1219. return input();
  1220. #endif
  1221. }
  1222. case EOB_ACT_CONTINUE_SCAN:
  1223. (yy_c_buf_p) = (yytext_ptr) + offset;
  1224. break;
  1225. }
  1226. }
  1227. }
  1228. c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
  1229. *(yy_c_buf_p) = '\0'; /* preserve yytext */
  1230. (yy_hold_char) = *++(yy_c_buf_p);
  1231. return c;
  1232. }
  1233. /** Immediately switch to a different input stream.
  1234. * @param input_file A readable stream.
  1235. *
  1236. * @note This function does not reset the start condition to @c INITIAL .
  1237. */
  1238. void yyFlexLexer::yyrestart( std::istream* input_file )
  1239. {
  1240. if ( ! YY_CURRENT_BUFFER ){
  1241. yyensure_buffer_stack ();
  1242. YY_CURRENT_BUFFER_LVALUE =
  1243. yy_create_buffer( yyin, YY_BUF_SIZE );
  1244. }
  1245. yy_init_buffer( YY_CURRENT_BUFFER, input_file );
  1246. yy_load_buffer_state( );
  1247. }
  1248. /** Switch to a different input buffer.
  1249. * @param new_buffer The new input buffer.
  1250. *
  1251. */
  1252. void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1253. {
  1254. /* TODO. We should be able to replace this entire function body
  1255. * with
  1256. * yypop_buffer_state();
  1257. * yypush_buffer_state(new_buffer);
  1258. */
  1259. yyensure_buffer_stack ();
  1260. if ( YY_CURRENT_BUFFER == new_buffer )
  1261. return;
  1262. if ( YY_CURRENT_BUFFER )
  1263. {
  1264. /* Flush out information for old buffer. */
  1265. *(yy_c_buf_p) = (yy_hold_char);
  1266. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
  1267. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1268. }
  1269. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1270. yy_load_buffer_state( );
  1271. /* We don't actually know whether we did this switch during
  1272. * EOF (yywrap()) processing, but the only time this flag
  1273. * is looked at is after yywrap() is called, so it's safe
  1274. * to go ahead and always set it.
  1275. */
  1276. (yy_did_buffer_switch_on_eof) = 1;
  1277. }
  1278. void yyFlexLexer::yy_load_buffer_state()
  1279. {
  1280. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1281. (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  1282. yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  1283. (yy_hold_char) = *(yy_c_buf_p);
  1284. }
  1285. /** Allocate and initialize an input buffer state.
  1286. * @param file A readable stream.
  1287. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  1288. *
  1289. * @return the allocated buffer state.
  1290. */
  1291. YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
  1292. {
  1293. YY_BUFFER_STATE b;
  1294. b = (YY_BUFFER_STATE) EasyMeshalloc(sizeof( struct yy_buffer_state ) );
  1295. if ( ! b )
  1296. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1297. b->yy_buf_size = size;
  1298. /* yy_ch_buf has to be 2 characters longer than the size given because
  1299. * we need to put in 2 end-of-buffer characters.
  1300. */
  1301. b->yy_ch_buf = (char *) EasyMeshalloc(b->yy_buf_size + 2 );
  1302. if ( ! b->yy_ch_buf )
  1303. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1304. b->yy_is_our_buffer = 1;
  1305. yy_init_buffer( b, file );
  1306. return b;
  1307. }
  1308. /** Destroy the buffer.
  1309. * @param b a buffer created with yy_create_buffer()
  1310. *
  1311. */
  1312. void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
  1313. {
  1314. if ( ! b )
  1315. return;
  1316. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  1317. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  1318. if ( b->yy_is_our_buffer )
  1319. EasyMeshfree((void *) b->yy_ch_buf );
  1320. EasyMeshfree((void *) b );
  1321. }
  1322. extern "C" int isatty (int );
  1323. /* Initializes or reinitializes a buffer.
  1324. * This function is sometimes called more than once on the same buffer,
  1325. * such as during a yyrestart() or at EOF.
  1326. */
  1327. void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )
  1328. {
  1329. int oerrno = errno;
  1330. yy_flush_buffer( b );
  1331. b->yy_input_file = file;
  1332. b->yy_fill_buffer = 1;
  1333. /* If b is the current buffer, then yy_init_buffer was _probably_
  1334. * called from yyrestart() or through yy_get_next_buffer.
  1335. * In that case, we don't want to reset the lineno or column.
  1336. */
  1337. if (b != YY_CURRENT_BUFFER){
  1338. b->yy_bs_lineno = 1;
  1339. b->yy_bs_column = 0;
  1340. }
  1341. b->yy_is_interactive = 0;
  1342. errno = oerrno;
  1343. }
  1344. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  1345. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  1346. *
  1347. */
  1348. void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
  1349. {
  1350. if ( ! b )
  1351. return;
  1352. b->yy_n_chars = 0;
  1353. /* We always need two end-of-buffer characters. The first causes
  1354. * a transition to the end-of-buffer state. The second causes
  1355. * a jam in that state.
  1356. */
  1357. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1358. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1359. b->yy_buf_pos = &b->yy_ch_buf[0];
  1360. b->yy_at_bol = 1;
  1361. b->yy_buffer_status = YY_BUFFER_NEW;
  1362. if ( b == YY_CURRENT_BUFFER )
  1363. yy_load_buffer_state( );
  1364. }
  1365. /** Pushes the new state onto the stack. The new state becomes
  1366. * the current state. This function will allocate the stack
  1367. * if necessary.
  1368. * @param new_buffer The new state.
  1369. *
  1370. */
  1371. void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer)
  1372. {
  1373. if (new_buffer == NULL)
  1374. return;
  1375. yyensure_buffer_stack();
  1376. /* This block is copied from yy_switch_to_buffer. */
  1377. if ( YY_CURRENT_BUFFER )
  1378. {
  1379. /* Flush out information for old buffer. */
  1380. *(yy_c_buf_p) = (yy_hold_char);
  1381. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
  1382. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1383. }
  1384. /* Only push if top exists. Otherwise, replace top. */
  1385. if (YY_CURRENT_BUFFER)
  1386. (yy_buffer_stack_top)++;
  1387. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1388. /* copied from yy_switch_to_buffer. */
  1389. yy_load_buffer_state( );
  1390. (yy_did_buffer_switch_on_eof) = 1;
  1391. }
  1392. /** Removes and deletes the top of the stack, if present.
  1393. * The next element becomes the new top.
  1394. *
  1395. */
  1396. void yyFlexLexer::yypop_buffer_state (void)
  1397. {
  1398. if (!YY_CURRENT_BUFFER)
  1399. return;
  1400. yy_delete_buffer(YY_CURRENT_BUFFER );
  1401. YY_CURRENT_BUFFER_LVALUE = NULL;
  1402. if ((yy_buffer_stack_top) > 0)
  1403. --(yy_buffer_stack_top);
  1404. if (YY_CURRENT_BUFFER) {
  1405. yy_load_buffer_state( );
  1406. (yy_did_buffer_switch_on_eof) = 1;
  1407. }
  1408. }
  1409. /* Allocates the stack if it does not exist.
  1410. * Guarantees space for at least one push.
  1411. */
  1412. void yyFlexLexer::yyensure_buffer_stack(void)
  1413. {
  1414. int num_to_alloc;
  1415. if (!(yy_buffer_stack)) {
  1416. /* First allocation is just for 2 elements, since we don't know if this
  1417. * scanner will even need a stack. We use 2 instead of 1 to avoid an
  1418. * immediate realloc on the next call.
  1419. */
  1420. num_to_alloc = 1;
  1421. (yy_buffer_stack) = (struct yy_buffer_state**)EasyMeshalloc
  1422. (num_to_alloc * sizeof(struct yy_buffer_state*)
  1423. );
  1424. if ( ! (yy_buffer_stack) )
  1425. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1426. memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  1427. (yy_buffer_stack_max) = num_to_alloc;
  1428. (yy_buffer_stack_top) = 0;
  1429. return;
  1430. }
  1431. if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
  1432. /* Increase the buffer to prepare for a possible push. */
  1433. int grow_size = 8 /* arbitrary grow size */;
  1434. num_to_alloc = (yy_buffer_stack_max) + grow_size;
  1435. (yy_buffer_stack) = (struct yy_buffer_state**)EasyMeshrealloc
  1436. ((yy_buffer_stack),
  1437. num_to_alloc * sizeof(struct yy_buffer_state*)
  1438. );
  1439. if ( ! (yy_buffer_stack) )
  1440. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1441. /* zero only the new slots.*/
  1442. memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
  1443. (yy_buffer_stack_max) = num_to_alloc;
  1444. }
  1445. }
  1446. void yyFlexLexer::yy_push_state( int new_state )
  1447. {
  1448. if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
  1449. {
  1450. yy_size_t new_size;
  1451. (yy_start_stack_depth) += YY_START_STACK_INCR;
  1452. new_size = (yy_start_stack_depth) * sizeof( int );
  1453. if ( ! (yy_start_stack) )
  1454. (yy_start_stack) = (int *) EasyMeshalloc(new_size );
  1455. else
  1456. (yy_start_stack) = (int *) EasyMeshrealloc((void *) (yy_start_stack),new_size );
  1457. if ( ! (yy_start_stack) )
  1458. YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
  1459. }
  1460. (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
  1461. BEGIN(new_state);
  1462. }
  1463. void yyFlexLexer::yy_pop_state()
  1464. {
  1465. if ( --(yy_start_stack_ptr) < 0 )
  1466. YY_FATAL_ERROR( "start-condition stack underflow" );
  1467. BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
  1468. }
  1469. int yyFlexLexer::yy_top_state()
  1470. {
  1471. return (yy_start_stack)[(yy_start_stack_ptr) - 1];
  1472. }
  1473. #ifndef YY_EXIT_FAILURE
  1474. #define YY_EXIT_FAILURE 2
  1475. #endif
  1476. void yyFlexLexer::LexerError( yyconst char msg[] )
  1477. {
  1478. std::cerr << msg << std::endl;
  1479. exit( YY_EXIT_FAILURE );
  1480. }
  1481. /* Redefine yyless() so it works in section 3 code. */
  1482. #undef yyless
  1483. #define yyless(n) \
  1484. do \
  1485. { \
  1486. /* Undo effects of setting up yytext. */ \
  1487. int yyless_macro_arg = (n); \
  1488. YY_LESS_LINENO(yyless_macro_arg);\
  1489. yytext[yyleng] = (yy_hold_char); \
  1490. (yy_c_buf_p) = yytext + yyless_macro_arg; \
  1491. (yy_hold_char) = *(yy_c_buf_p); \
  1492. *(yy_c_buf_p) = '\0'; \
  1493. yyleng = yyless_macro_arg; \
  1494. } \
  1495. while ( 0 )
  1496. /* Accessor methods (get/set functions) to struct members. */
  1497. /*
  1498. * Internal utility routines.
  1499. */
  1500. #ifndef yytext_ptr
  1501. static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
  1502. {
  1503. register int i;
  1504. for ( i = 0; i < n; ++i )
  1505. s1[i] = s2[i];
  1506. }
  1507. #endif
  1508. #ifdef YY_NEED_STRLEN
  1509. static int yy_flex_strlen (yyconst char * s )
  1510. {
  1511. register int n;
  1512. for ( n = 0; s[n]; ++n )
  1513. ;
  1514. return n;
  1515. }
  1516. #endif
  1517. void *EasyMeshalloc (yy_size_t size )
  1518. {
  1519. return (void *) malloc( size );
  1520. }
  1521. void *EasyMeshrealloc (void * ptr, yy_size_t size )
  1522. {
  1523. /* The cast to (char *) in the following accommodates both
  1524. * implementations that use char* generic pointers, and those
  1525. * that use void* generic pointers. It works with the latter
  1526. * because both ANSI C and C++ allow castless assignment from
  1527. * any pointer type to void*, and deal with argument conversions
  1528. * as though doing an assignment.
  1529. */
  1530. return (void *) realloc( (char *) ptr, size );
  1531. }
  1532. void EasyMeshfree (void * ptr )
  1533. {
  1534. free( (char *) ptr ); /* see EasyMeshrealloc() for (char *) cast */
  1535. }
  1536. #define YYTABLES_NAME "yytables"
  1537. #line 117 "easymesh/easymesh-scanner.l"
  1538. lol::EasyMeshScanner::EasyMeshScanner(char const *command)
  1539. : EasyMeshFlexLexer(0, 0),
  1540. m_input(command)
  1541. {
  1542. }
  1543. lol::EasyMeshScanner::~EasyMeshScanner()
  1544. {
  1545. }
  1546. int lol::EasyMeshScanner::LexerInput(char* buf, int max_size)
  1547. {
  1548. (void)max_size; /* unused for now */
  1549. buf[0] = m_input[0];
  1550. if (buf[0])
  1551. ++m_input;
  1552. return buf[0] ? 1 : 0;
  1553. }
  1554. #ifdef yylex
  1555. #undef yylex
  1556. #endif
  1557. int EasyMeshFlexLexer::yylex()
  1558. {
  1559. std::cerr << "in EasyMeshFlexLexer::yylex() !" << std::endl;
  1560. return 0;
  1561. }
  1562. int EasyMeshFlexLexer::yywrap()
  1563. {
  1564. return 1;
  1565. }