cmExprLexer.cxx 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205
  1. #include "cmStandardLexer.h"
  2. #define FLEXINT_H 1
  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 6
  8. #define YY_FLEX_SUBMINOR_VERSION 4
  9. #if YY_FLEX_SUBMINOR_VERSION > 0
  10. #define FLEX_BETA
  11. #endif
  12. #ifdef yy_create_buffer
  13. #define cmExpr_yy_create_buffer_ALREADY_DEFINED
  14. #else
  15. #define yy_create_buffer cmExpr_yy_create_buffer
  16. #endif
  17. #ifdef yy_delete_buffer
  18. #define cmExpr_yy_delete_buffer_ALREADY_DEFINED
  19. #else
  20. #define yy_delete_buffer cmExpr_yy_delete_buffer
  21. #endif
  22. #ifdef yy_scan_buffer
  23. #define cmExpr_yy_scan_buffer_ALREADY_DEFINED
  24. #else
  25. #define yy_scan_buffer cmExpr_yy_scan_buffer
  26. #endif
  27. #ifdef yy_scan_string
  28. #define cmExpr_yy_scan_string_ALREADY_DEFINED
  29. #else
  30. #define yy_scan_string cmExpr_yy_scan_string
  31. #endif
  32. #ifdef yy_scan_bytes
  33. #define cmExpr_yy_scan_bytes_ALREADY_DEFINED
  34. #else
  35. #define yy_scan_bytes cmExpr_yy_scan_bytes
  36. #endif
  37. #ifdef yy_init_buffer
  38. #define cmExpr_yy_init_buffer_ALREADY_DEFINED
  39. #else
  40. #define yy_init_buffer cmExpr_yy_init_buffer
  41. #endif
  42. #ifdef yy_flush_buffer
  43. #define cmExpr_yy_flush_buffer_ALREADY_DEFINED
  44. #else
  45. #define yy_flush_buffer cmExpr_yy_flush_buffer
  46. #endif
  47. #ifdef yy_load_buffer_state
  48. #define cmExpr_yy_load_buffer_state_ALREADY_DEFINED
  49. #else
  50. #define yy_load_buffer_state cmExpr_yy_load_buffer_state
  51. #endif
  52. #ifdef yy_switch_to_buffer
  53. #define cmExpr_yy_switch_to_buffer_ALREADY_DEFINED
  54. #else
  55. #define yy_switch_to_buffer cmExpr_yy_switch_to_buffer
  56. #endif
  57. #ifdef yypush_buffer_state
  58. #define cmExpr_yypush_buffer_state_ALREADY_DEFINED
  59. #else
  60. #define yypush_buffer_state cmExpr_yypush_buffer_state
  61. #endif
  62. #ifdef yypop_buffer_state
  63. #define cmExpr_yypop_buffer_state_ALREADY_DEFINED
  64. #else
  65. #define yypop_buffer_state cmExpr_yypop_buffer_state
  66. #endif
  67. #ifdef yyensure_buffer_stack
  68. #define cmExpr_yyensure_buffer_stack_ALREADY_DEFINED
  69. #else
  70. #define yyensure_buffer_stack cmExpr_yyensure_buffer_stack
  71. #endif
  72. #ifdef yylex
  73. #define cmExpr_yylex_ALREADY_DEFINED
  74. #else
  75. #define yylex cmExpr_yylex
  76. #endif
  77. #ifdef yyrestart
  78. #define cmExpr_yyrestart_ALREADY_DEFINED
  79. #else
  80. #define yyrestart cmExpr_yyrestart
  81. #endif
  82. #ifdef yylex_init
  83. #define cmExpr_yylex_init_ALREADY_DEFINED
  84. #else
  85. #define yylex_init cmExpr_yylex_init
  86. #endif
  87. #ifdef yylex_init_extra
  88. #define cmExpr_yylex_init_extra_ALREADY_DEFINED
  89. #else
  90. #define yylex_init_extra cmExpr_yylex_init_extra
  91. #endif
  92. #ifdef yylex_destroy
  93. #define cmExpr_yylex_destroy_ALREADY_DEFINED
  94. #else
  95. #define yylex_destroy cmExpr_yylex_destroy
  96. #endif
  97. #ifdef yyget_debug
  98. #define cmExpr_yyget_debug_ALREADY_DEFINED
  99. #else
  100. #define yyget_debug cmExpr_yyget_debug
  101. #endif
  102. #ifdef yyset_debug
  103. #define cmExpr_yyset_debug_ALREADY_DEFINED
  104. #else
  105. #define yyset_debug cmExpr_yyset_debug
  106. #endif
  107. #ifdef yyget_extra
  108. #define cmExpr_yyget_extra_ALREADY_DEFINED
  109. #else
  110. #define yyget_extra cmExpr_yyget_extra
  111. #endif
  112. #ifdef yyset_extra
  113. #define cmExpr_yyset_extra_ALREADY_DEFINED
  114. #else
  115. #define yyset_extra cmExpr_yyset_extra
  116. #endif
  117. #ifdef yyget_in
  118. #define cmExpr_yyget_in_ALREADY_DEFINED
  119. #else
  120. #define yyget_in cmExpr_yyget_in
  121. #endif
  122. #ifdef yyset_in
  123. #define cmExpr_yyset_in_ALREADY_DEFINED
  124. #else
  125. #define yyset_in cmExpr_yyset_in
  126. #endif
  127. #ifdef yyget_out
  128. #define cmExpr_yyget_out_ALREADY_DEFINED
  129. #else
  130. #define yyget_out cmExpr_yyget_out
  131. #endif
  132. #ifdef yyset_out
  133. #define cmExpr_yyset_out_ALREADY_DEFINED
  134. #else
  135. #define yyset_out cmExpr_yyset_out
  136. #endif
  137. #ifdef yyget_leng
  138. #define cmExpr_yyget_leng_ALREADY_DEFINED
  139. #else
  140. #define yyget_leng cmExpr_yyget_leng
  141. #endif
  142. #ifdef yyget_text
  143. #define cmExpr_yyget_text_ALREADY_DEFINED
  144. #else
  145. #define yyget_text cmExpr_yyget_text
  146. #endif
  147. #ifdef yyget_lineno
  148. #define cmExpr_yyget_lineno_ALREADY_DEFINED
  149. #else
  150. #define yyget_lineno cmExpr_yyget_lineno
  151. #endif
  152. #ifdef yyset_lineno
  153. #define cmExpr_yyset_lineno_ALREADY_DEFINED
  154. #else
  155. #define yyset_lineno cmExpr_yyset_lineno
  156. #endif
  157. #ifdef yyget_column
  158. #define cmExpr_yyget_column_ALREADY_DEFINED
  159. #else
  160. #define yyget_column cmExpr_yyget_column
  161. #endif
  162. #ifdef yyset_column
  163. #define cmExpr_yyset_column_ALREADY_DEFINED
  164. #else
  165. #define yyset_column cmExpr_yyset_column
  166. #endif
  167. #ifdef yywrap
  168. #define cmExpr_yywrap_ALREADY_DEFINED
  169. #else
  170. #define yywrap cmExpr_yywrap
  171. #endif
  172. #ifdef yyalloc
  173. #define cmExpr_yyalloc_ALREADY_DEFINED
  174. #else
  175. #define yyalloc cmExpr_yyalloc
  176. #endif
  177. #ifdef yyrealloc
  178. #define cmExpr_yyrealloc_ALREADY_DEFINED
  179. #else
  180. #define yyrealloc cmExpr_yyrealloc
  181. #endif
  182. #ifdef yyfree
  183. #define cmExpr_yyfree_ALREADY_DEFINED
  184. #else
  185. #define yyfree cmExpr_yyfree
  186. #endif
  187. /* First, we deal with platform-specific or compiler-specific issues. */
  188. /* begin standard C headers. */
  189. #include <stdio.h>
  190. #include <string.h>
  191. #include <errno.h>
  192. #include <stdlib.h>
  193. /* end standard C headers. */
  194. /* flex integer type definitions */
  195. #ifndef FLEXINT_H
  196. #define FLEXINT_H
  197. /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
  198. #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  199. /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
  200. * if you want the limit (max/min) macros for int types.
  201. */
  202. #ifndef __STDC_LIMIT_MACROS
  203. #define __STDC_LIMIT_MACROS 1
  204. #endif
  205. #include <inttypes.h>
  206. typedef int8_t flex_int8_t;
  207. typedef uint8_t flex_uint8_t;
  208. typedef int16_t flex_int16_t;
  209. typedef uint16_t flex_uint16_t;
  210. typedef int32_t flex_int32_t;
  211. typedef uint32_t flex_uint32_t;
  212. #else
  213. typedef signed char flex_int8_t;
  214. typedef short int flex_int16_t;
  215. typedef int flex_int32_t;
  216. typedef unsigned char flex_uint8_t;
  217. typedef unsigned short int flex_uint16_t;
  218. typedef unsigned int flex_uint32_t;
  219. /* Limits of integral types. */
  220. #ifndef INT8_MIN
  221. #define INT8_MIN (-128)
  222. #endif
  223. #ifndef INT16_MIN
  224. #define INT16_MIN (-32767-1)
  225. #endif
  226. #ifndef INT32_MIN
  227. #define INT32_MIN (-2147483647-1)
  228. #endif
  229. #ifndef INT8_MAX
  230. #define INT8_MAX (127)
  231. #endif
  232. #ifndef INT16_MAX
  233. #define INT16_MAX (32767)
  234. #endif
  235. #ifndef INT32_MAX
  236. #define INT32_MAX (2147483647)
  237. #endif
  238. #ifndef UINT8_MAX
  239. #define UINT8_MAX (255U)
  240. #endif
  241. #ifndef UINT16_MAX
  242. #define UINT16_MAX (65535U)
  243. #endif
  244. #ifndef UINT32_MAX
  245. #define UINT32_MAX (4294967295U)
  246. #endif
  247. #ifndef SIZE_MAX
  248. #define SIZE_MAX (~(size_t)0)
  249. #endif
  250. #endif /* ! C99 */
  251. #endif /* ! FLEXINT_H */
  252. /* begin standard C++ headers. */
  253. /* TODO: this is always defined, so inline it */
  254. #define yyconst const
  255. #if defined(__GNUC__) && __GNUC__ >= 3
  256. #define yynoreturn __attribute__((__noreturn__))
  257. #else
  258. #define yynoreturn
  259. #endif
  260. /* Returned upon end-of-file. */
  261. #define YY_NULL 0
  262. /* Promotes a possibly negative, possibly signed char to an
  263. * integer in range [0..255] for use as an array index.
  264. */
  265. #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
  266. /* An opaque pointer. */
  267. #ifndef YY_TYPEDEF_YY_SCANNER_T
  268. #define YY_TYPEDEF_YY_SCANNER_T
  269. typedef void* yyscan_t;
  270. #endif
  271. /* For convenience, these vars (plus the bison vars far below)
  272. are macros in the reentrant scanner. */
  273. #define yyin yyg->yyin_r
  274. #define yyout yyg->yyout_r
  275. #define yyextra yyg->yyextra_r
  276. #define yyleng yyg->yyleng_r
  277. #define yytext yyg->yytext_r
  278. #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
  279. #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
  280. #define yy_flex_debug yyg->yy_flex_debug_r
  281. /* Enter a start condition. This macro really ought to take a parameter,
  282. * but we do it the disgusting crufty way forced on us by the ()-less
  283. * definition of BEGIN.
  284. */
  285. #define BEGIN yyg->yy_start = 1 + 2 *
  286. /* Translate the current start state into a value that can be later handed
  287. * to BEGIN to return to the state. The YYSTATE alias is for lex
  288. * compatibility.
  289. */
  290. #define YY_START ((yyg->yy_start - 1) / 2)
  291. #define YYSTATE YY_START
  292. /* Action number for EOF rule of a given start state. */
  293. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  294. /* Special action meaning "start processing a new file". */
  295. #define YY_NEW_FILE yyrestart( yyin , yyscanner )
  296. #define YY_END_OF_BUFFER_CHAR 0
  297. /* Size of default input buffer. */
  298. #ifndef YY_BUF_SIZE
  299. #ifdef __ia64__
  300. /* On IA-64, the buffer size is 16k, not 8k.
  301. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
  302. * Ditto for the __ia64__ case accordingly.
  303. */
  304. #define YY_BUF_SIZE 32768
  305. #else
  306. #define YY_BUF_SIZE 16384
  307. #endif /* __ia64__ */
  308. #endif
  309. /* The state buf must be large enough to hold one state per character in the main buffer.
  310. */
  311. #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
  312. #ifndef YY_TYPEDEF_YY_BUFFER_STATE
  313. #define YY_TYPEDEF_YY_BUFFER_STATE
  314. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  315. #endif
  316. #ifndef YY_TYPEDEF_YY_SIZE_T
  317. #define YY_TYPEDEF_YY_SIZE_T
  318. typedef size_t yy_size_t;
  319. #endif
  320. #define EOB_ACT_CONTINUE_SCAN 0
  321. #define EOB_ACT_END_OF_FILE 1
  322. #define EOB_ACT_LAST_MATCH 2
  323. #define YY_LESS_LINENO(n)
  324. #define YY_LINENO_REWIND_TO(ptr)
  325. /* Return all but the first "n" matched characters back to the input stream. */
  326. #define yyless(n) \
  327. do \
  328. { \
  329. /* Undo effects of setting up yytext. */ \
  330. int yyless_macro_arg = (n); \
  331. YY_LESS_LINENO(yyless_macro_arg);\
  332. *yy_cp = yyg->yy_hold_char; \
  333. YY_RESTORE_YY_MORE_OFFSET \
  334. yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  335. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  336. } \
  337. while ( 0 )
  338. #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
  339. #ifndef YY_STRUCT_YY_BUFFER_STATE
  340. #define YY_STRUCT_YY_BUFFER_STATE
  341. struct yy_buffer_state
  342. {
  343. FILE *yy_input_file;
  344. char *yy_ch_buf; /* input buffer */
  345. char *yy_buf_pos; /* current position in input buffer */
  346. /* Size of input buffer in bytes, not including room for EOB
  347. * characters.
  348. */
  349. int yy_buf_size;
  350. /* Number of characters read into yy_ch_buf, not including EOB
  351. * characters.
  352. */
  353. int yy_n_chars;
  354. /* Whether we "own" the buffer - i.e., we know we created it,
  355. * and can realloc() it to grow it, and should free() it to
  356. * delete it.
  357. */
  358. int yy_is_our_buffer;
  359. /* Whether this is an "interactive" input source; if so, and
  360. * if we're using stdio for input, then we want to use getc()
  361. * instead of fread(), to make sure we stop fetching input after
  362. * each newline.
  363. */
  364. int yy_is_interactive;
  365. /* Whether we're considered to be at the beginning of a line.
  366. * If so, '^' rules will be active on the next match, otherwise
  367. * not.
  368. */
  369. int yy_at_bol;
  370. int yy_bs_lineno; /**< The line count. */
  371. int yy_bs_column; /**< The column count. */
  372. /* Whether to try to fill the input buffer when we reach the
  373. * end of it.
  374. */
  375. int yy_fill_buffer;
  376. int yy_buffer_status;
  377. #define YY_BUFFER_NEW 0
  378. #define YY_BUFFER_NORMAL 1
  379. /* When an EOF's been seen but there's still some text to process
  380. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  381. * shouldn't try reading from the input source any more. We might
  382. * still have a bunch of tokens to match, though, because of
  383. * possible backing-up.
  384. *
  385. * When we actually see the EOF, we change the status to "new"
  386. * (via yyrestart()), so that the user can continue scanning by
  387. * just pointing yyin at a new input file.
  388. */
  389. #define YY_BUFFER_EOF_PENDING 2
  390. };
  391. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  392. /* We provide macros for accessing buffer states in case in the
  393. * future we want to put the buffer states in a more general
  394. * "scanner state".
  395. *
  396. * Returns the top of the stack, or NULL.
  397. */
  398. #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
  399. ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
  400. : NULL)
  401. /* Same as previous macro, but useful when we know that the buffer stack is not
  402. * NULL or when we need an lvalue. For internal use only.
  403. */
  404. #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
  405. void yyrestart ( FILE *input_file , yyscan_t yyscanner );
  406. void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
  407. YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
  408. void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
  409. void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
  410. void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
  411. void yypop_buffer_state ( yyscan_t yyscanner );
  412. static void yyensure_buffer_stack ( yyscan_t yyscanner );
  413. static void yy_load_buffer_state ( yyscan_t yyscanner );
  414. static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
  415. #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
  416. YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
  417. YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
  418. YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
  419. void *yyalloc ( yy_size_t , yyscan_t yyscanner );
  420. void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
  421. void yyfree ( void * , yyscan_t yyscanner );
  422. #define yy_new_buffer yy_create_buffer
  423. #define yy_set_interactive(is_interactive) \
  424. { \
  425. if ( ! YY_CURRENT_BUFFER ){ \
  426. yyensure_buffer_stack (yyscanner); \
  427. YY_CURRENT_BUFFER_LVALUE = \
  428. yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
  429. } \
  430. YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  431. }
  432. #define yy_set_bol(at_bol) \
  433. { \
  434. if ( ! YY_CURRENT_BUFFER ){\
  435. yyensure_buffer_stack (yyscanner); \
  436. YY_CURRENT_BUFFER_LVALUE = \
  437. yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
  438. } \
  439. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  440. }
  441. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  442. /* Begin user sect3 */
  443. #define cmExpr_yywrap(yyscanner) (/*CONSTCOND*/1)
  444. #define YY_SKIP_YYWRAP
  445. typedef flex_uint8_t YY_CHAR;
  446. typedef int yy_state_type;
  447. #define yytext_ptr yytext_r
  448. static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
  449. static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
  450. static int yy_get_next_buffer ( yyscan_t yyscanner );
  451. static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
  452. /* Done after the current pattern has been matched and before the
  453. * corresponding action - sets up yytext.
  454. */
  455. #define YY_DO_BEFORE_ACTION \
  456. yyg->yytext_ptr = yy_bp; \
  457. yyleng = (int) (yy_cp - yy_bp); \
  458. yyg->yy_hold_char = *yy_cp; \
  459. *yy_cp = '\0'; \
  460. yyg->yy_c_buf_p = yy_cp;
  461. #define YY_NUM_RULES 15
  462. #define YY_END_OF_BUFFER 16
  463. /* This struct is not used in this scanner,
  464. but its presence is necessary. */
  465. struct yy_trans_info
  466. {
  467. flex_int32_t yy_verify;
  468. flex_int32_t yy_nxt;
  469. };
  470. static const flex_int16_t yy_accept[23] =
  471. { 0,
  472. 0, 0, 16, 15, 6, 8, 13, 14, 4, 2,
  473. 3, 5, 1, 15, 15, 9, 7, 10, 1, 11,
  474. 12, 0
  475. } ;
  476. static const YY_CHAR yy_ec[256] =
  477. { 0,
  478. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  479. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  480. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  481. 1, 1, 1, 1, 1, 1, 2, 3, 1, 4,
  482. 5, 6, 7, 1, 8, 1, 9, 10, 10, 10,
  483. 10, 10, 10, 10, 10, 10, 10, 1, 1, 11,
  484. 1, 12, 1, 1, 1, 1, 1, 1, 1, 1,
  485. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  486. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  487. 1, 1, 1, 13, 1, 1, 1, 1, 1, 1,
  488. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  489. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  490. 1, 1, 1, 14, 1, 15, 1, 1, 1, 1,
  491. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  492. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  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, 1, 1, 1, 1, 1,
  498. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  499. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  500. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  501. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  502. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  503. 1, 1, 1, 1, 1
  504. } ;
  505. static const YY_CHAR yy_meta[16] =
  506. { 0,
  507. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  508. 1, 1, 1, 1, 1
  509. } ;
  510. static const flex_int16_t yy_base[23] =
  511. { 0,
  512. 0, 0, 20, 21, 21, 21, 21, 21, 21, 21,
  513. 21, 21, 9, 7, 5, 21, 21, 21, 6, 21,
  514. 21, 21
  515. } ;
  516. static const flex_int16_t yy_def[23] =
  517. { 0,
  518. 22, 1, 22, 22, 22, 22, 22, 22, 22, 22,
  519. 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
  520. 22, 0
  521. } ;
  522. static const flex_int16_t yy_nxt[37] =
  523. { 0,
  524. 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
  525. 14, 15, 16, 17, 18, 19, 21, 20, 19, 22,
  526. 3, 22, 22, 22, 22, 22, 22, 22, 22, 22,
  527. 22, 22, 22, 22, 22, 22
  528. } ;
  529. static const flex_int16_t yy_chk[37] =
  530. { 0,
  531. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  532. 1, 1, 1, 1, 1, 19, 15, 14, 13, 3,
  533. 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
  534. 22, 22, 22, 22, 22, 22
  535. } ;
  536. /* The intent behind this definition is that it'll catch
  537. * any uses of REJECT which flex missed.
  538. */
  539. #define REJECT reject_used_but_not_detected
  540. #define yymore() yymore_used_but_not_detected
  541. #define YY_MORE_ADJ 0
  542. #define YY_RESTORE_YY_MORE_OFFSET
  543. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  544. file Copyright.txt or https://cmake.org/licensing for details. */
  545. /*
  546. This file must be translated to C++ and modified to build everywhere.
  547. Run flex >= 2.6 like this:
  548. flex --nounistd -DFLEXINT_H --noline --header-file=cmExprLexer.h -ocmExprLexer.cxx cmExprLexer.in.l
  549. Modify cmExprLexer.cxx:
  550. - remove trailing whitespace: sed -i 's/\s*$//' cmExprLexer.h cmExprLexer.cxx
  551. - remove blank lines at end of file: sed -i '${/^$/d;}' cmExprLexer.h cmExprLexer.cxx
  552. - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmExprLexer.cxx
  553. */
  554. /* IWYU pragma: no_forward_declare yyguts_t */
  555. #include "cmExprParserHelper.h"
  556. /* Replace the lexer input function. */
  557. #undef YY_INPUT
  558. #define YY_INPUT(buf, result, max_size) \
  559. { result = yyextra->LexInput(buf, max_size); }
  560. /* Include the set of tokens from the parser. */
  561. #include "cmExprParserTokens.h"
  562. /*--------------------------------------------------------------------------*/
  563. #define INITIAL 0
  564. #ifndef YY_EXTRA_TYPE
  565. #define YY_EXTRA_TYPE void *
  566. #endif
  567. /* Holds the entire state of the reentrant scanner. */
  568. struct yyguts_t
  569. {
  570. /* User-defined. Not touched by flex. */
  571. YY_EXTRA_TYPE yyextra_r;
  572. /* The rest are the same as the globals declared in the non-reentrant scanner. */
  573. FILE *yyin_r, *yyout_r;
  574. size_t yy_buffer_stack_top; /**< index of top of stack. */
  575. size_t yy_buffer_stack_max; /**< capacity of stack. */
  576. YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
  577. char yy_hold_char;
  578. int yy_n_chars;
  579. int yyleng_r;
  580. char *yy_c_buf_p;
  581. int yy_init;
  582. int yy_start;
  583. int yy_did_buffer_switch_on_eof;
  584. int yy_start_stack_ptr;
  585. int yy_start_stack_depth;
  586. int *yy_start_stack;
  587. yy_state_type yy_last_accepting_state;
  588. char* yy_last_accepting_cpos;
  589. int yylineno_r;
  590. int yy_flex_debug_r;
  591. char *yytext_r;
  592. int yy_more_flag;
  593. int yy_more_len;
  594. }; /* end struct yyguts_t */
  595. static int yy_init_globals ( yyscan_t yyscanner );
  596. int yylex_init (yyscan_t* scanner);
  597. int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
  598. /* Accessor methods to globals.
  599. These are made visible to non-reentrant scanners for convenience. */
  600. int yylex_destroy ( yyscan_t yyscanner );
  601. int yyget_debug ( yyscan_t yyscanner );
  602. void yyset_debug ( int debug_flag , yyscan_t yyscanner );
  603. YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
  604. void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
  605. FILE *yyget_in ( yyscan_t yyscanner );
  606. void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
  607. FILE *yyget_out ( yyscan_t yyscanner );
  608. void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
  609. int yyget_leng ( yyscan_t yyscanner );
  610. char *yyget_text ( yyscan_t yyscanner );
  611. int yyget_lineno ( yyscan_t yyscanner );
  612. void yyset_lineno ( int _line_number , yyscan_t yyscanner );
  613. int yyget_column ( yyscan_t yyscanner );
  614. void yyset_column ( int _column_no , yyscan_t yyscanner );
  615. /* Macros after this point can all be overridden by user definitions in
  616. * section 1.
  617. */
  618. #ifndef YY_SKIP_YYWRAP
  619. #ifdef __cplusplus
  620. extern "C" int yywrap ( yyscan_t yyscanner );
  621. #else
  622. extern int yywrap ( yyscan_t yyscanner );
  623. #endif
  624. #endif
  625. #ifndef YY_NO_UNPUT
  626. static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner);
  627. #endif
  628. #ifndef yytext_ptr
  629. static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
  630. #endif
  631. #ifdef YY_NEED_STRLEN
  632. static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
  633. #endif
  634. #ifndef YY_NO_INPUT
  635. #ifdef __cplusplus
  636. static int yyinput ( yyscan_t yyscanner );
  637. #else
  638. static int input ( yyscan_t yyscanner );
  639. #endif
  640. #endif
  641. /* Amount of stuff to slurp up with each read. */
  642. #ifndef YY_READ_BUF_SIZE
  643. #ifdef __ia64__
  644. /* On IA-64, the buffer size is 16k, not 8k */
  645. #define YY_READ_BUF_SIZE 16384
  646. #else
  647. #define YY_READ_BUF_SIZE 8192
  648. #endif /* __ia64__ */
  649. #endif
  650. /* Copy whatever the last rule matched to the standard output. */
  651. #ifndef ECHO
  652. /* This used to be an fputs(), but since the string might contain NUL's,
  653. * we now use fwrite().
  654. */
  655. #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
  656. #endif
  657. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  658. * is returned in "result".
  659. */
  660. #ifndef YY_INPUT
  661. #define YY_INPUT(buf,result,max_size) \
  662. if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  663. { \
  664. int c = '*'; \
  665. int n; \
  666. for ( n = 0; n < max_size && \
  667. (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  668. buf[n] = (char) c; \
  669. if ( c == '\n' ) \
  670. buf[n++] = (char) c; \
  671. if ( c == EOF && ferror( yyin ) ) \
  672. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  673. result = n; \
  674. } \
  675. else \
  676. { \
  677. errno=0; \
  678. while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
  679. { \
  680. if( errno != EINTR) \
  681. { \
  682. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  683. break; \
  684. } \
  685. errno=0; \
  686. clearerr(yyin); \
  687. } \
  688. }\
  689. \
  690. #endif
  691. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  692. * we don't want an extra ';' after the "return" because that will cause
  693. * some compilers to complain about unreachable statements.
  694. */
  695. #ifndef yyterminate
  696. #define yyterminate() return YY_NULL
  697. #endif
  698. /* Number of entries by which start-condition stack grows. */
  699. #ifndef YY_START_STACK_INCR
  700. #define YY_START_STACK_INCR 25
  701. #endif
  702. /* Report a fatal error. */
  703. #ifndef YY_FATAL_ERROR
  704. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
  705. #endif
  706. /* end tables serialization structures and prototypes */
  707. /* Default declaration of generated scanner - a define so the user can
  708. * easily add parameters.
  709. */
  710. #ifndef YY_DECL
  711. #define YY_DECL_IS_OURS 1
  712. extern int yylex (yyscan_t yyscanner);
  713. #define YY_DECL int yylex (yyscan_t yyscanner)
  714. #endif /* !YY_DECL */
  715. /* Code executed at the beginning of each rule, after yytext and yyleng
  716. * have been set up.
  717. */
  718. #ifndef YY_USER_ACTION
  719. #define YY_USER_ACTION
  720. #endif
  721. /* Code executed at the end of each rule. */
  722. #ifndef YY_BREAK
  723. #define YY_BREAK /*LINTED*/break;
  724. #endif
  725. #define YY_RULE_SETUP \
  726. YY_USER_ACTION
  727. /** The main scanner function which does all the work.
  728. */
  729. YY_DECL
  730. {
  731. yy_state_type yy_current_state;
  732. char *yy_cp, *yy_bp;
  733. int yy_act;
  734. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  735. if ( !yyg->yy_init )
  736. {
  737. yyg->yy_init = 1;
  738. #ifdef YY_USER_INIT
  739. YY_USER_INIT;
  740. #endif
  741. if ( ! yyg->yy_start )
  742. yyg->yy_start = 1; /* first start state */
  743. if ( ! yyin )
  744. yyin = stdin;
  745. if ( ! yyout )
  746. yyout = stdout;
  747. if ( ! YY_CURRENT_BUFFER ) {
  748. yyensure_buffer_stack (yyscanner);
  749. YY_CURRENT_BUFFER_LVALUE =
  750. yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
  751. }
  752. yy_load_buffer_state( yyscanner );
  753. }
  754. {
  755. while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
  756. {
  757. yy_cp = yyg->yy_c_buf_p;
  758. /* Support of yytext. */
  759. *yy_cp = yyg->yy_hold_char;
  760. /* yy_bp points to the position in yy_ch_buf of the start of
  761. * the current run.
  762. */
  763. yy_bp = yy_cp;
  764. yy_current_state = yyg->yy_start;
  765. yy_match:
  766. do
  767. {
  768. YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
  769. if ( yy_accept[yy_current_state] )
  770. {
  771. yyg->yy_last_accepting_state = yy_current_state;
  772. yyg->yy_last_accepting_cpos = yy_cp;
  773. }
  774. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  775. {
  776. yy_current_state = (int) yy_def[yy_current_state];
  777. if ( yy_current_state >= 23 )
  778. yy_c = yy_meta[yy_c];
  779. }
  780. yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  781. ++yy_cp;
  782. }
  783. while ( yy_base[yy_current_state] != 21 );
  784. yy_find_action:
  785. yy_act = yy_accept[yy_current_state];
  786. if ( yy_act == 0 )
  787. { /* have to back up */
  788. yy_cp = yyg->yy_last_accepting_cpos;
  789. yy_current_state = yyg->yy_last_accepting_state;
  790. yy_act = yy_accept[yy_current_state];
  791. }
  792. YY_DO_BEFORE_ACTION;
  793. do_action: /* This label is used only to access EOF actions. */
  794. switch ( yy_act )
  795. { /* beginning of action switch */
  796. case 0: /* must back up */
  797. /* undo the effects of YY_DO_BEFORE_ACTION */
  798. *yy_cp = yyg->yy_hold_char;
  799. yy_cp = yyg->yy_last_accepting_cpos;
  800. yy_current_state = yyg->yy_last_accepting_state;
  801. goto yy_find_action;
  802. case 1:
  803. YY_RULE_SETUP
  804. { yylvalp->Number = atoi(yytext); return exp_NUMBER; }
  805. YY_BREAK
  806. case 2:
  807. YY_RULE_SETUP
  808. { return exp_PLUS; }
  809. YY_BREAK
  810. case 3:
  811. YY_RULE_SETUP
  812. { return exp_MINUS; }
  813. YY_BREAK
  814. case 4:
  815. YY_RULE_SETUP
  816. { return exp_TIMES; }
  817. YY_BREAK
  818. case 5:
  819. YY_RULE_SETUP
  820. { return exp_DIVIDE; }
  821. YY_BREAK
  822. case 6:
  823. YY_RULE_SETUP
  824. { return exp_MOD; }
  825. YY_BREAK
  826. case 7:
  827. YY_RULE_SETUP
  828. { return exp_OR; }
  829. YY_BREAK
  830. case 8:
  831. YY_RULE_SETUP
  832. { return exp_AND; }
  833. YY_BREAK
  834. case 9:
  835. YY_RULE_SETUP
  836. { return exp_XOR; }
  837. YY_BREAK
  838. case 10:
  839. YY_RULE_SETUP
  840. { return exp_NOT; }
  841. YY_BREAK
  842. case 11:
  843. YY_RULE_SETUP
  844. { return exp_SHIFTLEFT; }
  845. YY_BREAK
  846. case 12:
  847. YY_RULE_SETUP
  848. { return exp_SHIFTRIGHT; }
  849. YY_BREAK
  850. case 13:
  851. YY_RULE_SETUP
  852. { return exp_OPENPARENT; }
  853. YY_BREAK
  854. case 14:
  855. YY_RULE_SETUP
  856. { return exp_CLOSEPARENT; }
  857. YY_BREAK
  858. case 15:
  859. YY_RULE_SETUP
  860. ECHO;
  861. YY_BREAK
  862. case YY_STATE_EOF(INITIAL):
  863. yyterminate();
  864. case YY_END_OF_BUFFER:
  865. {
  866. /* Amount of text matched not including the EOB char. */
  867. int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
  868. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  869. *yy_cp = yyg->yy_hold_char;
  870. YY_RESTORE_YY_MORE_OFFSET
  871. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  872. {
  873. /* We're scanning a new file or input source. It's
  874. * possible that this happened because the user
  875. * just pointed yyin at a new source and called
  876. * yylex(). If so, then we have to assure
  877. * consistency between YY_CURRENT_BUFFER and our
  878. * globals. Here is the right place to do so, because
  879. * this is the first action (other than possibly a
  880. * back-up) that will match for the new input source.
  881. */
  882. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  883. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  884. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  885. }
  886. /* Note that here we test for yy_c_buf_p "<=" to the position
  887. * of the first EOB in the buffer, since yy_c_buf_p will
  888. * already have been incremented past the NUL character
  889. * (since all states make transitions on EOB to the
  890. * end-of-buffer state). Contrast this with the test
  891. * in input().
  892. */
  893. if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  894. { /* This was really a NUL. */
  895. yy_state_type yy_next_state;
  896. yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
  897. yy_current_state = yy_get_previous_state( yyscanner );
  898. /* Okay, we're now positioned to make the NUL
  899. * transition. We couldn't have
  900. * yy_get_previous_state() go ahead and do it
  901. * for us because it doesn't know how to deal
  902. * with the possibility of jamming (and we don't
  903. * want to build jamming into it because then it
  904. * will run more slowly).
  905. */
  906. yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
  907. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  908. if ( yy_next_state )
  909. {
  910. /* Consume the NUL. */
  911. yy_cp = ++yyg->yy_c_buf_p;
  912. yy_current_state = yy_next_state;
  913. goto yy_match;
  914. }
  915. else
  916. {
  917. yy_cp = yyg->yy_c_buf_p;
  918. goto yy_find_action;
  919. }
  920. }
  921. else switch ( yy_get_next_buffer( yyscanner ) )
  922. {
  923. case EOB_ACT_END_OF_FILE:
  924. {
  925. yyg->yy_did_buffer_switch_on_eof = 0;
  926. if ( yywrap( yyscanner ) )
  927. {
  928. /* Note: because we've taken care in
  929. * yy_get_next_buffer() to have set up
  930. * yytext, we can now set up
  931. * yy_c_buf_p so that if some total
  932. * hoser (like flex itself) wants to
  933. * call the scanner after we return the
  934. * YY_NULL, it'll still work - another
  935. * YY_NULL will get returned.
  936. */
  937. yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
  938. yy_act = YY_STATE_EOF(YY_START);
  939. goto do_action;
  940. }
  941. else
  942. {
  943. if ( ! yyg->yy_did_buffer_switch_on_eof )
  944. YY_NEW_FILE;
  945. }
  946. break;
  947. }
  948. case EOB_ACT_CONTINUE_SCAN:
  949. yyg->yy_c_buf_p =
  950. yyg->yytext_ptr + yy_amount_of_matched_text;
  951. yy_current_state = yy_get_previous_state( yyscanner );
  952. yy_cp = yyg->yy_c_buf_p;
  953. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  954. goto yy_match;
  955. case EOB_ACT_LAST_MATCH:
  956. yyg->yy_c_buf_p =
  957. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
  958. yy_current_state = yy_get_previous_state( yyscanner );
  959. yy_cp = yyg->yy_c_buf_p;
  960. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  961. goto yy_find_action;
  962. }
  963. break;
  964. }
  965. default:
  966. YY_FATAL_ERROR(
  967. "fatal flex scanner internal error--no action found" );
  968. } /* end of action switch */
  969. } /* end of scanning one token */
  970. } /* end of user's declarations */
  971. } /* end of yylex */
  972. /* yy_get_next_buffer - try to read in a new buffer
  973. *
  974. * Returns a code representing an action:
  975. * EOB_ACT_LAST_MATCH -
  976. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  977. * EOB_ACT_END_OF_FILE - end of file
  978. */
  979. static int yy_get_next_buffer (yyscan_t yyscanner)
  980. {
  981. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  982. char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  983. char *source = yyg->yytext_ptr;
  984. int number_to_move, i;
  985. int ret_val;
  986. if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
  987. YY_FATAL_ERROR(
  988. "fatal flex scanner internal error--end of buffer missed" );
  989. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  990. { /* Don't try to fill the buffer, so this is an EOF. */
  991. if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
  992. {
  993. /* We matched a single character, the EOB, so
  994. * treat this as a final EOF.
  995. */
  996. return EOB_ACT_END_OF_FILE;
  997. }
  998. else
  999. {
  1000. /* We matched some text prior to the EOB, first
  1001. * process it.
  1002. */
  1003. return EOB_ACT_LAST_MATCH;
  1004. }
  1005. }
  1006. /* Try to read more data. */
  1007. /* First move last chars to start of buffer. */
  1008. number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
  1009. for ( i = 0; i < number_to_move; ++i )
  1010. *(dest++) = *(source++);
  1011. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  1012. /* don't do the read, it's not guaranteed to return an EOF,
  1013. * just force an EOF
  1014. */
  1015. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
  1016. else
  1017. {
  1018. int num_to_read =
  1019. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  1020. while ( num_to_read <= 0 )
  1021. { /* Not enough room in the buffer - grow it. */
  1022. /* just a shorter name for the current buffer */
  1023. YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
  1024. int yy_c_buf_p_offset =
  1025. (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
  1026. if ( b->yy_is_our_buffer )
  1027. {
  1028. int new_size = b->yy_buf_size * 2;
  1029. if ( new_size <= 0 )
  1030. b->yy_buf_size += b->yy_buf_size / 8;
  1031. else
  1032. b->yy_buf_size *= 2;
  1033. b->yy_ch_buf = (char *)
  1034. /* Include room in for 2 EOB chars. */
  1035. yyrealloc( (void *) b->yy_ch_buf,
  1036. (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
  1037. }
  1038. else
  1039. /* Can't grow it, we don't own it. */
  1040. b->yy_ch_buf = NULL;
  1041. if ( ! b->yy_ch_buf )
  1042. YY_FATAL_ERROR(
  1043. "fatal error - scanner input buffer overflow" );
  1044. yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  1045. num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  1046. number_to_move - 1;
  1047. }
  1048. if ( num_to_read > YY_READ_BUF_SIZE )
  1049. num_to_read = YY_READ_BUF_SIZE;
  1050. /* Read in more data. */
  1051. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  1052. yyg->yy_n_chars, num_to_read );
  1053. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1054. }
  1055. if ( yyg->yy_n_chars == 0 )
  1056. {
  1057. if ( number_to_move == YY_MORE_ADJ )
  1058. {
  1059. ret_val = EOB_ACT_END_OF_FILE;
  1060. yyrestart( yyin , yyscanner);
  1061. }
  1062. else
  1063. {
  1064. ret_val = EOB_ACT_LAST_MATCH;
  1065. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  1066. YY_BUFFER_EOF_PENDING;
  1067. }
  1068. }
  1069. else
  1070. ret_val = EOB_ACT_CONTINUE_SCAN;
  1071. if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
  1072. /* Extend the array by 50%, plus the number we really need. */
  1073. int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
  1074. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
  1075. (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
  1076. if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1077. YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
  1078. /* "- 2" to take care of EOB's */
  1079. YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
  1080. }
  1081. yyg->yy_n_chars += number_to_move;
  1082. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  1083. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  1084. yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  1085. return ret_val;
  1086. }
  1087. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1088. static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
  1089. {
  1090. yy_state_type yy_current_state;
  1091. char *yy_cp;
  1092. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1093. yy_current_state = yyg->yy_start;
  1094. for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
  1095. {
  1096. YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  1097. if ( yy_accept[yy_current_state] )
  1098. {
  1099. yyg->yy_last_accepting_state = yy_current_state;
  1100. yyg->yy_last_accepting_cpos = yy_cp;
  1101. }
  1102. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1103. {
  1104. yy_current_state = (int) yy_def[yy_current_state];
  1105. if ( yy_current_state >= 23 )
  1106. yy_c = yy_meta[yy_c];
  1107. }
  1108. yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  1109. }
  1110. return yy_current_state;
  1111. }
  1112. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1113. *
  1114. * synopsis
  1115. * next_state = yy_try_NUL_trans( current_state );
  1116. */
  1117. static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
  1118. {
  1119. int yy_is_jam;
  1120. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
  1121. char *yy_cp = yyg->yy_c_buf_p;
  1122. YY_CHAR yy_c = 1;
  1123. if ( yy_accept[yy_current_state] )
  1124. {
  1125. yyg->yy_last_accepting_state = yy_current_state;
  1126. yyg->yy_last_accepting_cpos = yy_cp;
  1127. }
  1128. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1129. {
  1130. yy_current_state = (int) yy_def[yy_current_state];
  1131. if ( yy_current_state >= 23 )
  1132. yy_c = yy_meta[yy_c];
  1133. }
  1134. yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  1135. yy_is_jam = (yy_current_state == 22);
  1136. (void)yyg;
  1137. return yy_is_jam ? 0 : yy_current_state;
  1138. }
  1139. #ifndef YY_NO_UNPUT
  1140. static void yyunput (int c, char * yy_bp , yyscan_t yyscanner)
  1141. {
  1142. char *yy_cp;
  1143. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1144. yy_cp = yyg->yy_c_buf_p;
  1145. /* undo effects of setting up yytext */
  1146. *yy_cp = yyg->yy_hold_char;
  1147. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1148. { /* need to shift things up to make room */
  1149. /* +2 for EOB chars. */
  1150. int number_to_move = yyg->yy_n_chars + 2;
  1151. char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
  1152. YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
  1153. char *source =
  1154. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
  1155. while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1156. *--dest = *--source;
  1157. yy_cp += (int) (dest - source);
  1158. yy_bp += (int) (dest - source);
  1159. YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
  1160. yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
  1161. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1162. YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1163. }
  1164. *--yy_cp = (char) c;
  1165. yyg->yytext_ptr = yy_bp;
  1166. yyg->yy_hold_char = *yy_cp;
  1167. yyg->yy_c_buf_p = yy_cp;
  1168. }
  1169. #endif
  1170. #ifndef YY_NO_INPUT
  1171. #ifdef __cplusplus
  1172. static int yyinput (yyscan_t yyscanner)
  1173. #else
  1174. static int input (yyscan_t yyscanner)
  1175. #endif
  1176. {
  1177. int c;
  1178. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1179. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1180. if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1181. {
  1182. /* yy_c_buf_p now points to the character we want to return.
  1183. * If this occurs *before* the EOB characters, then it's a
  1184. * valid NUL; if not, then we've hit the end of the buffer.
  1185. */
  1186. if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  1187. /* This was really a NUL. */
  1188. *yyg->yy_c_buf_p = '\0';
  1189. else
  1190. { /* need more input */
  1191. int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
  1192. ++yyg->yy_c_buf_p;
  1193. switch ( yy_get_next_buffer( yyscanner ) )
  1194. {
  1195. case EOB_ACT_LAST_MATCH:
  1196. /* This happens because yy_g_n_b()
  1197. * sees that we've accumulated a
  1198. * token and flags that we need to
  1199. * try matching the token before
  1200. * proceeding. But for input(),
  1201. * there's no matching to consider.
  1202. * So convert the EOB_ACT_LAST_MATCH
  1203. * to EOB_ACT_END_OF_FILE.
  1204. */
  1205. /* Reset buffer status. */
  1206. yyrestart( yyin , yyscanner);
  1207. /*FALLTHROUGH*/
  1208. case EOB_ACT_END_OF_FILE:
  1209. {
  1210. if ( yywrap( yyscanner ) )
  1211. return 0;
  1212. if ( ! yyg->yy_did_buffer_switch_on_eof )
  1213. YY_NEW_FILE;
  1214. #ifdef __cplusplus
  1215. return yyinput(yyscanner);
  1216. #else
  1217. return input(yyscanner);
  1218. #endif
  1219. }
  1220. case EOB_ACT_CONTINUE_SCAN:
  1221. yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
  1222. break;
  1223. }
  1224. }
  1225. }
  1226. c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
  1227. *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
  1228. yyg->yy_hold_char = *++yyg->yy_c_buf_p;
  1229. return c;
  1230. }
  1231. #endif /* ifndef YY_NO_INPUT */
  1232. /** Immediately switch to a different input stream.
  1233. * @param input_file A readable stream.
  1234. * @param yyscanner The scanner object.
  1235. * @note This function does not reset the start condition to @c INITIAL .
  1236. */
  1237. void yyrestart (FILE * input_file , yyscan_t yyscanner)
  1238. {
  1239. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1240. if ( ! YY_CURRENT_BUFFER ){
  1241. yyensure_buffer_stack (yyscanner);
  1242. YY_CURRENT_BUFFER_LVALUE =
  1243. yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
  1244. }
  1245. yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
  1246. yy_load_buffer_state( yyscanner );
  1247. }
  1248. /** Switch to a different input buffer.
  1249. * @param new_buffer The new input buffer.
  1250. * @param yyscanner The scanner object.
  1251. */
  1252. void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  1253. {
  1254. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1255. /* TODO. We should be able to replace this entire function body
  1256. * with
  1257. * yypop_buffer_state();
  1258. * yypush_buffer_state(new_buffer);
  1259. */
  1260. yyensure_buffer_stack (yyscanner);
  1261. if ( YY_CURRENT_BUFFER == new_buffer )
  1262. return;
  1263. if ( YY_CURRENT_BUFFER )
  1264. {
  1265. /* Flush out information for old buffer. */
  1266. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1267. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  1268. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1269. }
  1270. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1271. yy_load_buffer_state( yyscanner );
  1272. /* We don't actually know whether we did this switch during
  1273. * EOF (yywrap()) processing, but the only time this flag
  1274. * is looked at is after yywrap() is called, so it's safe
  1275. * to go ahead and always set it.
  1276. */
  1277. yyg->yy_did_buffer_switch_on_eof = 1;
  1278. }
  1279. static void yy_load_buffer_state (yyscan_t yyscanner)
  1280. {
  1281. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1282. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1283. yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  1284. yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  1285. yyg->yy_hold_char = *yyg->yy_c_buf_p;
  1286. }
  1287. /** Allocate and initialize an input buffer state.
  1288. * @param file A readable stream.
  1289. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  1290. * @param yyscanner The scanner object.
  1291. * @return the allocated buffer state.
  1292. */
  1293. YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
  1294. {
  1295. YY_BUFFER_STATE b;
  1296. b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
  1297. if ( ! b )
  1298. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1299. b->yy_buf_size = size;
  1300. /* yy_ch_buf has to be 2 characters longer than the size given because
  1301. * we need to put in 2 end-of-buffer characters.
  1302. */
  1303. b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
  1304. if ( ! b->yy_ch_buf )
  1305. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1306. b->yy_is_our_buffer = 1;
  1307. yy_init_buffer( b, file , yyscanner);
  1308. return b;
  1309. }
  1310. /** Destroy the buffer.
  1311. * @param b a buffer created with yy_create_buffer()
  1312. * @param yyscanner The scanner object.
  1313. */
  1314. void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  1315. {
  1316. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1317. if ( ! b )
  1318. return;
  1319. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  1320. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  1321. if ( b->yy_is_our_buffer )
  1322. yyfree( (void *) b->yy_ch_buf , yyscanner );
  1323. yyfree( (void *) b , yyscanner );
  1324. }
  1325. /* Initializes or reinitializes a buffer.
  1326. * This function is sometimes called more than once on the same buffer,
  1327. * such as during a yyrestart() or at EOF.
  1328. */
  1329. static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
  1330. {
  1331. int oerrno = errno;
  1332. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1333. yy_flush_buffer( b , yyscanner);
  1334. b->yy_input_file = file;
  1335. b->yy_fill_buffer = 1;
  1336. /* If b is the current buffer, then yy_init_buffer was _probably_
  1337. * called from yyrestart() or through yy_get_next_buffer.
  1338. * In that case, we don't want to reset the lineno or column.
  1339. */
  1340. if (b != YY_CURRENT_BUFFER){
  1341. b->yy_bs_lineno = 1;
  1342. b->yy_bs_column = 0;
  1343. }
  1344. b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1345. errno = oerrno;
  1346. }
  1347. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  1348. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  1349. * @param yyscanner The scanner object.
  1350. */
  1351. void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  1352. {
  1353. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1354. if ( ! b )
  1355. return;
  1356. b->yy_n_chars = 0;
  1357. /* We always need two end-of-buffer characters. The first causes
  1358. * a transition to the end-of-buffer state. The second causes
  1359. * a jam in that state.
  1360. */
  1361. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1362. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1363. b->yy_buf_pos = &b->yy_ch_buf[0];
  1364. b->yy_at_bol = 1;
  1365. b->yy_buffer_status = YY_BUFFER_NEW;
  1366. if ( b == YY_CURRENT_BUFFER )
  1367. yy_load_buffer_state( yyscanner );
  1368. }
  1369. /** Pushes the new state onto the stack. The new state becomes
  1370. * the current state. This function will allocate the stack
  1371. * if necessary.
  1372. * @param new_buffer The new state.
  1373. * @param yyscanner The scanner object.
  1374. */
  1375. void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  1376. {
  1377. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1378. if (new_buffer == NULL)
  1379. return;
  1380. yyensure_buffer_stack(yyscanner);
  1381. /* This block is copied from yy_switch_to_buffer. */
  1382. if ( YY_CURRENT_BUFFER )
  1383. {
  1384. /* Flush out information for old buffer. */
  1385. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1386. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  1387. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1388. }
  1389. /* Only push if top exists. Otherwise, replace top. */
  1390. if (YY_CURRENT_BUFFER)
  1391. yyg->yy_buffer_stack_top++;
  1392. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1393. /* copied from yy_switch_to_buffer. */
  1394. yy_load_buffer_state( yyscanner );
  1395. yyg->yy_did_buffer_switch_on_eof = 1;
  1396. }
  1397. /** Removes and deletes the top of the stack, if present.
  1398. * The next element becomes the new top.
  1399. * @param yyscanner The scanner object.
  1400. */
  1401. void yypop_buffer_state (yyscan_t yyscanner)
  1402. {
  1403. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1404. if (!YY_CURRENT_BUFFER)
  1405. return;
  1406. yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
  1407. YY_CURRENT_BUFFER_LVALUE = NULL;
  1408. if (yyg->yy_buffer_stack_top > 0)
  1409. --yyg->yy_buffer_stack_top;
  1410. if (YY_CURRENT_BUFFER) {
  1411. yy_load_buffer_state( yyscanner );
  1412. yyg->yy_did_buffer_switch_on_eof = 1;
  1413. }
  1414. }
  1415. /* Allocates the stack if it does not exist.
  1416. * Guarantees space for at least one push.
  1417. */
  1418. static void yyensure_buffer_stack (yyscan_t yyscanner)
  1419. {
  1420. yy_size_t num_to_alloc;
  1421. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1422. if (!yyg->yy_buffer_stack) {
  1423. /* First allocation is just for 2 elements, since we don't know if this
  1424. * scanner will even need a stack. We use 2 instead of 1 to avoid an
  1425. * immediate realloc on the next call.
  1426. */
  1427. num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
  1428. yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
  1429. (num_to_alloc * sizeof(struct yy_buffer_state*)
  1430. , yyscanner);
  1431. if ( ! yyg->yy_buffer_stack )
  1432. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1433. memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  1434. yyg->yy_buffer_stack_max = num_to_alloc;
  1435. yyg->yy_buffer_stack_top = 0;
  1436. return;
  1437. }
  1438. if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
  1439. /* Increase the buffer to prepare for a possible push. */
  1440. yy_size_t grow_size = 8 /* arbitrary grow size */;
  1441. num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
  1442. yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
  1443. (yyg->yy_buffer_stack,
  1444. num_to_alloc * sizeof(struct yy_buffer_state*)
  1445. , yyscanner);
  1446. if ( ! yyg->yy_buffer_stack )
  1447. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1448. /* zero only the new slots.*/
  1449. memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
  1450. yyg->yy_buffer_stack_max = num_to_alloc;
  1451. }
  1452. }
  1453. /** Setup the input buffer state to scan directly from a user-specified character buffer.
  1454. * @param base the character buffer
  1455. * @param size the size in bytes of the character buffer
  1456. * @param yyscanner The scanner object.
  1457. * @return the newly allocated buffer state object.
  1458. */
  1459. YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
  1460. {
  1461. YY_BUFFER_STATE b;
  1462. if ( size < 2 ||
  1463. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1464. base[size-1] != YY_END_OF_BUFFER_CHAR )
  1465. /* They forgot to leave room for the EOB's. */
  1466. return NULL;
  1467. b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
  1468. if ( ! b )
  1469. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  1470. b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
  1471. b->yy_buf_pos = b->yy_ch_buf = base;
  1472. b->yy_is_our_buffer = 0;
  1473. b->yy_input_file = NULL;
  1474. b->yy_n_chars = b->yy_buf_size;
  1475. b->yy_is_interactive = 0;
  1476. b->yy_at_bol = 1;
  1477. b->yy_fill_buffer = 0;
  1478. b->yy_buffer_status = YY_BUFFER_NEW;
  1479. yy_switch_to_buffer( b , yyscanner );
  1480. return b;
  1481. }
  1482. /** Setup the input buffer state to scan a string. The next call to yylex() will
  1483. * scan from a @e copy of @a str.
  1484. * @param yystr a NUL-terminated string to scan
  1485. * @param yyscanner The scanner object.
  1486. * @return the newly allocated buffer state object.
  1487. * @note If you want to scan bytes that may contain NUL values, then use
  1488. * yy_scan_bytes() instead.
  1489. */
  1490. YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
  1491. {
  1492. return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
  1493. }
  1494. /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  1495. * scan from a @e copy of @a bytes.
  1496. * @param yybytes the byte buffer to scan
  1497. * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  1498. * @param yyscanner The scanner object.
  1499. * @return the newly allocated buffer state object.
  1500. */
  1501. YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
  1502. {
  1503. YY_BUFFER_STATE b;
  1504. char *buf;
  1505. yy_size_t n;
  1506. int i;
  1507. /* Get memory for full buffer, including space for trailing EOB's. */
  1508. n = (yy_size_t) (_yybytes_len + 2);
  1509. buf = (char *) yyalloc( n , yyscanner );
  1510. if ( ! buf )
  1511. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  1512. for ( i = 0; i < _yybytes_len; ++i )
  1513. buf[i] = yybytes[i];
  1514. buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
  1515. b = yy_scan_buffer( buf, n , yyscanner);
  1516. if ( ! b )
  1517. YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  1518. /* It's okay to grow etc. this buffer, and we should throw it
  1519. * away when we're done.
  1520. */
  1521. b->yy_is_our_buffer = 1;
  1522. return b;
  1523. }
  1524. #ifndef YY_EXIT_FAILURE
  1525. #define YY_EXIT_FAILURE 2
  1526. #endif
  1527. static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
  1528. {
  1529. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1530. (void)yyg;
  1531. fprintf( stderr, "%s\n", msg );
  1532. exit( YY_EXIT_FAILURE );
  1533. }
  1534. /* Redefine yyless() so it works in section 3 code. */
  1535. #undef yyless
  1536. #define yyless(n) \
  1537. do \
  1538. { \
  1539. /* Undo effects of setting up yytext. */ \
  1540. int yyless_macro_arg = (n); \
  1541. YY_LESS_LINENO(yyless_macro_arg);\
  1542. yytext[yyleng] = yyg->yy_hold_char; \
  1543. yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
  1544. yyg->yy_hold_char = *yyg->yy_c_buf_p; \
  1545. *yyg->yy_c_buf_p = '\0'; \
  1546. yyleng = yyless_macro_arg; \
  1547. } \
  1548. while ( 0 )
  1549. /* Accessor methods (get/set functions) to struct members. */
  1550. /** Get the user-defined data for this scanner.
  1551. * @param yyscanner The scanner object.
  1552. */
  1553. YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
  1554. {
  1555. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1556. return yyextra;
  1557. }
  1558. /** Get the current line number.
  1559. * @param yyscanner The scanner object.
  1560. */
  1561. int yyget_lineno (yyscan_t yyscanner)
  1562. {
  1563. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1564. if (! YY_CURRENT_BUFFER)
  1565. return 0;
  1566. return yylineno;
  1567. }
  1568. /** Get the current column number.
  1569. * @param yyscanner The scanner object.
  1570. */
  1571. int yyget_column (yyscan_t yyscanner)
  1572. {
  1573. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1574. if (! YY_CURRENT_BUFFER)
  1575. return 0;
  1576. return yycolumn;
  1577. }
  1578. /** Get the input stream.
  1579. * @param yyscanner The scanner object.
  1580. */
  1581. FILE *yyget_in (yyscan_t yyscanner)
  1582. {
  1583. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1584. return yyin;
  1585. }
  1586. /** Get the output stream.
  1587. * @param yyscanner The scanner object.
  1588. */
  1589. FILE *yyget_out (yyscan_t yyscanner)
  1590. {
  1591. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1592. return yyout;
  1593. }
  1594. /** Get the length of the current token.
  1595. * @param yyscanner The scanner object.
  1596. */
  1597. int yyget_leng (yyscan_t yyscanner)
  1598. {
  1599. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1600. return yyleng;
  1601. }
  1602. /** Get the current token.
  1603. * @param yyscanner The scanner object.
  1604. */
  1605. char *yyget_text (yyscan_t yyscanner)
  1606. {
  1607. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1608. return yytext;
  1609. }
  1610. /** Set the user-defined data. This data is never touched by the scanner.
  1611. * @param user_defined The data to be associated with this scanner.
  1612. * @param yyscanner The scanner object.
  1613. */
  1614. void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
  1615. {
  1616. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1617. yyextra = user_defined ;
  1618. }
  1619. /** Set the current line number.
  1620. * @param _line_number line number
  1621. * @param yyscanner The scanner object.
  1622. */
  1623. void yyset_lineno (int _line_number , yyscan_t yyscanner)
  1624. {
  1625. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1626. /* lineno is only valid if an input buffer exists. */
  1627. if (! YY_CURRENT_BUFFER )
  1628. YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
  1629. yylineno = _line_number;
  1630. }
  1631. /** Set the current column.
  1632. * @param _column_no column number
  1633. * @param yyscanner The scanner object.
  1634. */
  1635. void yyset_column (int _column_no , yyscan_t yyscanner)
  1636. {
  1637. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1638. /* column is only valid if an input buffer exists. */
  1639. if (! YY_CURRENT_BUFFER )
  1640. YY_FATAL_ERROR( "yyset_column called with no buffer" );
  1641. yycolumn = _column_no;
  1642. }
  1643. /** Set the input stream. This does not discard the current
  1644. * input buffer.
  1645. * @param _in_str A readable stream.
  1646. * @param yyscanner The scanner object.
  1647. * @see yy_switch_to_buffer
  1648. */
  1649. void yyset_in (FILE * _in_str , yyscan_t yyscanner)
  1650. {
  1651. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1652. yyin = _in_str ;
  1653. }
  1654. void yyset_out (FILE * _out_str , yyscan_t yyscanner)
  1655. {
  1656. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1657. yyout = _out_str ;
  1658. }
  1659. int yyget_debug (yyscan_t yyscanner)
  1660. {
  1661. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1662. return yy_flex_debug;
  1663. }
  1664. void yyset_debug (int _bdebug , yyscan_t yyscanner)
  1665. {
  1666. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1667. yy_flex_debug = _bdebug ;
  1668. }
  1669. /* Accessor methods for yylval and yylloc */
  1670. /* User-visible API */
  1671. /* yylex_init is special because it creates the scanner itself, so it is
  1672. * the ONLY reentrant function that doesn't take the scanner as the last argument.
  1673. * That's why we explicitly handle the declaration, instead of using our macros.
  1674. */
  1675. int yylex_init(yyscan_t* ptr_yy_globals)
  1676. {
  1677. if (ptr_yy_globals == NULL){
  1678. errno = EINVAL;
  1679. return 1;
  1680. }
  1681. *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
  1682. if (*ptr_yy_globals == NULL){
  1683. errno = ENOMEM;
  1684. return 1;
  1685. }
  1686. /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
  1687. memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  1688. return yy_init_globals ( *ptr_yy_globals );
  1689. }
  1690. /* yylex_init_extra has the same functionality as yylex_init, but follows the
  1691. * convention of taking the scanner as the last argument. Note however, that
  1692. * this is a *pointer* to a scanner, as it will be allocated by this call (and
  1693. * is the reason, too, why this function also must handle its own declaration).
  1694. * The user defined value in the first argument will be available to yyalloc in
  1695. * the yyextra field.
  1696. */
  1697. int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
  1698. {
  1699. struct yyguts_t dummy_yyguts;
  1700. yyset_extra (yy_user_defined, &dummy_yyguts);
  1701. if (ptr_yy_globals == NULL){
  1702. errno = EINVAL;
  1703. return 1;
  1704. }
  1705. *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
  1706. if (*ptr_yy_globals == NULL){
  1707. errno = ENOMEM;
  1708. return 1;
  1709. }
  1710. /* By setting to 0xAA, we expose bugs in
  1711. yy_init_globals. Leave at 0x00 for releases. */
  1712. memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  1713. yyset_extra (yy_user_defined, *ptr_yy_globals);
  1714. return yy_init_globals ( *ptr_yy_globals );
  1715. }
  1716. static int yy_init_globals (yyscan_t yyscanner)
  1717. {
  1718. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1719. /* Initialization is the same as for the non-reentrant scanner.
  1720. * This function is called from yylex_destroy(), so don't allocate here.
  1721. */
  1722. yyg->yy_buffer_stack = NULL;
  1723. yyg->yy_buffer_stack_top = 0;
  1724. yyg->yy_buffer_stack_max = 0;
  1725. yyg->yy_c_buf_p = NULL;
  1726. yyg->yy_init = 0;
  1727. yyg->yy_start = 0;
  1728. yyg->yy_start_stack_ptr = 0;
  1729. yyg->yy_start_stack_depth = 0;
  1730. yyg->yy_start_stack = NULL;
  1731. /* Defined in main.c */
  1732. #ifdef YY_STDINIT
  1733. yyin = stdin;
  1734. yyout = stdout;
  1735. #else
  1736. yyin = NULL;
  1737. yyout = NULL;
  1738. #endif
  1739. /* For future reference: Set errno on error, since we are called by
  1740. * yylex_init()
  1741. */
  1742. return 0;
  1743. }
  1744. /* yylex_destroy is for both reentrant and non-reentrant scanners. */
  1745. int yylex_destroy (yyscan_t yyscanner)
  1746. {
  1747. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1748. /* Pop the buffer stack, destroying each element. */
  1749. while(YY_CURRENT_BUFFER){
  1750. yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
  1751. YY_CURRENT_BUFFER_LVALUE = NULL;
  1752. yypop_buffer_state(yyscanner);
  1753. }
  1754. /* Destroy the stack itself. */
  1755. yyfree(yyg->yy_buffer_stack , yyscanner);
  1756. yyg->yy_buffer_stack = NULL;
  1757. /* Destroy the start condition stack. */
  1758. yyfree( yyg->yy_start_stack , yyscanner );
  1759. yyg->yy_start_stack = NULL;
  1760. /* Reset the globals. This is important in a non-reentrant scanner so the next time
  1761. * yylex() is called, initialization will occur. */
  1762. yy_init_globals( yyscanner);
  1763. /* Destroy the main struct (reentrant only). */
  1764. yyfree ( yyscanner , yyscanner );
  1765. yyscanner = NULL;
  1766. return 0;
  1767. }
  1768. /*
  1769. * Internal utility routines.
  1770. */
  1771. #ifndef yytext_ptr
  1772. static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
  1773. {
  1774. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1775. (void)yyg;
  1776. int i;
  1777. for ( i = 0; i < n; ++i )
  1778. s1[i] = s2[i];
  1779. }
  1780. #endif
  1781. #ifdef YY_NEED_STRLEN
  1782. static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
  1783. {
  1784. int n;
  1785. for ( n = 0; s[n]; ++n )
  1786. ;
  1787. return n;
  1788. }
  1789. #endif
  1790. void *yyalloc (yy_size_t size , yyscan_t yyscanner)
  1791. {
  1792. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1793. (void)yyg;
  1794. return malloc(size);
  1795. }
  1796. void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
  1797. {
  1798. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1799. (void)yyg;
  1800. /* The cast to (char *) in the following accommodates both
  1801. * implementations that use char* generic pointers, and those
  1802. * that use void* generic pointers. It works with the latter
  1803. * because both ANSI C and C++ allow castless assignment from
  1804. * any pointer type to void*, and deal with argument conversions
  1805. * as though doing an assignment.
  1806. */
  1807. return realloc(ptr, size);
  1808. }
  1809. void yyfree (void * ptr , yyscan_t yyscanner)
  1810. {
  1811. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1812. (void)yyg;
  1813. free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
  1814. }
  1815. #define YYTABLES_NAME "yytables"