cmCommandArgumentLexer.cxx 56 KB

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