cmExprLexer.cxx 55 KB

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