cmCommandArgumentLexer.cxx 60 KB

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