cmCommandArgumentLexer.cxx 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002
  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 "cmCommandArgumentParserHelper.h"
  389. /* Disable some warnings. */
  390. #if defined(_MSC_VER)
  391. # pragma warning ( disable : 4127 )
  392. # pragma warning ( disable : 4131 )
  393. # pragma warning ( disable : 4244 )
  394. # pragma warning ( disable : 4251 )
  395. # pragma warning ( disable : 4267 )
  396. # pragma warning ( disable : 4305 )
  397. # pragma warning ( disable : 4309 )
  398. # pragma warning ( disable : 4706 )
  399. # pragma warning ( disable : 4786 )
  400. #endif
  401. /* Disable features we do not need. */
  402. #define YY_NEVER_INTERACTIVE 1
  403. #undef ECHO /* SGI termios defines this differently. */
  404. #define ECHO
  405. /* Replace the lexer input function. */
  406. #undef YY_INPUT
  407. #define YY_INPUT(buf, result, max_size) \
  408. { result = yyextra->LexInput(buf, max_size); }
  409. /* Include the set of tokens from the parser. */
  410. #include "cmCommandArgumentParserTokens.h"
  411. #if defined( _WIN32 ) && !defined( __CYGWIN__ )
  412. /* Handle Windows properly */
  413. # include <io.h>
  414. # if defined( _MSC_VER )
  415. # define isatty _isatty
  416. # endif
  417. # define YY_NO_UNISTD_H 1
  418. #endif
  419. /*--------------------------------------------------------------------------*/
  420. #define INITIAL 0
  421. #ifndef YY_NO_UNISTD_H
  422. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  423. * down here because we want the user's section 1 to have been scanned first.
  424. * The user has a chance to override it with an option.
  425. */
  426. #include <unistd.h>
  427. #endif
  428. #ifndef YY_EXTRA_TYPE
  429. #define YY_EXTRA_TYPE void *
  430. #endif
  431. /* Holds the entire state of the reentrant scanner. */
  432. struct yyguts_t
  433. {
  434. /* User-defined. Not touched by flex. */
  435. YY_EXTRA_TYPE yyextra_r;
  436. /* The rest are the same as the globals declared in the non-reentrant scanner. */
  437. FILE *yyin_r, *yyout_r;
  438. size_t yy_buffer_stack_top; /**< index of top of stack. */
  439. size_t yy_buffer_stack_max; /**< capacity of stack. */
  440. YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
  441. char yy_hold_char;
  442. int yy_n_chars;
  443. int yyleng_r;
  444. char *yy_c_buf_p;
  445. int yy_init;
  446. int yy_start;
  447. int yy_did_buffer_switch_on_eof;
  448. int yy_start_stack_ptr;
  449. int yy_start_stack_depth;
  450. int *yy_start_stack;
  451. yy_state_type yy_last_accepting_state;
  452. char* yy_last_accepting_cpos;
  453. int yylineno_r;
  454. int yy_flex_debug_r;
  455. char *yytext_r;
  456. int yy_more_flag;
  457. int yy_more_len;
  458. }; /* end struct yyguts_t */
  459. /* Accessor methods to globals.
  460. These are made visible to non-reentrant scanners for convenience. */
  461. int cmCommandArgument_yylex_destroy (yyscan_t yyscanner );
  462. int cmCommandArgument_yyget_debug (yyscan_t yyscanner );
  463. void cmCommandArgument_yyset_debug (int debug_flag ,yyscan_t yyscanner );
  464. YY_EXTRA_TYPE cmCommandArgument_yyget_extra (yyscan_t yyscanner );
  465. void cmCommandArgument_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
  466. FILE *cmCommandArgument_yyget_in (yyscan_t yyscanner );
  467. void cmCommandArgument_yyset_in (FILE * in_str ,yyscan_t yyscanner );
  468. FILE *cmCommandArgument_yyget_out (yyscan_t yyscanner );
  469. void cmCommandArgument_yyset_out (FILE * out_str ,yyscan_t yyscanner );
  470. int cmCommandArgument_yyget_leng (yyscan_t yyscanner );
  471. char *cmCommandArgument_yyget_text (yyscan_t yyscanner );
  472. int cmCommandArgument_yyget_lineno (yyscan_t yyscanner );
  473. void cmCommandArgument_yyset_lineno (int line_number ,yyscan_t yyscanner );
  474. /* Macros after this point can all be overridden by user definitions in
  475. * section 1.
  476. */
  477. #ifndef YY_SKIP_YYWRAP
  478. #ifdef __cplusplus
  479. extern "C" int cmCommandArgument_yywrap (yyscan_t yyscanner );
  480. #else
  481. extern int cmCommandArgument_yywrap (yyscan_t yyscanner );
  482. #endif
  483. #endif
  484. #ifndef yytext_ptr
  485. static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
  486. #endif
  487. #ifdef YY_NEED_STRLEN
  488. static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
  489. #endif
  490. #ifndef YY_NO_INPUT
  491. #ifdef __cplusplus
  492. static int yyinput (yyscan_t yyscanner );
  493. #else
  494. static int input (yyscan_t yyscanner );
  495. #endif
  496. #endif
  497. /* Amount of stuff to slurp up with each read. */
  498. #ifndef YY_READ_BUF_SIZE
  499. #define YY_READ_BUF_SIZE 8192
  500. #endif
  501. /* Copy whatever the last rule matched to the standard output. */
  502. #ifndef ECHO
  503. /* This used to be an fputs(), but since the string might contain NUL's,
  504. * we now use fwrite().
  505. */
  506. #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
  507. #endif
  508. /* Gets input and stuffs it into "buf". number of characters read, or
  509. * YY_NULL, is returned in "result".
  510. */
  511. #ifndef YY_INPUT
  512. #define YY_INPUT(buf,result,max_size) \
  513. if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  514. { \
  515. int c = '*'; \
  516. size_t n; \
  517. for ( n = 0; n < max_size && \
  518. (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  519. buf[n] = (char) c; \
  520. if ( c == '\n' ) \
  521. buf[n++] = (char) c; \
  522. if ( c == EOF && ferror( yyin ) ) \
  523. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  524. result = n; \
  525. } \
  526. else \
  527. { \
  528. errno=0; \
  529. while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
  530. { \
  531. if( errno != EINTR) \
  532. { \
  533. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  534. break; \
  535. } \
  536. errno=0; \
  537. clearerr(yyin); \
  538. } \
  539. }\
  540. \
  541. #endif
  542. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  543. * we don't want an extra ';' after the "return" because that will cause
  544. * some compilers to complain about unreachable statements.
  545. */
  546. #ifndef yyterminate
  547. #define yyterminate() return YY_NULL
  548. #endif
  549. /* Number of entries by which start-condition stack grows. */
  550. #ifndef YY_START_STACK_INCR
  551. #define YY_START_STACK_INCR 25
  552. #endif
  553. /* Report a fatal error. */
  554. #ifndef YY_FATAL_ERROR
  555. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
  556. #endif
  557. /* end tables serialization structures and prototypes */
  558. /* Default declaration of generated scanner - a define so the user can
  559. * easily add parameters.
  560. */
  561. #ifndef YY_DECL
  562. #define YY_DECL_IS_OURS 1
  563. extern int cmCommandArgument_yylex (yyscan_t yyscanner);
  564. #define YY_DECL int cmCommandArgument_yylex (yyscan_t yyscanner)
  565. #endif /* !YY_DECL */
  566. /* Code executed at the beginning of each rule, after yytext and yyleng
  567. * have been set up.
  568. */
  569. #ifndef YY_USER_ACTION
  570. #define YY_USER_ACTION
  571. #endif
  572. /* Code executed at the end of each rule. */
  573. #ifndef YY_BREAK
  574. #define YY_BREAK break;
  575. #endif
  576. #define YY_RULE_SETUP \
  577. YY_USER_ACTION
  578. /** The main scanner function which does all the work.
  579. */
  580. YY_DECL
  581. {
  582. register yy_state_type yy_current_state;
  583. register char *yy_cp, *yy_bp;
  584. register int yy_act;
  585. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  586. if ( yyg->yy_init )
  587. {
  588. yyg->yy_init = 0;
  589. #ifdef YY_USER_INIT
  590. YY_USER_INIT;
  591. #endif
  592. if ( ! yyg->yy_start )
  593. yyg->yy_start = 1; /* first start state */
  594. if ( ! yyin )
  595. yyin = stdin;
  596. if ( ! yyout )
  597. yyout = stdout;
  598. if ( ! YY_CURRENT_BUFFER ) {
  599. cmCommandArgument_yyensure_buffer_stack (yyscanner);
  600. YY_CURRENT_BUFFER_LVALUE =
  601. cmCommandArgument_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
  602. }
  603. cmCommandArgument_yy_load_buffer_state(yyscanner );
  604. }
  605. for(;;) /* loops until end-of-file is reached */
  606. {
  607. yy_cp = yyg->yy_c_buf_p;
  608. /* Support of yytext. */
  609. *yy_cp = yyg->yy_hold_char;
  610. /* yy_bp points to the position in yy_ch_buf of the start of
  611. * the current run.
  612. */
  613. yy_bp = yy_cp;
  614. yy_current_state = yyg->yy_start;
  615. yy_match:
  616. do
  617. {
  618. register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
  619. if ( yy_accept[yy_current_state] )
  620. {
  621. yyg->yy_last_accepting_state = yy_current_state;
  622. yyg->yy_last_accepting_cpos = yy_cp;
  623. }
  624. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  625. {
  626. yy_current_state = (int) yy_def[yy_current_state];
  627. if ( yy_current_state >= 20 )
  628. yy_c = yy_meta[(unsigned int) yy_c];
  629. }
  630. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  631. ++yy_cp;
  632. }
  633. while ( yy_base[yy_current_state] != 21 );
  634. yy_find_action:
  635. yy_act = yy_accept[yy_current_state];
  636. if ( yy_act == 0 )
  637. { /* have to back up */
  638. yy_cp = yyg->yy_last_accepting_cpos;
  639. yy_current_state = yyg->yy_last_accepting_state;
  640. yy_act = yy_accept[yy_current_state];
  641. }
  642. YY_DO_BEFORE_ACTION;
  643. do_action: /* This label is used only to access EOF actions. */
  644. switch ( yy_act )
  645. { /* beginning of action switch */
  646. case 0: /* must back up */
  647. /* undo the effects of YY_DO_BEFORE_ACTION */
  648. *yy_cp = yyg->yy_hold_char;
  649. yy_cp = yyg->yy_last_accepting_cpos;
  650. yy_current_state = yyg->yy_last_accepting_state;
  651. goto yy_find_action;
  652. case 1:
  653. YY_RULE_SETUP
  654. {
  655. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  656. yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
  657. return cal_NCURLY;
  658. }
  659. case 2:
  660. YY_RULE_SETUP
  661. {
  662. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  663. yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
  664. return cal_ATNAME;
  665. }
  666. case 3:
  667. YY_RULE_SETUP
  668. {
  669. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  670. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  671. yylvalp->str = yyextra->DCURLYVariable;
  672. return cal_DCURLY;
  673. }
  674. case 4:
  675. YY_RULE_SETUP
  676. {
  677. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  678. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  679. yylvalp->str = yyextra->RCURLYVariable;
  680. return cal_RCURLY;
  681. }
  682. case 5:
  683. YY_RULE_SETUP
  684. {
  685. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  686. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  687. yylvalp->str = yyextra->ATVariable;
  688. return cal_AT;
  689. }
  690. case 6:
  691. YY_RULE_SETUP
  692. {
  693. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  694. yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  695. return cal_NAME;
  696. }
  697. case 7:
  698. YY_RULE_SETUP
  699. {
  700. if ( !yyextra->HandleEscapeSymbol(yylvalp, *(yytext+1)) )
  701. {
  702. return cal_ERROR;
  703. }
  704. return cal_SYMBOL;
  705. }
  706. case 8:
  707. /* rule 8 can match eol */
  708. YY_RULE_SETUP
  709. {
  710. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  711. yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  712. return cal_SYMBOL;
  713. }
  714. case 9:
  715. YY_RULE_SETUP
  716. {
  717. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  718. yylvalp->str = yyextra->DOLLARVariable;
  719. return cal_DOLLAR;
  720. }
  721. case 10:
  722. YY_RULE_SETUP
  723. {
  724. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  725. yylvalp->str = yyextra->LCURLYVariable;
  726. return cal_LCURLY;
  727. }
  728. case 11:
  729. YY_RULE_SETUP
  730. {
  731. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  732. yylvalp->str = yyextra->BSLASHVariable;
  733. return cal_BSLASH;
  734. }
  735. case 12:
  736. YY_RULE_SETUP
  737. ECHO;
  738. YY_BREAK
  739. case YY_STATE_EOF(INITIAL):
  740. yyterminate();
  741. case YY_END_OF_BUFFER:
  742. {
  743. /* Amount of text matched not including the EOB char. */
  744. int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
  745. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  746. *yy_cp = yyg->yy_hold_char;
  747. YY_RESTORE_YY_MORE_OFFSET
  748. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  749. {
  750. /* We're scanning a new file or input source. It's
  751. * possible that this happened because the user
  752. * just pointed yyin at a new source and called
  753. * cmCommandArgument_yylex(). If so, then we have to assure
  754. * consistency between YY_CURRENT_BUFFER and our
  755. * globals. Here is the right place to do so, because
  756. * this is the first action (other than possibly a
  757. * back-up) that will match for the new input source.
  758. */
  759. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  760. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  761. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  762. }
  763. /* Note that here we test for yy_c_buf_p "<=" to the position
  764. * of the first EOB in the buffer, since yy_c_buf_p will
  765. * already have been incremented past the NUL character
  766. * (since all states make transitions on EOB to the
  767. * end-of-buffer state). Contrast this with the test
  768. * in input().
  769. */
  770. if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  771. { /* This was really a NUL. */
  772. yy_state_type yy_next_state;
  773. yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
  774. yy_current_state = yy_get_previous_state( yyscanner );
  775. /* Okay, we're now positioned to make the NUL
  776. * transition. We couldn't have
  777. * yy_get_previous_state() go ahead and do it
  778. * for us because it doesn't know how to deal
  779. * with the possibility of jamming (and we don't
  780. * want to build jamming into it because then it
  781. * will run more slowly).
  782. */
  783. yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
  784. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  785. if ( yy_next_state )
  786. {
  787. /* Consume the NUL. */
  788. yy_cp = ++yyg->yy_c_buf_p;
  789. yy_current_state = yy_next_state;
  790. goto yy_match;
  791. }
  792. else
  793. {
  794. yy_cp = yyg->yy_c_buf_p;
  795. goto yy_find_action;
  796. }
  797. }
  798. else switch ( yy_get_next_buffer( yyscanner ) )
  799. {
  800. case EOB_ACT_END_OF_FILE:
  801. {
  802. yyg->yy_did_buffer_switch_on_eof = 0;
  803. if ( cmCommandArgument_yywrap(yyscanner ) )
  804. {
  805. /* Note: because we've taken care in
  806. * yy_get_next_buffer() to have set up
  807. * yytext, we can now set up
  808. * yy_c_buf_p so that if some total
  809. * hoser (like flex itself) wants to
  810. * call the scanner after we return the
  811. * YY_NULL, it'll still work - another
  812. * YY_NULL will get returned.
  813. */
  814. yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
  815. yy_act = YY_STATE_EOF(YY_START);
  816. goto do_action;
  817. }
  818. else
  819. {
  820. if ( ! yyg->yy_did_buffer_switch_on_eof )
  821. YY_NEW_FILE;
  822. }
  823. break;
  824. }
  825. case EOB_ACT_CONTINUE_SCAN:
  826. yyg->yy_c_buf_p =
  827. yyg->yytext_ptr + yy_amount_of_matched_text;
  828. yy_current_state = yy_get_previous_state( yyscanner );
  829. yy_cp = yyg->yy_c_buf_p;
  830. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  831. goto yy_match;
  832. case EOB_ACT_LAST_MATCH:
  833. yyg->yy_c_buf_p =
  834. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
  835. yy_current_state = yy_get_previous_state( yyscanner );
  836. yy_cp = yyg->yy_c_buf_p;
  837. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  838. goto yy_find_action;
  839. }
  840. break;
  841. }
  842. default:
  843. YY_FATAL_ERROR(
  844. "fatal flex scanner internal error--no action found" );
  845. } /* end of action switch */
  846. } /* end of scanning one token */
  847. } /* end of cmCommandArgument_yylex */
  848. /* yy_get_next_buffer - try to read in a new buffer
  849. *
  850. * Returns a code representing an action:
  851. * EOB_ACT_LAST_MATCH -
  852. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  853. * EOB_ACT_END_OF_FILE - end of file
  854. */
  855. static int yy_get_next_buffer (yyscan_t yyscanner)
  856. {
  857. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  858. register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  859. register char *source = yyg->yytext_ptr;
  860. register int number_to_move, i;
  861. int ret_val;
  862. if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
  863. YY_FATAL_ERROR(
  864. "fatal flex scanner internal error--end of buffer missed" );
  865. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  866. { /* Don't try to fill the buffer, so this is an EOF. */
  867. if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
  868. {
  869. /* We matched a single character, the EOB, so
  870. * treat this as a final EOF.
  871. */
  872. return EOB_ACT_END_OF_FILE;
  873. }
  874. else
  875. {
  876. /* We matched some text prior to the EOB, first
  877. * process it.
  878. */
  879. return EOB_ACT_LAST_MATCH;
  880. }
  881. }
  882. /* Try to read more data. */
  883. /* First move last chars to start of buffer. */
  884. number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
  885. for ( i = 0; i < number_to_move; ++i )
  886. *(dest++) = *(source++);
  887. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  888. /* don't do the read, it's not guaranteed to return an EOF,
  889. * just force an EOF
  890. */
  891. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
  892. else
  893. {
  894. size_t nuto_read =
  895. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  896. while ( nuto_read <= 0 )
  897. { /* Not enough room in the buffer - grow it. */
  898. /* just a shorter name for the current buffer */
  899. YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
  900. int yy_c_buf_p_offset =
  901. (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
  902. if ( b->yy_is_our_buffer )
  903. {
  904. int new_size = b->yy_buf_size * 2;
  905. if ( new_size <= 0 )
  906. b->yy_buf_size += b->yy_buf_size / 8;
  907. else
  908. b->yy_buf_size *= 2;
  909. b->yy_ch_buf = (char *)
  910. /* Include room in for 2 EOB chars. */
  911. cmCommandArgument_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
  912. }
  913. else
  914. /* Can't grow it, we don't own it. */
  915. b->yy_ch_buf = 0;
  916. if ( ! b->yy_ch_buf )
  917. YY_FATAL_ERROR(
  918. "fatal error - scanner input buffer overflow" );
  919. yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  920. nuto_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  921. number_to_move - 1;
  922. }
  923. if ( nuto_read > YY_READ_BUF_SIZE )
  924. nuto_read = YY_READ_BUF_SIZE;
  925. /* Read in more data. */
  926. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  927. yyg->yy_n_chars, nuto_read );
  928. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  929. }
  930. if ( yyg->yy_n_chars == 0 )
  931. {
  932. if ( number_to_move == YY_MORE_ADJ )
  933. {
  934. ret_val = EOB_ACT_END_OF_FILE;
  935. cmCommandArgument_yyrestart(yyin ,yyscanner);
  936. }
  937. else
  938. {
  939. ret_val = EOB_ACT_LAST_MATCH;
  940. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  941. YY_BUFFER_EOF_PENDING;
  942. }
  943. }
  944. else
  945. ret_val = EOB_ACT_CONTINUE_SCAN;
  946. yyg->yy_n_chars += number_to_move;
  947. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  948. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  949. yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  950. return ret_val;
  951. }
  952. /* yy_get_previous_state - get the state just before the EOB char was
  953. reached */
  954. static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
  955. {
  956. register yy_state_type yy_current_state;
  957. register char *yy_cp;
  958. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  959. yy_current_state = yyg->yy_start;
  960. for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
  961. {
  962. register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  963. if ( yy_accept[yy_current_state] )
  964. {
  965. yyg->yy_last_accepting_state = yy_current_state;
  966. yyg->yy_last_accepting_cpos = yy_cp;
  967. }
  968. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  969. {
  970. yy_current_state = (int) yy_def[yy_current_state];
  971. if ( yy_current_state >= 20 )
  972. yy_c = yy_meta[(unsigned int) yy_c];
  973. }
  974. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  975. }
  976. return yy_current_state;
  977. }
  978. /* yy_try_NUL_trans - try to make a transition on the NUL character
  979. *
  980. * synopsis
  981. * next_state = yy_try_NUL_trans( current_state );
  982. */
  983. static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
  984. {
  985. register int yy_is_jam;
  986. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  987. register char *yy_cp = yyg->yy_c_buf_p;
  988. register YY_CHAR yy_c = 1;
  989. if ( yy_accept[yy_current_state] )
  990. {
  991. yyg->yy_last_accepting_state = yy_current_state;
  992. yyg->yy_last_accepting_cpos = yy_cp;
  993. }
  994. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  995. {
  996. yy_current_state = (int) yy_def[yy_current_state];
  997. if ( yy_current_state >= 20 )
  998. yy_c = yy_meta[(unsigned int) yy_c];
  999. }
  1000. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1001. yy_is_jam = (yy_current_state == 19);
  1002. return yy_is_jam ? 0 : yy_current_state;
  1003. }
  1004. #ifndef YY_NO_INPUT
  1005. #ifdef __cplusplus
  1006. static int yyinput (yyscan_t yyscanner)
  1007. #else
  1008. static int input (yyscan_t yyscanner)
  1009. #endif
  1010. {
  1011. int c;
  1012. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1013. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1014. if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1015. {
  1016. /* yy_c_buf_p now points to the character we want to return.
  1017. * If this occurs *before* the EOB characters, then it's a
  1018. * valid NUL; if not, then we've hit the end of the buffer.
  1019. */
  1020. if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  1021. /* This was really a NUL. */
  1022. *yyg->yy_c_buf_p = '\0';
  1023. else
  1024. { /* need more input */
  1025. int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
  1026. ++yyg->yy_c_buf_p;
  1027. switch ( yy_get_next_buffer( yyscanner ) )
  1028. {
  1029. case EOB_ACT_LAST_MATCH:
  1030. /* This happens because yy_g_n_b()
  1031. * sees that we've accumulated a
  1032. * token and flags that we need to
  1033. * try matching the token before
  1034. * proceeding. But for input(),
  1035. * there's no matching to consider.
  1036. * So convert the EOB_ACT_LAST_MATCH
  1037. * to EOB_ACT_END_OF_FILE.
  1038. */
  1039. /* Reset buffer status. */
  1040. cmCommandArgument_yyrestart(yyin ,yyscanner);
  1041. /*FALLTHROUGH*/
  1042. case EOB_ACT_END_OF_FILE:
  1043. {
  1044. if ( cmCommandArgument_yywrap(yyscanner ) )
  1045. return EOF;
  1046. if ( ! yyg->yy_did_buffer_switch_on_eof )
  1047. YY_NEW_FILE;
  1048. #ifdef __cplusplus
  1049. return yyinput(yyscanner);
  1050. #else
  1051. return input(yyscanner);
  1052. #endif
  1053. }
  1054. case EOB_ACT_CONTINUE_SCAN:
  1055. yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
  1056. break;
  1057. }
  1058. }
  1059. }
  1060. c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
  1061. *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
  1062. yyg->yy_hold_char = *++yyg->yy_c_buf_p;
  1063. return c;
  1064. }
  1065. #endif /* ifndef YY_NO_INPUT */
  1066. /** Immediately switch to a different input stream.
  1067. * @param input_file A readable stream.
  1068. * @param yyscanner The scanner object.
  1069. * @note This function does not reset the start condition to @c INITIAL .
  1070. */
  1071. void cmCommandArgument_yyrestart (FILE * input_file , yyscan_t yyscanner)
  1072. {
  1073. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1074. if ( ! YY_CURRENT_BUFFER ){
  1075. cmCommandArgument_yyensure_buffer_stack (yyscanner);
  1076. YY_CURRENT_BUFFER_LVALUE =
  1077. cmCommandArgument_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
  1078. }
  1079. cmCommandArgument_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
  1080. cmCommandArgument_yy_load_buffer_state(yyscanner );
  1081. }
  1082. /** Switch to a different input buffer.
  1083. * @param new_buffer The new input buffer.
  1084. * @param yyscanner The scanner object.
  1085. */
  1086. void cmCommandArgument_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  1087. {
  1088. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1089. /* TODO. We should be able to replace this entire function body
  1090. * with
  1091. * cmCommandArgument_yypop_buffer_state();
  1092. * cmCommandArgument_yypush_buffer_state(new_buffer);
  1093. */
  1094. cmCommandArgument_yyensure_buffer_stack (yyscanner);
  1095. if ( YY_CURRENT_BUFFER == new_buffer )
  1096. return;
  1097. if ( YY_CURRENT_BUFFER )
  1098. {
  1099. /* Flush out information for old buffer. */
  1100. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1101. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  1102. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1103. }
  1104. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1105. cmCommandArgument_yy_load_buffer_state(yyscanner );
  1106. /* We don't actually know whether we did this switch during EOF
  1107. * (cmCommandArgument_yywrap()) processing, but the only time this flag is
  1108. * looked at is after cmCommandArgument_yywrap() is called, so it's safe to
  1109. * go ahead and always set it.
  1110. */
  1111. yyg->yy_did_buffer_switch_on_eof = 1;
  1112. }
  1113. static void cmCommandArgument_yy_load_buffer_state (yyscan_t yyscanner)
  1114. {
  1115. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1116. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1117. yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  1118. yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  1119. yyg->yy_hold_char = *yyg->yy_c_buf_p;
  1120. }
  1121. /** Allocate and initialize an input buffer state. @param file A readable
  1122. * stream. @param size The character buffer size in bytes. When in doubt,
  1123. * use @c YY_BUF_SIZE. @param yyscanner The scanner object. @return the
  1124. * allocated buffer state.
  1125. */
  1126. YY_BUFFER_STATE cmCommandArgument_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
  1127. {
  1128. YY_BUFFER_STATE b;
  1129. b = (YY_BUFFER_STATE) cmCommandArgument_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
  1130. if ( ! b )
  1131. YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_create_buffer()" );
  1132. b->yy_buf_size = size;
  1133. /* yy_ch_buf has to be 2 characters longer than the size given because
  1134. * we need to put in 2 end-of-buffer characters.
  1135. */
  1136. b->yy_ch_buf = (char *) cmCommandArgument_yyalloc(b->yy_buf_size + 2 ,yyscanner );
  1137. if ( ! b->yy_ch_buf )
  1138. YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_create_buffer()" );
  1139. b->yy_is_our_buffer = 1;
  1140. cmCommandArgument_yy_init_buffer(b,file ,yyscanner);
  1141. return b;
  1142. }
  1143. /** Destroy the buffer.
  1144. * @param b a buffer created with cmCommandArgument_yy_create_buffer()
  1145. * @param yyscanner The scanner object.
  1146. */
  1147. void cmCommandArgument_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  1148. {
  1149. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1150. if ( ! b )
  1151. return;
  1152. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  1153. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  1154. if ( b->yy_is_our_buffer )
  1155. cmCommandArgument_yyfree((void *) b->yy_ch_buf ,yyscanner );
  1156. cmCommandArgument_yyfree((void *) b ,yyscanner );
  1157. }
  1158. #ifndef __cplusplus
  1159. extern int isatty (int );
  1160. #endif /* __cplusplus */
  1161. /* Initializes or reinitializes a buffer.
  1162. * This function is sometimes called more than once on the same buffer,
  1163. * such as during a cmCommandArgument_yyrestart() or at EOF.
  1164. */
  1165. static void cmCommandArgument_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
  1166. {
  1167. int oerrno = errno;
  1168. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1169. cmCommandArgument_yy_flush_buffer(b ,yyscanner);
  1170. b->yy_input_file = file;
  1171. b->yy_fill_buffer = 1;
  1172. /* If b is the current buffer, then cmCommandArgument_yy_init_buffer was
  1173. * _probably_ called from cmCommandArgument_yyrestart() or through
  1174. * yy_get_next_buffer. In that case, we don't want to reset the lineno
  1175. * or column.
  1176. */
  1177. if (b != YY_CURRENT_BUFFER){
  1178. b->yy_bs_lineno = 1;
  1179. b->yy_bs_column = 0;
  1180. }
  1181. b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1182. errno = oerrno;
  1183. }
  1184. /** Discard all buffered characters. On the next scan, YY_INPUT will be
  1185. * called. @param b the buffer state to be flushed, usually @c
  1186. * YY_CURRENT_BUFFER. @param yyscanner The scanner object.
  1187. */
  1188. void cmCommandArgument_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  1189. {
  1190. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1191. if ( ! b )
  1192. return;
  1193. b->yy_n_chars = 0;
  1194. /* We always need two end-of-buffer characters. The first causes
  1195. * a transition to the end-of-buffer state. The second causes
  1196. * a jam in that state.
  1197. */
  1198. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1199. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1200. b->yy_buf_pos = &b->yy_ch_buf[0];
  1201. b->yy_at_bol = 1;
  1202. b->yy_buffer_status = YY_BUFFER_NEW;
  1203. if ( b == YY_CURRENT_BUFFER )
  1204. cmCommandArgument_yy_load_buffer_state(yyscanner );
  1205. }
  1206. /** Pushes the new state onto the stack. The new state becomes
  1207. * the current state. This function will allocate the stack
  1208. * if necessary.
  1209. * @param new_buffer The new state.
  1210. * @param yyscanner The scanner object.
  1211. */
  1212. void cmCommandArgument_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  1213. {
  1214. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1215. if (new_buffer == NULL)
  1216. return;
  1217. cmCommandArgument_yyensure_buffer_stack(yyscanner);
  1218. /* This block is copied from cmCommandArgument_yy_switch_to_buffer. */
  1219. if ( YY_CURRENT_BUFFER )
  1220. {
  1221. /* Flush out information for old buffer. */
  1222. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1223. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  1224. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1225. }
  1226. /* Only push if top exists. Otherwise, replace top. */
  1227. if (YY_CURRENT_BUFFER)
  1228. yyg->yy_buffer_stack_top++;
  1229. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1230. /* copied from cmCommandArgument_yy_switch_to_buffer. */
  1231. cmCommandArgument_yy_load_buffer_state(yyscanner );
  1232. yyg->yy_did_buffer_switch_on_eof = 1;
  1233. }
  1234. /** Removes and deletes the top of the stack, if present.
  1235. * The next element becomes the new top.
  1236. * @param yyscanner The scanner object.
  1237. */
  1238. void cmCommandArgument_yypop_buffer_state (yyscan_t yyscanner)
  1239. {
  1240. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1241. if (!YY_CURRENT_BUFFER)
  1242. return;
  1243. cmCommandArgument_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
  1244. YY_CURRENT_BUFFER_LVALUE = NULL;
  1245. if (yyg->yy_buffer_stack_top > 0)
  1246. --yyg->yy_buffer_stack_top;
  1247. if (YY_CURRENT_BUFFER) {
  1248. cmCommandArgument_yy_load_buffer_state(yyscanner );
  1249. yyg->yy_did_buffer_switch_on_eof = 1;
  1250. }
  1251. }
  1252. /* Allocates the stack if it does not exist.
  1253. * Guarantees space for at least one push.
  1254. */
  1255. static void cmCommandArgument_yyensure_buffer_stack (yyscan_t yyscanner)
  1256. {
  1257. int nuto_alloc;
  1258. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1259. if (!yyg->yy_buffer_stack) {
  1260. /* First allocation is just for 2 elements, since we don't know if this
  1261. * scanner will even need a stack. We use 2 instead of 1 to avoid an
  1262. * immediate realloc on the next call.
  1263. */
  1264. nuto_alloc = 1;
  1265. yyg->yy_buffer_stack = (struct yy_buffer_state**)cmCommandArgument_yyalloc
  1266. (nuto_alloc * sizeof(struct yy_buffer_state*)
  1267. , yyscanner);
  1268. memset(yyg->yy_buffer_stack, 0, nuto_alloc * sizeof(struct yy_buffer_state*));
  1269. yyg->yy_buffer_stack_max = nuto_alloc;
  1270. yyg->yy_buffer_stack_top = 0;
  1271. return;
  1272. }
  1273. if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
  1274. /* Increase the buffer to prepare for a possible push. */
  1275. int grow_size = 8 /* arbitrary grow size */;
  1276. nuto_alloc = yyg->yy_buffer_stack_max + grow_size;
  1277. yyg->yy_buffer_stack = (struct yy_buffer_state**)cmCommandArgument_yyrealloc
  1278. (yyg->yy_buffer_stack,
  1279. nuto_alloc * sizeof(struct yy_buffer_state*)
  1280. , yyscanner);
  1281. /* zero only the new slots.*/
  1282. memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
  1283. yyg->yy_buffer_stack_max = nuto_alloc;
  1284. }
  1285. }
  1286. /** Setup the input buffer state to scan directly from a user-specified
  1287. * character buffer. @param base the character buffer @param size the size
  1288. * in bytes of the character buffer @param yyscanner The scanner object.
  1289. * @return the newly allocated buffer state object.
  1290. */
  1291. YY_BUFFER_STATE cmCommandArgument_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
  1292. {
  1293. YY_BUFFER_STATE b;
  1294. if ( size < 2 ||
  1295. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1296. base[size-1] != YY_END_OF_BUFFER_CHAR )
  1297. /* They forgot to leave room for the EOB's. */
  1298. return 0;
  1299. b = (YY_BUFFER_STATE) cmCommandArgument_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
  1300. if ( ! b )
  1301. YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_scan_buffer()" );
  1302. b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
  1303. b->yy_buf_pos = b->yy_ch_buf = base;
  1304. b->yy_is_our_buffer = 0;
  1305. b->yy_input_file = 0;
  1306. b->yy_n_chars = b->yy_buf_size;
  1307. b->yy_is_interactive = 0;
  1308. b->yy_at_bol = 1;
  1309. b->yy_fill_buffer = 0;
  1310. b->yy_buffer_status = YY_BUFFER_NEW;
  1311. cmCommandArgument_yy_switch_to_buffer(b ,yyscanner );
  1312. return b;
  1313. }
  1314. /** Setup the input buffer state to scan a string. The next call to
  1315. * cmCommandArgument_yylex() will scan from a @e copy of @a str. @param str
  1316. * a NUL-terminated string to scan @param yyscanner The scanner object.
  1317. * @return the newly allocated buffer state object. @note If you want to
  1318. * scan bytes that may contain NUL values, then use
  1319. * cmCommandArgument_yy_scan_bytes() instead.
  1320. */
  1321. YY_BUFFER_STATE cmCommandArgument_yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner)
  1322. {
  1323. return cmCommandArgument_yy_scan_bytes(yy_str,strlen(yy_str) ,yyscanner);
  1324. }
  1325. /** Setup the input buffer state to scan the given bytes. The next call to
  1326. * cmCommandArgument_yylex() will scan from a @e copy of @a bytes. @param
  1327. * bytes the byte buffer to scan @param len the number of bytes in the buffer
  1328. * pointed to by @a bytes. @param yyscanner The scanner object. @return the
  1329. * newly allocated buffer state object.
  1330. */
  1331. YY_BUFFER_STATE cmCommandArgument_yy_scan_bytes (yyconst char * bytes, int len , yyscan_t yyscanner)
  1332. {
  1333. YY_BUFFER_STATE b;
  1334. char *buf;
  1335. yy_size_t n;
  1336. int i;
  1337. /* Get memory for full buffer, including space for trailing EOB's. */
  1338. n = len + 2;
  1339. buf = (char *) cmCommandArgument_yyalloc(n ,yyscanner );
  1340. if ( ! buf )
  1341. YY_FATAL_ERROR( "out of dynamic memory in cmCommandArgument_yy_scan_bytes()" );
  1342. for ( i = 0; i < len; ++i )
  1343. buf[i] = bytes[i];
  1344. buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
  1345. b = cmCommandArgument_yy_scan_buffer(buf,n ,yyscanner);
  1346. if ( ! b )
  1347. YY_FATAL_ERROR( "bad buffer in cmCommandArgument_yy_scan_bytes()" );
  1348. /* It's okay to grow etc. this buffer, and we should throw it
  1349. * away when we're done.
  1350. */
  1351. b->yy_is_our_buffer = 1;
  1352. return b;
  1353. }
  1354. #ifndef YY_EXIT_FAILURE
  1355. #define YY_EXIT_FAILURE 2
  1356. #endif
  1357. static void yy_fatal_error (yyconst char* msg , yyscan_t)
  1358. {
  1359. (void) fprintf( stderr, "%s\n", msg );
  1360. exit( YY_EXIT_FAILURE );
  1361. }
  1362. /* Redefine yyless() so it works in section 3 code. */
  1363. #undef yyless
  1364. #define yyless(n) \
  1365. do \
  1366. { \
  1367. /* Undo effects of setting up yytext. */ \
  1368. int yyless_macro_arg = (n); \
  1369. YY_LESS_LINENO(yyless_macro_arg);\
  1370. yytext[yyleng] = yyg->yy_hold_char; \
  1371. yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
  1372. yyg->yy_hold_char = *yyg->yy_c_buf_p; \
  1373. *yyg->yy_c_buf_p = '\0'; \
  1374. yyleng = yyless_macro_arg; \
  1375. } \
  1376. while ( 0 )
  1377. /* Accessor methods (get/set functions) to struct members. */
  1378. /** Get the user-defined data for this scanner.
  1379. * @param yyscanner The scanner object.
  1380. */
  1381. YY_EXTRA_TYPE cmCommandArgument_yyget_extra (yyscan_t yyscanner)
  1382. {
  1383. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1384. return yyextra;
  1385. }
  1386. /** Get the current line number.
  1387. * @param yyscanner The scanner object.
  1388. */
  1389. int cmCommandArgument_yyget_lineno (yyscan_t yyscanner)
  1390. {
  1391. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1392. if (! YY_CURRENT_BUFFER)
  1393. return 0;
  1394. return yylineno;
  1395. }
  1396. /** Get the current column number.
  1397. * @param yyscanner The scanner object.
  1398. */
  1399. int cmCommandArgument_yyget_column (yyscan_t yyscanner)
  1400. {
  1401. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1402. if (! YY_CURRENT_BUFFER)
  1403. return 0;
  1404. return yycolumn;
  1405. }
  1406. /** Get the input stream.
  1407. * @param yyscanner The scanner object.
  1408. */
  1409. FILE *cmCommandArgument_yyget_in (yyscan_t yyscanner)
  1410. {
  1411. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1412. return yyin;
  1413. }
  1414. /** Get the output stream.
  1415. * @param yyscanner The scanner object.
  1416. */
  1417. FILE *cmCommandArgument_yyget_out (yyscan_t yyscanner)
  1418. {
  1419. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1420. return yyout;
  1421. }
  1422. /** Get the length of the current token.
  1423. * @param yyscanner The scanner object.
  1424. */
  1425. int cmCommandArgument_yyget_leng (yyscan_t yyscanner)
  1426. {
  1427. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1428. return yyleng;
  1429. }
  1430. /** Get the current token.
  1431. * @param yyscanner The scanner object.
  1432. */
  1433. char *cmCommandArgument_yyget_text (yyscan_t yyscanner)
  1434. {
  1435. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1436. return yytext;
  1437. }
  1438. /** Set the user-defined data. This data is never touched by the scanner.
  1439. * @param user_defined The data to be associated with this scanner.
  1440. * @param yyscanner The scanner object.
  1441. */
  1442. void cmCommandArgument_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
  1443. {
  1444. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1445. yyextra = user_defined ;
  1446. }
  1447. /** Set the current line number.
  1448. * @param line_number
  1449. * @param yyscanner The scanner object.
  1450. */
  1451. void cmCommandArgument_yyset_lineno (int line_number , yyscan_t yyscanner)
  1452. {
  1453. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1454. /* lineno is only valid if an input buffer exists. */
  1455. if (! YY_CURRENT_BUFFER )
  1456. yy_fatal_error( "cmCommandArgument_yyset_lineno called with no buffer" , yyscanner);
  1457. yylineno = line_number;
  1458. }
  1459. /** Set the current column.
  1460. * @param line_number
  1461. * @param yyscanner The scanner object.
  1462. */
  1463. void cmCommandArgument_yyset_column (int column_no , yyscan_t yyscanner)
  1464. {
  1465. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1466. /* column is only valid if an input buffer exists. */
  1467. if (! YY_CURRENT_BUFFER )
  1468. {
  1469. yy_fatal_error
  1470. ("cmCommandArgument_yyset_column called with no buffer" ,
  1471. yyscanner);
  1472. }
  1473. yycolumn = column_no;
  1474. }
  1475. /** Set the input stream. This does not discard the current
  1476. * input buffer.
  1477. * @param in_str A readable stream.
  1478. * @param yyscanner The scanner object.
  1479. * @see cmCommandArgument_yy_switch_to_buffer
  1480. */
  1481. void cmCommandArgument_yyset_in (FILE * in_str , yyscan_t yyscanner)
  1482. {
  1483. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1484. yyin = in_str ;
  1485. }
  1486. void cmCommandArgument_yyset_out (FILE * out_str , yyscan_t yyscanner)
  1487. {
  1488. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1489. yyout = out_str ;
  1490. }
  1491. int cmCommandArgument_yyget_debug (yyscan_t yyscanner)
  1492. {
  1493. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1494. return yy_flex_debug;
  1495. }
  1496. void cmCommandArgument_yyset_debug (int bdebug , yyscan_t yyscanner)
  1497. {
  1498. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1499. yy_flex_debug = bdebug ;
  1500. }
  1501. /* Accessor methods for yylval and yylloc */
  1502. static int yy_init_globals (yyscan_t yyscanner)
  1503. {
  1504. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1505. /* Initialization is the same as for the non-reentrant scanner.
  1506. This function is called once per scanner lifetime. */
  1507. yyg->yy_buffer_stack = 0;
  1508. yyg->yy_buffer_stack_top = 0;
  1509. yyg->yy_buffer_stack_max = 0;
  1510. yyg->yy_c_buf_p = (char *) 0;
  1511. yyg->yy_init = 1;
  1512. yyg->yy_start = 0;
  1513. yyg->yy_start_stack_ptr = 0;
  1514. yyg->yy_start_stack_depth = 0;
  1515. yyg->yy_start_stack = (int *) 0;
  1516. /* Defined in main.c */
  1517. #ifdef YY_STDINIT
  1518. yyin = stdin;
  1519. yyout = stdout;
  1520. #else
  1521. yyin = (FILE *) 0;
  1522. yyout = (FILE *) 0;
  1523. #endif
  1524. /* For future reference: Set errno on error, since we are called by
  1525. * cmCommandArgument_yylex_init()
  1526. */
  1527. return 0;
  1528. }
  1529. /* User-visible API */
  1530. /* cmCommandArgument_yylex_init is special because it creates the scanner
  1531. * itself, so it is the ONLY reentrant function that doesn't take the scanner
  1532. * as the last argument. That's why we explicitly handle the declaration,
  1533. * instead of using our macros.
  1534. */
  1535. int cmCommandArgument_yylex_init(yyscan_t* ptr_yy_globals)
  1536. {
  1537. if (ptr_yy_globals == NULL){
  1538. errno = EINVAL;
  1539. return 1;
  1540. }
  1541. *ptr_yy_globals = (yyscan_t) cmCommandArgument_yyalloc ( sizeof( struct yyguts_t ), NULL );
  1542. if (*ptr_yy_globals == NULL){
  1543. errno = ENOMEM;
  1544. return 1;
  1545. }
  1546. memset(*ptr_yy_globals,0,sizeof(struct yyguts_t));
  1547. return yy_init_globals ( *ptr_yy_globals );
  1548. }
  1549. /* cmCommandArgument_yylex_destroy is for both reentrant and non-reentrant
  1550. scanners. */
  1551. int cmCommandArgument_yylex_destroy (yyscan_t yyscanner)
  1552. {
  1553. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1554. /* Pop the buffer stack, destroying each element. */
  1555. while(YY_CURRENT_BUFFER){
  1556. cmCommandArgument_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
  1557. YY_CURRENT_BUFFER_LVALUE = NULL;
  1558. cmCommandArgument_yypop_buffer_state(yyscanner);
  1559. }
  1560. /* Destroy the stack itself. */
  1561. cmCommandArgument_yyfree(yyg->yy_buffer_stack ,yyscanner);
  1562. yyg->yy_buffer_stack = NULL;
  1563. /* Destroy the start condition stack. */
  1564. cmCommandArgument_yyfree(yyg->yy_start_stack ,yyscanner );
  1565. yyg->yy_start_stack = NULL;
  1566. /* Destroy the main struct (reentrant only). */
  1567. cmCommandArgument_yyfree ( yyscanner , yyscanner );
  1568. return 0;
  1569. }
  1570. /*
  1571. * Internal utility routines.
  1572. */
  1573. #ifndef yytext_ptr
  1574. static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ,
  1575. yyscan_t yyscanner)
  1576. {
  1577. register int i;
  1578. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1579. for ( i = 0; i < n; ++i )
  1580. s1[i] = s2[i];
  1581. }
  1582. #endif
  1583. #ifdef YY_NEED_STRLEN
  1584. static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
  1585. {
  1586. register int n;
  1587. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1588. for ( n = 0; s[n]; ++n )
  1589. ;
  1590. return n;
  1591. }
  1592. #endif
  1593. void *cmCommandArgument_yyalloc (yy_size_t size , yyscan_t)
  1594. {
  1595. return (void *) malloc( size );
  1596. }
  1597. void *cmCommandArgument_yyrealloc (void * ptr, yy_size_t size , yyscan_t)
  1598. {
  1599. /* The cast to (char *) in the following accommodates both
  1600. * implementations that use char* generic pointers, and those
  1601. * that use void* generic pointers. It works with the latter
  1602. * because both ANSI C and C++ allow castless assignment from
  1603. * any pointer type to void*, and deal with argument conversions
  1604. * as though doing an assignment.
  1605. */
  1606. return (void *) realloc( (char *) ptr, size );
  1607. }
  1608. void cmCommandArgument_yyfree (void * ptr , yyscan_t)
  1609. {
  1610. free( (char *) ptr );
  1611. /* see cmCommandArgument_yyrealloc() for (char *) cast */
  1612. }
  1613. #define YYTABLES_NAME "yytables"
  1614. #undef YY_NEW_FILE
  1615. #undef YY_FLUSH_BUFFER
  1616. #undef yy_set_bol
  1617. #undef yy_new_buffer
  1618. #undef yy_set_interactive
  1619. #undef yytext_ptr
  1620. #undef YY_DO_BEFORE_ACTION
  1621. #ifdef YY_DECL_IS_OURS
  1622. #undef YY_DECL_IS_OURS
  1623. #undef YY_DECL
  1624. #endif