You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1934 lines
54 KiB

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