cmCommandArgumentLexer.cxx 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976
  1. #define YY_INT_ALIGNED short int
  2. /* A lexical scanner generated by flex */
  3. #define FLEX_SCANNER
  4. #define YY_FLEX_MAJOR_VERSION 2
  5. #define YY_FLEX_MINOR_VERSION 5
  6. #define YY_FLEX_SUBMINOR_VERSION 31
  7. #if YY_FLEX_SUBMINOR_VERSION > 0
  8. #define FLEX_BETA
  9. #endif
  10. /* First, we deal with platform-specific or compiler-specific issues. */
  11. /* begin standard C headers. */
  12. #include <stdio.h>
  13. #include <string.h>
  14. #include <errno.h>
  15. #include <stdlib.h>
  16. /* end standard C headers. */
  17. /* flex integer type definitions */
  18. #ifndef FLEXINT_H
  19. #define FLEXINT_H
  20. /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
  21. #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
  22. #include <inttypes.h>
  23. typedef int8_t flex_int8_t;
  24. typedef uint8_t flex_uint8_t;
  25. typedef int16_t flex_int16_t;
  26. typedef uint16_t flex_uint16_t;
  27. typedef int32_t flex_int32_t;
  28. typedef uint32_t flex_uint32_t;
  29. #else
  30. typedef signed char flex_int8_t;
  31. typedef short int flex_int16_t;
  32. typedef int flex_int32_t;
  33. typedef unsigned char flex_uint8_t;
  34. typedef unsigned short int flex_uint16_t;
  35. typedef unsigned int flex_uint32_t;
  36. #endif /* ! C99 */
  37. /* Limits of integral types. */
  38. #ifndef INT8_MIN
  39. #define INT8_MIN (-128)
  40. #endif
  41. #ifndef INT16_MIN
  42. #define INT16_MIN (-32767-1)
  43. #endif
  44. #ifndef INT32_MIN
  45. #define INT32_MIN (-2147483647-1)
  46. #endif
  47. #ifndef INT8_MAX
  48. #define INT8_MAX (127)
  49. #endif
  50. #ifndef INT16_MAX
  51. #define INT16_MAX (32767)
  52. #endif
  53. #ifndef INT32_MAX
  54. #define INT32_MAX (2147483647)
  55. #endif
  56. #ifndef UINT8_MAX
  57. #define UINT8_MAX (255U)
  58. #endif
  59. #ifndef UINT16_MAX
  60. #define UINT16_MAX (65535U)
  61. #endif
  62. #ifndef UINT32_MAX
  63. #define UINT32_MAX (4294967295U)
  64. #endif
  65. #endif /* ! FLEXINT_H */
  66. #ifdef __cplusplus
  67. /* The "const" storage-class-modifier is valid. */
  68. #define YY_USE_CONST
  69. #else /* ! __cplusplus */
  70. #if __STDC__
  71. #define YY_USE_CONST
  72. #endif /* __STDC__ */
  73. #endif /* ! __cplusplus */
  74. #ifdef YY_USE_CONST
  75. #define yyconst const
  76. #else
  77. #define yyconst
  78. #endif
  79. /* Returned upon end-of-file. */
  80. #define YY_NULL 0
  81. /* Promotes a possibly negative, possibly signed char to an unsigned
  82. * integer for use as an array index. If the signed char is negative,
  83. * we want to instead treat it as an 8-bit unsigned char, hence the
  84. * double cast.
  85. */
  86. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  87. /* An opaque pointer. */
  88. #ifndef YY_TYPEDEF_YY_SCANNER_T
  89. #define YY_TYPEDEF_YY_SCANNER_T
  90. typedef void* yyscan_t;
  91. #endif
  92. /* For convenience, these vars (plus the bison vars far below)
  93. are macros in the reentrant scanner. */
  94. #define yyin yyg->yyin_r
  95. #define yyout yyg->yyout_r
  96. #define yyextra yyg->yyextra_r
  97. #define yyleng yyg->yyleng_r
  98. #define yytext yyg->yytext_r
  99. #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
  100. #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
  101. #define yy_flex_debug yyg->yy_flex_debug_r
  102. int cmCommandArgument_yylex_init (yyscan_t* scanner);
  103. /* Enter a start condition. This macro really ought to take a parameter,
  104. * but we do it the disgusting crufty way forced on us by the ()-less
  105. * definition of BEGIN.
  106. */
  107. #define BEGIN yyg->yy_start = 1 + 2 *
  108. /* Translate the current start state into a value that can be later handed
  109. * to BEGIN to return to the state. The YYSTATE alias is for lex
  110. * compatibility.
  111. */
  112. #define YY_START ((yyg->yy_start - 1) / 2)
  113. #define YYSTATE YY_START
  114. /* Action number for EOF rule of a given start state. */
  115. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  116. /* Special action meaning "start processing a new file". */
  117. #define YY_NEW_FILE cmCommandArgument_yyrestart(yyin ,yyscanner )
  118. #define YY_END_OF_BUFFER_CHAR 0
  119. /* Size of default input buffer. */
  120. #ifndef YY_BUF_SIZE
  121. #define YY_BUF_SIZE 16384
  122. #endif
  123. #ifndef YY_TYPEDEF_YY_BUFFER_STATE
  124. #define YY_TYPEDEF_YY_BUFFER_STATE
  125. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  126. #endif
  127. #define EOB_ACT_CONTINUE_SCAN 0
  128. #define EOB_ACT_END_OF_FILE 1
  129. #define EOB_ACT_LAST_MATCH 2
  130. #define YY_LESS_LINENO(n)
  131. /* Return all but the first "n" matched characters back to the input
  132. stream. */
  133. #define yyless(n) \
  134. do \
  135. { \
  136. /* Undo effects of setting up yytext. */ \
  137. int yyless_macro_arg = (n); \
  138. YY_LESS_LINENO(yyless_macro_arg);\
  139. *yy_cp = yyg->yy_hold_char; \
  140. YY_RESTORE_YY_MORE_OFFSET \
  141. yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  142. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  143. } \
  144. while ( 0 )
  145. /* The following is because we cannot portably get our hands on size_t
  146. * (without autoconf's help, which isn't available because we want
  147. * flex-generated scanners to compile on their own).
  148. */
  149. #ifndef YY_TYPEDEF_YY_SIZE_T
  150. #define YY_TYPEDEF_YY_SIZE_T
  151. typedef unsigned int yy_size_t;
  152. #endif
  153. #ifndef YY_STRUCT_YY_BUFFER_STATE
  154. #define YY_STRUCT_YY_BUFFER_STATE
  155. struct yy_buffer_state
  156. {
  157. FILE *yy_input_file;
  158. char *yy_ch_buf; /* input buffer */
  159. char *yy_buf_pos; /* current position in input buffer */
  160. /* Size of input buffer in bytes, not including room for EOB
  161. * characters.
  162. */
  163. yy_size_t yy_buf_size;
  164. /* Number of characters read into yy_ch_buf, not including EOB
  165. * characters.
  166. */
  167. int yy_n_chars;
  168. /* Whether we "own" the buffer - i.e., we know we created it,
  169. * and can realloc() it to grow it, and should free() it to
  170. * delete it.
  171. */
  172. int yy_is_our_buffer;
  173. /* Whether this is an "interactive" input source; if so, and
  174. * if we're using stdio for input, then we want to use getc()
  175. * instead of fread(), to make sure we stop fetching input after
  176. * each newline.
  177. */
  178. int yy_is_interactive;
  179. /* Whether we're considered to be at the beginning of a line.
  180. * If so, '^' rules will be active on the next match, otherwise
  181. * not.
  182. */
  183. int yy_at_bol;
  184. int yy_bs_lineno; /**< The line count. */
  185. int yy_bs_column; /**< The column count. */
  186. /* Whether to try to fill the input buffer when we reach the
  187. * end of it.
  188. */
  189. int yy_fill_buffer;
  190. int yy_buffer_status;
  191. #define YY_BUFFER_NEW 0
  192. #define YY_BUFFER_NORMAL 1
  193. /* When an EOF's been seen but there's still some text to process
  194. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  195. * shouldn't try reading from the input source any more. We might
  196. * still have a bunch of tokens to match, though, because of
  197. * possible backing-up.
  198. *
  199. * When we actually see the EOF, we change the status to "new" (via
  200. * cmCommandArgument_yyrestart()), so that the user can continue scanning
  201. * by just pointing yyin at a new input file.
  202. */
  203. #define YY_BUFFER_EOF_PENDING 2
  204. };
  205. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  206. /* We provide macros for accessing buffer states in case in the
  207. * future we want to put the buffer states in a more general
  208. * "scanner state".
  209. *
  210. * Returns the top of the stack, or NULL.
  211. */
  212. #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
  213. ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
  214. : NULL)
  215. /* Same as previous macro, but useful when we know that the buffer stack is
  216. * not NULL or when we need an lvalue. For internal use only.
  217. */
  218. #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
  219. void cmCommandArgument_yyrestart (FILE *input_file ,yyscan_t yyscanner );
  220. void cmCommandArgument_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,
  221. yyscan_t yyscanner );
  222. YY_BUFFER_STATE cmCommandArgument_yy_create_buffer (FILE *file,int size ,
  223. yyscan_t yyscanner );
  224. void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b ,
  225. yyscan_t yyscanner );
  226. void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b ,
  227. yyscan_t yyscanner );
  228. void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,
  229. yyscan_t yyscanner );
  230. void cmCommandArgument_yypop_buffer_state (yyscan_t yyscanner );
  231. static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner );
  232. static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner );
  233. static void cmCommandArgument_yy_init_buffer (YY_BUFFER_STATE b,
  234. FILE *file ,
  235. yyscan_t yyscanner );
  236. #define YY_FLUSH_BUFFER cmCommandArgument_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
  237. YY_BUFFER_STATE cmCommandArgument_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
  238. YY_BUFFER_STATE cmCommandArgument_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
  239. YY_BUFFER_STATE cmCommandArgument_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
  240. void *cmCommandArgument_yyalloc (yy_size_t ,yyscan_t yyscanner );
  241. void *cmCommandArgument_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
  242. void cmCommandArgument_yyfree (void * ,yyscan_t yyscanner );
  243. #define yy_new_buffer cmCommandArgument_yy_create_buffer
  244. #define yy_set_interactive(is_interactive) \
  245. { \
  246. if ( ! YY_CURRENT_BUFFER ){ \
  247. cmCommandArgument_yyensure_buffer_stack (yyscanner); \
  248. YY_CURRENT_BUFFER_LVALUE = \
  249. cmCommandArgument_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
  250. } \
  251. YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  252. }
  253. #define yy_set_bol(at_bol) \
  254. { \
  255. if ( ! YY_CURRENT_BUFFER ){\
  256. cmCommandArgument_yyensure_buffer_stack (yyscanner); \
  257. YY_CURRENT_BUFFER_LVALUE = \
  258. cmCommandArgument_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
  259. } \
  260. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  261. }
  262. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  263. /* Begin user sect3 */
  264. #define cmCommandArgument_yywrap(n) 1
  265. #define YY_SKIP_YYWRAP
  266. typedef unsigned char YY_CHAR;
  267. typedef int yy_state_type;
  268. #define yytext_ptr yytext_r
  269. static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
  270. static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
  271. static int yy_get_next_buffer (yyscan_t yyscanner );
  272. static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
  273. /* Done after the current pattern has been matched and before the
  274. * corresponding action - sets up yytext.
  275. */
  276. #define YY_DO_BEFORE_ACTION \
  277. yyg->yytext_ptr = yy_bp; \
  278. yyleng = (size_t) (yy_cp - yy_bp); \
  279. yyg->yy_hold_char = *yy_cp; \
  280. *yy_cp = '\0'; \
  281. yyg->yy_c_buf_p = yy_cp;
  282. #define YY_NUM_RULES 12
  283. #define YY_END_OF_BUFFER 13
  284. /* This struct is not used in this scanner,
  285. but its presence is necessary. */
  286. struct yy_trans_info
  287. {
  288. flex_int32_t yy_verify;
  289. flex_int32_t yy_nxt;
  290. };
  291. static yyconst flex_int16_t yy_accept[20] =
  292. { 0,
  293. 0, 0, 13, 8, 9, 6, 5, 11, 10, 4,
  294. 8, 0, 3, 6, 0, 7, 1, 2, 0
  295. } ;
  296. static yyconst flex_int32_t yy_ec[256] =
  297. { 0,
  298. 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
  299. 1, 1, 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, 3, 1, 1, 1, 1,
  302. 1, 1, 1, 1, 4, 4, 4, 4, 4, 4,
  303. 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
  304. 1, 1, 1, 5, 4, 4, 4, 4, 4, 4,
  305. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  306. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  307. 1, 6, 1, 1, 4, 1, 4, 4, 4, 4,
  308. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  309. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  310. 4, 4, 7, 1, 8, 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, 1, 1, 1, 1, 1,
  322. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  323. 1, 1, 1, 1, 1
  324. } ;
  325. static yyconst flex_int32_t yy_meta[9] =
  326. { 0,
  327. 1, 2, 3, 1, 3, 3, 3, 3
  328. } ;
  329. static yyconst flex_int16_t yy_base[22] =
  330. { 0,
  331. 0, 0, 20, 0, 5, 14, 7, 0, 21, 21,
  332. 0, 3, 21, 0, 9, 21, 21, 21, 21, 14,
  333. 16
  334. } ;
  335. static yyconst flex_int16_t yy_def[22] =
  336. { 0,
  337. 19, 1, 19, 20, 19, 20, 19, 21, 19, 19,
  338. 20, 5, 19, 6, 19, 19, 19, 19, 0, 19,
  339. 19
  340. } ;
  341. static yyconst flex_int16_t yy_nxt[30] =
  342. { 0,
  343. 4, 4, 5, 6, 7, 8, 9, 10, 12, 17,
  344. 15, 13, 15, 18, 11, 11, 16, 14, 16, 19,
  345. 3, 19, 19, 19, 19, 19, 19, 19, 19
  346. } ;
  347. static yyconst flex_int16_t yy_chk[30] =
  348. { 0,
  349. 1, 1, 1, 1, 1, 1, 1, 1, 5, 12,
  350. 7, 5, 15, 15, 20, 20, 21, 6, 21, 3,
  351. 19, 19, 19, 19, 19, 19, 19, 19, 19
  352. } ;
  353. /* The intent behind this definition is that it'll catch
  354. * any uses of REJECT which flex missed.
  355. */
  356. #define REJECT reject_used_but_not_detected
  357. #define yymore() yymore_used_but_not_detected
  358. #define YY_MORE_ADJ 0
  359. #define YY_RESTORE_YY_MORE_OFFSET
  360. /*=========================================================================
  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=cmCommandArgument_yy --header-file=cmCommandArgumentLexer.h -ocmCommandArgumentLexer.cxx cmCommandArgumentLexer.in.l
  376. Modify cmCommandArgumentLexer.cxx:
  377. - remove TABs
  378. - remove "yyscanner" argument from these methods:
  379. yy_fatal_error, cmCommandArgument_yyalloc, cmCommandArgument_yyrealloc, cmCommandArgument_yyfree
  380. - remove all YY_BREAK lines occurring right after return statements
  381. - change while ( 1 ) to for(;;)
  382. Modify cmCommandArgumentLexer.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 "cmCommandArgumentParserHelper.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 "cmCommandArgumentParserTokens.h"
  396. /*--------------------------------------------------------------------------*/
  397. #define INITIAL 0
  398. #ifndef YY_NO_UNISTD_H
  399. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  400. * down here because we want the user's section 1 to have been scanned first.
  401. * The user has a chance to override it with an option.
  402. */
  403. #include <unistd.h>
  404. #endif
  405. #ifndef YY_EXTRA_TYPE
  406. #define YY_EXTRA_TYPE void *
  407. #endif
  408. /* Holds the entire state of the reentrant scanner. */
  409. struct yyguts_t
  410. {
  411. /* User-defined. Not touched by flex. */
  412. YY_EXTRA_TYPE yyextra_r;
  413. /* The rest are the same as the globals declared in the non-reentrant scanner. */
  414. FILE *yyin_r, *yyout_r;
  415. size_t yy_buffer_stack_top; /**< index of top of stack. */
  416. size_t yy_buffer_stack_max; /**< capacity of stack. */
  417. YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
  418. char yy_hold_char;
  419. int yy_n_chars;
  420. int yyleng_r;
  421. char *yy_c_buf_p;
  422. int yy_init;
  423. int yy_start;
  424. int yy_did_buffer_switch_on_eof;
  425. int yy_start_stack_ptr;
  426. int yy_start_stack_depth;
  427. int *yy_start_stack;
  428. yy_state_type yy_last_accepting_state;
  429. char* yy_last_accepting_cpos;
  430. int yylineno_r;
  431. int yy_flex_debug_r;
  432. char *yytext_r;
  433. int yy_more_flag;
  434. int yy_more_len;
  435. }; /* end struct yyguts_t */
  436. /* Accessor methods to globals.
  437. These are made visible to non-reentrant scanners for convenience. */
  438. int cmCommandArgument_yylex_destroy (yyscan_t yyscanner );
  439. int cmCommandArgument_yyget_debug (yyscan_t yyscanner );
  440. void cmCommandArgument_yyset_debug (int debug_flag ,yyscan_t yyscanner );
  441. YY_EXTRA_TYPE cmCommandArgument_yyget_extra (yyscan_t yyscanner );
  442. void cmCommandArgument_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
  443. FILE *cmCommandArgument_yyget_in (yyscan_t yyscanner );
  444. void cmCommandArgument_yyset_in (FILE * in_str ,yyscan_t yyscanner );
  445. FILE *cmCommandArgument_yyget_out (yyscan_t yyscanner );
  446. void cmCommandArgument_yyset_out (FILE * out_str ,yyscan_t yyscanner );
  447. int cmCommandArgument_yyget_leng (yyscan_t yyscanner );
  448. char *cmCommandArgument_yyget_text (yyscan_t yyscanner );
  449. int cmCommandArgument_yyget_lineno (yyscan_t yyscanner );
  450. void cmCommandArgument_yyset_lineno (int line_number ,yyscan_t yyscanner );
  451. /* Macros after this point can all be overridden by user definitions in
  452. * section 1.
  453. */
  454. #ifndef YY_SKIP_YYWRAP
  455. #ifdef __cplusplus
  456. extern "C" int cmCommandArgument_yywrap (yyscan_t yyscanner );
  457. #else
  458. extern int cmCommandArgument_yywrap (yyscan_t yyscanner );
  459. #endif
  460. #endif
  461. #ifndef yytext_ptr
  462. static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
  463. #endif
  464. #ifdef YY_NEED_STRLEN
  465. static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
  466. #endif
  467. #ifndef YY_NO_INPUT
  468. #ifdef __cplusplus
  469. static int yyinput (yyscan_t yyscanner );
  470. #else
  471. static int input (yyscan_t yyscanner );
  472. #endif
  473. #endif
  474. /* Amount of stuff to slurp up with each read. */
  475. #ifndef YY_READ_BUF_SIZE
  476. #define YY_READ_BUF_SIZE 8192
  477. #endif
  478. /* Copy whatever the last rule matched to the standard output. */
  479. #ifndef ECHO
  480. /* This used to be an fputs(), but since the string might contain NUL's,
  481. * we now use fwrite().
  482. */
  483. #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
  484. #endif
  485. /* Gets input and stuffs it into "buf". number of characters read, or
  486. * YY_NULL, is returned in "result".
  487. */
  488. #ifndef YY_INPUT
  489. #define YY_INPUT(buf,result,max_size) \
  490. if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  491. { \
  492. int c = '*'; \
  493. size_t n; \
  494. for ( n = 0; n < max_size && \
  495. (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  496. buf[n] = (char) c; \
  497. if ( c == '\n' ) \
  498. buf[n++] = (char) c; \
  499. if ( c == EOF && ferror( yyin ) ) \
  500. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  501. result = n; \
  502. } \
  503. else \
  504. { \
  505. errno=0; \
  506. while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
  507. { \
  508. if( errno != EINTR) \
  509. { \
  510. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  511. break; \
  512. } \
  513. errno=0; \
  514. clearerr(yyin); \
  515. } \
  516. }\
  517. \
  518. #endif
  519. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  520. * we don't want an extra ';' after the "return" because that will cause
  521. * some compilers to complain about unreachable statements.
  522. */
  523. #ifndef yyterminate
  524. #define yyterminate() return YY_NULL
  525. #endif
  526. /* Number of entries by which start-condition stack grows. */
  527. #ifndef YY_START_STACK_INCR
  528. #define YY_START_STACK_INCR 25
  529. #endif
  530. /* Report a fatal error. */
  531. #ifndef YY_FATAL_ERROR
  532. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
  533. #endif
  534. /* end tables serialization structures and prototypes */
  535. /* Default declaration of generated scanner - a define so the user can
  536. * easily add parameters.
  537. */
  538. #ifndef YY_DECL
  539. #define YY_DECL_IS_OURS 1
  540. extern int cmCommandArgument_yylex (yyscan_t yyscanner);
  541. #define YY_DECL int cmCommandArgument_yylex (yyscan_t yyscanner)
  542. #endif /* !YY_DECL */
  543. /* Code executed at the beginning of each rule, after yytext and yyleng
  544. * have been set up.
  545. */
  546. #ifndef YY_USER_ACTION
  547. #define YY_USER_ACTION
  548. #endif
  549. /* Code executed at the end of each rule. */
  550. #ifndef YY_BREAK
  551. #define YY_BREAK break;
  552. #endif
  553. #define YY_RULE_SETUP \
  554. YY_USER_ACTION
  555. /** The main scanner function which does all the work.
  556. */
  557. YY_DECL
  558. {
  559. register yy_state_type yy_current_state;
  560. register char *yy_cp, *yy_bp;
  561. register int yy_act;
  562. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  563. if ( yyg->yy_init )
  564. {
  565. yyg->yy_init = 0;
  566. #ifdef YY_USER_INIT
  567. YY_USER_INIT;
  568. #endif
  569. if ( ! yyg->yy_start )
  570. yyg->yy_start = 1; /* first start state */
  571. if ( ! yyin )
  572. yyin = stdin;
  573. if ( ! yyout )
  574. yyout = stdout;
  575. if ( ! YY_CURRENT_BUFFER ) {
  576. cmCommandArgument_yyensure_buffer_stack (yyscanner);
  577. YY_CURRENT_BUFFER_LVALUE =
  578. cmCommandArgument_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
  579. }
  580. cmCommandArgument_yy_load_buffer_state(yyscanner );
  581. }
  582. for(;;) /* loops until end-of-file is reached */
  583. {
  584. yy_cp = yyg->yy_c_buf_p;
  585. /* Support of yytext. */
  586. *yy_cp = yyg->yy_hold_char;
  587. /* yy_bp points to the position in yy_ch_buf of the start of
  588. * the current run.
  589. */
  590. yy_bp = yy_cp;
  591. yy_current_state = yyg->yy_start;
  592. yy_match:
  593. do
  594. {
  595. register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
  596. if ( yy_accept[yy_current_state] )
  597. {
  598. yyg->yy_last_accepting_state = yy_current_state;
  599. yyg->yy_last_accepting_cpos = yy_cp;
  600. }
  601. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  602. {
  603. yy_current_state = (int) yy_def[yy_current_state];
  604. if ( yy_current_state >= 20 )
  605. yy_c = yy_meta[(unsigned int) yy_c];
  606. }
  607. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  608. ++yy_cp;
  609. }
  610. while ( yy_base[yy_current_state] != 21 );
  611. yy_find_action:
  612. yy_act = yy_accept[yy_current_state];
  613. if ( yy_act == 0 )
  614. { /* have to back up */
  615. yy_cp = yyg->yy_last_accepting_cpos;
  616. yy_current_state = yyg->yy_last_accepting_state;
  617. yy_act = yy_accept[yy_current_state];
  618. }
  619. YY_DO_BEFORE_ACTION;
  620. do_action: /* This label is used only to access EOF actions. */
  621. switch ( yy_act )
  622. { /* beginning of action switch */
  623. case 0: /* must back up */
  624. /* undo the effects of YY_DO_BEFORE_ACTION */
  625. *yy_cp = yyg->yy_hold_char;
  626. yy_cp = yyg->yy_last_accepting_cpos;
  627. yy_current_state = yyg->yy_last_accepting_state;
  628. goto yy_find_action;
  629. case 1:
  630. YY_RULE_SETUP
  631. {
  632. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  633. yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
  634. return cal_NCURLY;
  635. }
  636. case 2:
  637. YY_RULE_SETUP
  638. {
  639. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  640. yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
  641. return cal_ATNAME;
  642. }
  643. case 3:
  644. YY_RULE_SETUP
  645. {
  646. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  647. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  648. yylvalp->str = yyextra->DCURLYVariable;
  649. return cal_DCURLY;
  650. }
  651. case 4:
  652. YY_RULE_SETUP
  653. {
  654. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  655. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  656. yylvalp->str = yyextra->RCURLYVariable;
  657. return cal_RCURLY;
  658. }
  659. case 5:
  660. YY_RULE_SETUP
  661. {
  662. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  663. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  664. yylvalp->str = yyextra->ATVariable;
  665. return cal_AT;
  666. }
  667. case 6:
  668. YY_RULE_SETUP
  669. {
  670. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  671. yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  672. return cal_NAME;
  673. }
  674. case 7:
  675. YY_RULE_SETUP
  676. {
  677. if ( !yyextra->HandleEscapeSymbol(yylvalp, *(yytext+1)) )
  678. {
  679. return cal_ERROR;
  680. }
  681. return cal_SYMBOL;
  682. }
  683. case 8:
  684. /* rule 8 can match eol */
  685. YY_RULE_SETUP
  686. {
  687. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  688. yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  689. return cal_SYMBOL;
  690. }
  691. case 9:
  692. YY_RULE_SETUP
  693. {
  694. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  695. yylvalp->str = yyextra->DOLLARVariable;
  696. return cal_DOLLAR;
  697. }
  698. case 10:
  699. YY_RULE_SETUP
  700. {
  701. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  702. yylvalp->str = yyextra->LCURLYVariable;
  703. return cal_LCURLY;
  704. }
  705. case 11:
  706. YY_RULE_SETUP
  707. {
  708. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  709. yylvalp->str = yyextra->BSLASHVariable;
  710. return cal_BSLASH;
  711. }
  712. case 12:
  713. YY_RULE_SETUP
  714. ECHO;
  715. YY_BREAK
  716. case YY_STATE_EOF(INITIAL):
  717. yyterminate();
  718. case YY_END_OF_BUFFER:
  719. {
  720. /* Amount of text matched not including the EOB char. */
  721. int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
  722. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  723. *yy_cp = yyg->yy_hold_char;
  724. YY_RESTORE_YY_MORE_OFFSET
  725. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  726. {
  727. /* We're scanning a new file or input source. It's
  728. * possible that this happened because the user
  729. * just pointed yyin at a new source and called
  730. * cmCommandArgument_yylex(). If so, then we have to assure
  731. * consistency between YY_CURRENT_BUFFER and our
  732. * globals. Here is the right place to do so, because
  733. * this is the first action (other than possibly a
  734. * back-up) that will match for the new input source.
  735. */
  736. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  737. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  738. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  739. }
  740. /* Note that here we test for yy_c_buf_p "<=" to the position
  741. * of the first EOB in the buffer, since yy_c_buf_p will
  742. * already have been incremented past the NUL character
  743. * (since all states make transitions on EOB to the
  744. * end-of-buffer state). Contrast this with the test
  745. * in input().
  746. */
  747. if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  748. { /* This was really a NUL. */
  749. yy_state_type yy_next_state;
  750. yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
  751. yy_current_state = yy_get_previous_state( yyscanner );
  752. /* Okay, we're now positioned to make the NUL
  753. * transition. We couldn't have
  754. * yy_get_previous_state() go ahead and do it
  755. * for us because it doesn't know how to deal
  756. * with the possibility of jamming (and we don't
  757. * want to build jamming into it because then it
  758. * will run more slowly).
  759. */
  760. yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
  761. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  762. if ( yy_next_state )
  763. {
  764. /* Consume the NUL. */
  765. yy_cp = ++yyg->yy_c_buf_p;
  766. yy_current_state = yy_next_state;
  767. goto yy_match;
  768. }
  769. else
  770. {
  771. yy_cp = yyg->yy_c_buf_p;
  772. goto yy_find_action;
  773. }
  774. }
  775. else switch ( yy_get_next_buffer( yyscanner ) )
  776. {
  777. case EOB_ACT_END_OF_FILE:
  778. {
  779. yyg->yy_did_buffer_switch_on_eof = 0;
  780. if ( cmCommandArgument_yywrap(yyscanner ) )
  781. {
  782. /* Note: because we've taken care in
  783. * yy_get_next_buffer() to have set up
  784. * yytext, we can now set up
  785. * yy_c_buf_p so that if some total
  786. * hoser (like flex itself) wants to
  787. * call the scanner after we return the
  788. * YY_NULL, it'll still work - another
  789. * YY_NULL will get returned.
  790. */
  791. yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
  792. yy_act = YY_STATE_EOF(YY_START);
  793. goto do_action;
  794. }
  795. else
  796. {
  797. if ( ! yyg->yy_did_buffer_switch_on_eof )
  798. YY_NEW_FILE;
  799. }
  800. break;
  801. }
  802. case EOB_ACT_CONTINUE_SCAN:
  803. yyg->yy_c_buf_p =
  804. yyg->yytext_ptr + yy_amount_of_matched_text;
  805. yy_current_state = yy_get_previous_state( yyscanner );
  806. yy_cp = yyg->yy_c_buf_p;
  807. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  808. goto yy_match;
  809. case EOB_ACT_LAST_MATCH:
  810. yyg->yy_c_buf_p =
  811. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
  812. yy_current_state = yy_get_previous_state( yyscanner );
  813. yy_cp = yyg->yy_c_buf_p;
  814. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  815. goto yy_find_action;
  816. }
  817. break;
  818. }
  819. default:
  820. YY_FATAL_ERROR(
  821. "fatal flex scanner internal error--no action found" );
  822. } /* end of action switch */
  823. } /* end of scanning one token */
  824. } /* end of cmCommandArgument_yylex */
  825. /* yy_get_next_buffer - try to read in a new buffer
  826. *
  827. * Returns a code representing an action:
  828. * EOB_ACT_LAST_MATCH -
  829. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  830. * EOB_ACT_END_OF_FILE - end of file
  831. */
  832. static int yy_get_next_buffer (yyscan_t yyscanner)
  833. {
  834. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  835. register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  836. register char *source = yyg->yytext_ptr;
  837. register int number_to_move, i;
  838. int ret_val;
  839. if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
  840. YY_FATAL_ERROR(
  841. "fatal flex scanner internal error--end of buffer missed" );
  842. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  843. { /* Don't try to fill the buffer, so this is an EOF. */
  844. if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
  845. {
  846. /* We matched a single character, the EOB, so
  847. * treat this as a final EOF.
  848. */
  849. return EOB_ACT_END_OF_FILE;
  850. }
  851. else
  852. {
  853. /* We matched some text prior to the EOB, first
  854. * process it.
  855. */
  856. return EOB_ACT_LAST_MATCH;
  857. }
  858. }
  859. /* Try to read more data. */
  860. /* First move last chars to start of buffer. */
  861. number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
  862. for ( i = 0; i < number_to_move; ++i )
  863. *(dest++) = *(source++);
  864. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  865. /* don't do the read, it's not guaranteed to return an EOF,
  866. * just force an EOF
  867. */
  868. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
  869. else
  870. {
  871. size_t nuto_read =
  872. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  873. while ( nuto_read <= 0 )
  874. { /* Not enough room in the buffer - grow it. */
  875. /* just a shorter name for the current buffer */
  876. YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
  877. int yy_c_buf_p_offset =
  878. (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
  879. if ( b->yy_is_our_buffer )
  880. {
  881. int new_size = b->yy_buf_size * 2;
  882. if ( new_size <= 0 )
  883. b->yy_buf_size += b->yy_buf_size / 8;
  884. else
  885. b->yy_buf_size *= 2;
  886. b->yy_ch_buf = (char *)
  887. /* Include room in for 2 EOB chars. */
  888. cmCommandArgument_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
  889. }
  890. else
  891. /* Can't grow it, we don't own it. */
  892. b->yy_ch_buf = 0;
  893. if ( ! b->yy_ch_buf )
  894. YY_FATAL_ERROR(
  895. "fatal error - scanner input buffer overflow" );
  896. yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  897. nuto_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  898. number_to_move - 1;
  899. }
  900. if ( nuto_read > YY_READ_BUF_SIZE )
  901. nuto_read = YY_READ_BUF_SIZE;
  902. /* Read in more data. */
  903. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  904. yyg->yy_n_chars, nuto_read );
  905. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  906. }
  907. if ( yyg->yy_n_chars == 0 )
  908. {
  909. if ( number_to_move == YY_MORE_ADJ )
  910. {
  911. ret_val = EOB_ACT_END_OF_FILE;
  912. cmCommandArgument_yyrestart(yyin ,yyscanner);
  913. }
  914. else
  915. {
  916. ret_val = EOB_ACT_LAST_MATCH;
  917. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  918. YY_BUFFER_EOF_PENDING;
  919. }
  920. }
  921. else
  922. ret_val = EOB_ACT_CONTINUE_SCAN;
  923. yyg->yy_n_chars += number_to_move;
  924. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  925. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  926. yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  927. return ret_val;
  928. }
  929. /* yy_get_previous_state - get the state just before the EOB char was
  930. 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 >= 20 )
  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 >= 20 )
  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 == 19);
  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. cmCommandArgument_yyrestart(yyin ,yyscanner);
  1018. /*FALLTHROUGH*/
  1019. case EOB_ACT_END_OF_FILE:
  1020. {
  1021. if ( cmCommandArgument_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 cmCommandArgument_yyrestart (FILE * input_file , yyscan_t yyscanner)
  1049. {
  1050. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1051. if ( ! YY_CURRENT_BUFFER ){
  1052. cmCommandArgument_yyensure_buffer_stack (yyscanner);
  1053. YY_CURRENT_BUFFER_LVALUE =
  1054. cmCommandArgument_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
  1055. }
  1056. cmCommandArgument_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
  1057. cmCommandArgument_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 cmCommandArgument_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. * cmCommandArgument_yypop_buffer_state();
  1069. * cmCommandArgument_yypush_buffer_state(new_buffer);
  1070. */
  1071. cmCommandArgument_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. cmCommandArgument_yy_load_buffer_state(yyscanner );
  1083. /* We don't actually know whether we did this switch during EOF
  1084. * (cmCommandArgument_yywrap()) processing, but the only time this flag is
  1085. * looked at is after cmCommandArgument_yywrap() is called, so it's safe to
  1086. * go ahead and always set it.
  1087. */
  1088. yyg->yy_did_buffer_switch_on_eof = 1;
  1089. }
  1090. static void cmCommandArgument_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. @param file A readable
  1099. * stream. @param size The character buffer size in bytes. When in doubt,
  1100. * use @c YY_BUF_SIZE. @param yyscanner The scanner object. @return the
  1101. * allocated buffer state.
  1102. */
  1103. YY_BUFFER_STATE cmCommandArgument_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
  1104. {
  1105. YY_BUFFER_STATE b;
  1106. b = (YY_BUFFER_STATE) cmCommandArgument_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
  1107. if ( ! b )
  1108. YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_create_buffer()" );
  1109. b->yy_buf_size = size;
  1110. /* yy_ch_buf has to be 2 characters longer than the size given because
  1111. * we need to put in 2 end-of-buffer characters.
  1112. */
  1113. b->yy_ch_buf = (char *) cmCommandArgument_yyalloc(b->yy_buf_size + 2 ,yyscanner );
  1114. if ( ! b->yy_ch_buf )
  1115. YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_create_buffer()" );
  1116. b->yy_is_our_buffer = 1;
  1117. cmCommandArgument_yy_init_buffer(b,file ,yyscanner);
  1118. return b;
  1119. }
  1120. /** Destroy the buffer.
  1121. * @param b a buffer created with cmCommandArgument_yy_create_buffer()
  1122. * @param yyscanner The scanner object.
  1123. */
  1124. void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  1125. {
  1126. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1127. if ( ! b )
  1128. return;
  1129. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  1130. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  1131. if ( b->yy_is_our_buffer )
  1132. cmCommandArgument_yyfree((void *) b->yy_ch_buf ,yyscanner );
  1133. cmCommandArgument_yyfree((void *) b ,yyscanner );
  1134. }
  1135. #ifndef __cplusplus
  1136. extern int isatty (int );
  1137. #endif /* __cplusplus */
  1138. /* Initializes or reinitializes a buffer.
  1139. * This function is sometimes called more than once on the same buffer,
  1140. * such as during a cmCommandArgument_yyrestart() or at EOF.
  1141. */
  1142. static void cmCommandArgument_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
  1143. {
  1144. int oerrno = errno;
  1145. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1146. cmCommandArgument_yy_flush_buffer(b ,yyscanner);
  1147. b->yy_input_file = file;
  1148. b->yy_fill_buffer = 1;
  1149. /* If b is the current buffer, then cmCommandArgument_yy_init_buffer was
  1150. * _probably_ called from cmCommandArgument_yyrestart() or through
  1151. * yy_get_next_buffer. In that case, we don't want to reset the lineno
  1152. * 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
  1162. * called. @param b the buffer state to be flushed, usually @c
  1163. * YY_CURRENT_BUFFER. @param yyscanner The scanner object.
  1164. */
  1165. void cmCommandArgument_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. cmCommandArgument_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 cmCommandArgument_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. cmCommandArgument_yyensure_buffer_stack(yyscanner);
  1195. /* This block is copied from cmCommandArgument_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 cmCommandArgument_yy_switch_to_buffer. */
  1208. cmCommandArgument_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 cmCommandArgument_yypop_buffer_state (yyscan_t yyscanner)
  1216. {
  1217. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1218. if (!YY_CURRENT_BUFFER)
  1219. return;
  1220. cmCommandArgument_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. cmCommandArgument_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 cmCommandArgument_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**)cmCommandArgument_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**)cmCommandArgument_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
  1264. * character buffer. @param base the character buffer @param size the size
  1265. * in bytes of the character buffer @param yyscanner The scanner object.
  1266. * @return the newly allocated buffer state object.
  1267. */
  1268. YY_BUFFER_STATE cmCommandArgument_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
  1269. {
  1270. YY_BUFFER_STATE b;
  1271. if ( size < 2 ||
  1272. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1273. base[size-1] != YY_END_OF_BUFFER_CHAR )
  1274. /* They forgot to leave room for the EOB's. */
  1275. return 0;
  1276. b = (YY_BUFFER_STATE) cmCommandArgument_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
  1277. if ( ! b )
  1278. YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_scan_buffer()" );
  1279. b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
  1280. b->yy_buf_pos = b->yy_ch_buf = base;
  1281. b->yy_is_our_buffer = 0;
  1282. b->yy_input_file = 0;
  1283. b->yy_n_chars = b->yy_buf_size;
  1284. b->yy_is_interactive = 0;
  1285. b->yy_at_bol = 1;
  1286. b->yy_fill_buffer = 0;
  1287. b->yy_buffer_status = YY_BUFFER_NEW;
  1288. cmCommandArgument_yy_switch_to_buffer(b ,yyscanner );
  1289. return b;
  1290. }
  1291. /** Setup the input buffer state to scan a string. The next call to
  1292. * cmCommandArgument_yylex() will scan from a @e copy of @a str. @param str
  1293. * a NUL-terminated string to scan @param yyscanner The scanner object.
  1294. * @return the newly allocated buffer state object. @note If you want to
  1295. * scan bytes that may contain NUL values, then use
  1296. * cmCommandArgument_yy_scan_bytes() instead.
  1297. */
  1298. YY_BUFFER_STATE cmCommandArgument_yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner)
  1299. {
  1300. return cmCommandArgument_yy_scan_bytes(yy_str,strlen(yy_str) ,yyscanner);
  1301. }
  1302. /** Setup the input buffer state to scan the given bytes. The next call to
  1303. * cmCommandArgument_yylex() will scan from a @e copy of @a bytes. @param
  1304. * bytes the byte buffer to scan @param len the number of bytes in the buffer
  1305. * pointed to by @a bytes. @param yyscanner The scanner object. @return the
  1306. * newly allocated buffer state object.
  1307. */
  1308. YY_BUFFER_STATE cmCommandArgument_yy_scan_bytes (yyconst char * bytes, int len , yyscan_t yyscanner)
  1309. {
  1310. YY_BUFFER_STATE b;
  1311. char *buf;
  1312. yy_size_t n;
  1313. int i;
  1314. /* Get memory for full buffer, including space for trailing EOB's. */
  1315. n = len + 2;
  1316. buf = (char *) cmCommandArgument_yyalloc(n ,yyscanner );
  1317. if ( ! buf )
  1318. YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_scan_bytes()" );
  1319. for ( i = 0; i < len; ++i )
  1320. buf[i] = bytes[i];
  1321. buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
  1322. b = cmCommandArgument_yy_scan_buffer(buf,n ,yyscanner);
  1323. if ( ! b )
  1324. YY_FATAL_ERROR( "bad buffer in cmCommandArgument_yy_scan_bytes()" );
  1325. /* It's okay to grow etc. this buffer, and we should throw it
  1326. * away when we're done.
  1327. */
  1328. b->yy_is_our_buffer = 1;
  1329. return b;
  1330. }
  1331. #ifndef YY_EXIT_FAILURE
  1332. #define YY_EXIT_FAILURE 2
  1333. #endif
  1334. static void yy_fatal_error (yyconst char* msg , yyscan_t)
  1335. {
  1336. (void) fprintf( stderr, "%s\n", msg );
  1337. exit( YY_EXIT_FAILURE );
  1338. }
  1339. /* Redefine yyless() so it works in section 3 code. */
  1340. #undef yyless
  1341. #define yyless(n) \
  1342. do \
  1343. { \
  1344. /* Undo effects of setting up yytext. */ \
  1345. int yyless_macro_arg = (n); \
  1346. YY_LESS_LINENO(yyless_macro_arg);\
  1347. yytext[yyleng] = yyg->yy_hold_char; \
  1348. yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
  1349. yyg->yy_hold_char = *yyg->yy_c_buf_p; \
  1350. *yyg->yy_c_buf_p = '\0'; \
  1351. yyleng = yyless_macro_arg; \
  1352. } \
  1353. while ( 0 )
  1354. /* Accessor methods (get/set functions) to struct members. */
  1355. /** Get the user-defined data for this scanner.
  1356. * @param yyscanner The scanner object.
  1357. */
  1358. YY_EXTRA_TYPE cmCommandArgument_yyget_extra (yyscan_t yyscanner)
  1359. {
  1360. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1361. return yyextra;
  1362. }
  1363. /** Get the current line number.
  1364. * @param yyscanner The scanner object.
  1365. */
  1366. int cmCommandArgument_yyget_lineno (yyscan_t yyscanner)
  1367. {
  1368. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1369. if (! YY_CURRENT_BUFFER)
  1370. return 0;
  1371. return yylineno;
  1372. }
  1373. /** Get the current column number.
  1374. * @param yyscanner The scanner object.
  1375. */
  1376. int cmCommandArgument_yyget_column (yyscan_t yyscanner)
  1377. {
  1378. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1379. if (! YY_CURRENT_BUFFER)
  1380. return 0;
  1381. return yycolumn;
  1382. }
  1383. /** Get the input stream.
  1384. * @param yyscanner The scanner object.
  1385. */
  1386. FILE *cmCommandArgument_yyget_in (yyscan_t yyscanner)
  1387. {
  1388. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1389. return yyin;
  1390. }
  1391. /** Get the output stream.
  1392. * @param yyscanner The scanner object.
  1393. */
  1394. FILE *cmCommandArgument_yyget_out (yyscan_t yyscanner)
  1395. {
  1396. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1397. return yyout;
  1398. }
  1399. /** Get the length of the current token.
  1400. * @param yyscanner The scanner object.
  1401. */
  1402. int cmCommandArgument_yyget_leng (yyscan_t yyscanner)
  1403. {
  1404. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1405. return yyleng;
  1406. }
  1407. /** Get the current token.
  1408. * @param yyscanner The scanner object.
  1409. */
  1410. char *cmCommandArgument_yyget_text (yyscan_t yyscanner)
  1411. {
  1412. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1413. return yytext;
  1414. }
  1415. /** Set the user-defined data. This data is never touched by the scanner.
  1416. * @param user_defined The data to be associated with this scanner.
  1417. * @param yyscanner The scanner object.
  1418. */
  1419. void cmCommandArgument_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
  1420. {
  1421. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1422. yyextra = user_defined ;
  1423. }
  1424. /** Set the current line number.
  1425. * @param line_number
  1426. * @param yyscanner The scanner object.
  1427. */
  1428. void cmCommandArgument_yyset_lineno (int line_number , yyscan_t yyscanner)
  1429. {
  1430. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1431. /* lineno is only valid if an input buffer exists. */
  1432. if (! YY_CURRENT_BUFFER )
  1433. yy_fatal_error( "cmCommandArgument_yyset_lineno called with no buffer" , yyscanner);
  1434. yylineno = line_number;
  1435. }
  1436. /** Set the current column.
  1437. * @param line_number
  1438. * @param yyscanner The scanner object.
  1439. */
  1440. void cmCommandArgument_yyset_column (int column_no , yyscan_t yyscanner)
  1441. {
  1442. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1443. /* column is only valid if an input buffer exists. */
  1444. if (! YY_CURRENT_BUFFER )
  1445. {
  1446. yy_fatal_error
  1447. ("cmCommandArgument_yyset_column called with no buffer" ,
  1448. yyscanner);
  1449. }
  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 cmCommandArgument_yy_switch_to_buffer
  1457. */
  1458. void cmCommandArgument_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 cmCommandArgument_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 cmCommandArgument_yyget_debug (yyscan_t yyscanner)
  1469. {
  1470. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1471. return yy_flex_debug;
  1472. }
  1473. void cmCommandArgument_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. * cmCommandArgument_yylex_init()
  1503. */
  1504. return 0;
  1505. }
  1506. /* User-visible API */
  1507. /* cmCommandArgument_yylex_init is special because it creates the scanner
  1508. * itself, so it is the ONLY reentrant function that doesn't take the scanner
  1509. * as the last argument. That's why we explicitly handle the declaration,
  1510. * instead of using our macros.
  1511. */
  1512. int cmCommandArgument_yylex_init(yyscan_t* ptr_yy_globals)
  1513. {
  1514. if (ptr_yy_globals == NULL){
  1515. errno = EINVAL;
  1516. return 1;
  1517. }
  1518. *ptr_yy_globals = (yyscan_t) cmCommandArgument_yyalloc ( sizeof( struct yyguts_t ), NULL );
  1519. if (*ptr_yy_globals == NULL){
  1520. errno = ENOMEM;
  1521. return 1;
  1522. }
  1523. memset(*ptr_yy_globals,0,sizeof(struct yyguts_t));
  1524. return yy_init_globals ( *ptr_yy_globals );
  1525. }
  1526. /* cmCommandArgument_yylex_destroy is for both reentrant and non-reentrant
  1527. scanners. */
  1528. int cmCommandArgument_yylex_destroy (yyscan_t yyscanner)
  1529. {
  1530. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1531. /* Pop the buffer stack, destroying each element. */
  1532. while(YY_CURRENT_BUFFER){
  1533. cmCommandArgument_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
  1534. YY_CURRENT_BUFFER_LVALUE = NULL;
  1535. cmCommandArgument_yypop_buffer_state(yyscanner);
  1536. }
  1537. /* Destroy the stack itself. */
  1538. cmCommandArgument_yyfree(yyg->yy_buffer_stack ,yyscanner);
  1539. yyg->yy_buffer_stack = NULL;
  1540. /* Destroy the start condition stack. */
  1541. cmCommandArgument_yyfree(yyg->yy_start_stack ,yyscanner );
  1542. yyg->yy_start_stack = NULL;
  1543. /* Destroy the main struct (reentrant only). */
  1544. cmCommandArgument_yyfree ( yyscanner , yyscanner );
  1545. return 0;
  1546. }
  1547. /*
  1548. * Internal utility routines.
  1549. */
  1550. #ifndef yytext_ptr
  1551. static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ,
  1552. yyscan_t yyscanner)
  1553. {
  1554. register int i;
  1555. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1556. for ( i = 0; i < n; ++i )
  1557. s1[i] = s2[i];
  1558. }
  1559. #endif
  1560. #ifdef YY_NEED_STRLEN
  1561. static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
  1562. {
  1563. register int n;
  1564. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1565. for ( n = 0; s[n]; ++n )
  1566. ;
  1567. return n;
  1568. }
  1569. #endif
  1570. void *cmCommandArgument_yyalloc (yy_size_t size , yyscan_t)
  1571. {
  1572. return (void *) malloc( size );
  1573. }
  1574. void *cmCommandArgument_yyrealloc (void * ptr, yy_size_t size , yyscan_t)
  1575. {
  1576. /* The cast to (char *) in the following accommodates both
  1577. * implementations that use char* generic pointers, and those
  1578. * that use void* generic pointers. It works with the latter
  1579. * because both ANSI C and C++ allow castless assignment from
  1580. * any pointer type to void*, and deal with argument conversions
  1581. * as though doing an assignment.
  1582. */
  1583. return (void *) realloc( (char *) ptr, size );
  1584. }
  1585. void cmCommandArgument_yyfree (void * ptr , yyscan_t)
  1586. {
  1587. free( (char *) ptr );
  1588. /* see cmCommandArgument_yyrealloc() for (char *) cast */
  1589. }
  1590. #define YYTABLES_NAME "yytables"
  1591. #undef YY_NEW_FILE
  1592. #undef YY_FLUSH_BUFFER
  1593. #undef yy_set_bol
  1594. #undef yy_new_buffer
  1595. #undef yy_set_interactive
  1596. #undef yytext_ptr
  1597. #undef YY_DO_BEFORE_ACTION
  1598. #ifdef YY_DECL_IS_OURS
  1599. #undef YY_DECL_IS_OURS
  1600. #undef YY_DECL
  1601. #endif