cmCommandArgumentLexer.cxx 56 KB

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