cmExprLexer.cxx 54 KB

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