cmExprLexer.cxx 55 KB

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