cmCommandArgumentLexer.cxx 70 KB

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