cmExprLexer.cxx 54 KB

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