cmExprLexer.cxx 54 KB

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