cmCommandArgumentLexer.cxx 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252
  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. #ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
  562. #include "cmCommandArgumentParserHelper.h"
  563. /* Replace the lexer input function. */
  564. #undef YY_INPUT
  565. #define YY_INPUT(buf, result, max_size) \
  566. do { result = yyextra->LexInput(buf, max_size); } while (0)
  567. /* Include the set of tokens from the parser. */
  568. #include "cmCommandArgumentParserTokens.h"
  569. static const char *DCURLYVariable = "${";
  570. static const char *RCURLYVariable = "}";
  571. static const char *ATVariable = "@";
  572. static const char *DOLLARVariable = "$";
  573. static const char *LCURLYVariable = "{";
  574. static const char *BSLASHVariable = "\\";
  575. /*--------------------------------------------------------------------------*/
  576. #define INITIAL 0
  577. #define ESCAPES 1
  578. #define NOESCAPES 2
  579. #ifndef YY_EXTRA_TYPE
  580. #define YY_EXTRA_TYPE void *
  581. #endif
  582. /* Holds the entire state of the reentrant scanner. */
  583. struct yyguts_t
  584. {
  585. /* User-defined. Not touched by flex. */
  586. YY_EXTRA_TYPE yyextra_r;
  587. /* The rest are the same as the globals declared in the non-reentrant scanner. */
  588. FILE *yyin_r, *yyout_r;
  589. size_t yy_buffer_stack_top; /**< index of top of stack. */
  590. size_t yy_buffer_stack_max; /**< capacity of stack. */
  591. YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
  592. char yy_hold_char;
  593. int yy_n_chars;
  594. int yyleng_r;
  595. char *yy_c_buf_p;
  596. int yy_init;
  597. int yy_start;
  598. int yy_did_buffer_switch_on_eof;
  599. int yy_start_stack_ptr;
  600. int yy_start_stack_depth;
  601. int *yy_start_stack;
  602. yy_state_type yy_last_accepting_state;
  603. char* yy_last_accepting_cpos;
  604. int yylineno_r;
  605. int yy_flex_debug_r;
  606. char *yytext_r;
  607. int yy_more_flag;
  608. int yy_more_len;
  609. }; /* end struct yyguts_t */
  610. static int yy_init_globals ( yyscan_t yyscanner );
  611. int yylex_init (yyscan_t* scanner);
  612. int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
  613. /* Accessor methods to globals.
  614. These are made visible to non-reentrant scanners for convenience. */
  615. int yylex_destroy ( yyscan_t yyscanner );
  616. int yyget_debug ( yyscan_t yyscanner );
  617. void yyset_debug ( int debug_flag , yyscan_t yyscanner );
  618. YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
  619. void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
  620. FILE *yyget_in ( yyscan_t yyscanner );
  621. void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
  622. FILE *yyget_out ( yyscan_t yyscanner );
  623. void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
  624. int yyget_leng ( yyscan_t yyscanner );
  625. char *yyget_text ( yyscan_t yyscanner );
  626. int yyget_lineno ( yyscan_t yyscanner );
  627. void yyset_lineno ( int _line_number , yyscan_t yyscanner );
  628. int yyget_column ( yyscan_t yyscanner );
  629. void yyset_column ( int _column_no , yyscan_t yyscanner );
  630. /* Macros after this point can all be overridden by user definitions in
  631. * section 1.
  632. */
  633. #ifndef YY_SKIP_YYWRAP
  634. #ifdef __cplusplus
  635. extern "C" int yywrap ( yyscan_t yyscanner );
  636. #else
  637. extern int yywrap ( yyscan_t yyscanner );
  638. #endif
  639. #endif
  640. #ifndef YY_NO_UNPUT
  641. #endif
  642. #ifndef yytext_ptr
  643. static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
  644. #endif
  645. #ifdef YY_NEED_STRLEN
  646. static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
  647. #endif
  648. #ifndef YY_NO_INPUT
  649. #ifdef __cplusplus
  650. static int yyinput ( yyscan_t yyscanner );
  651. #else
  652. static int input ( yyscan_t yyscanner );
  653. #endif
  654. #endif
  655. /* Amount of stuff to slurp up with each read. */
  656. #ifndef YY_READ_BUF_SIZE
  657. #ifdef __ia64__
  658. /* On IA-64, the buffer size is 16k, not 8k */
  659. #define YY_READ_BUF_SIZE 16384
  660. #else
  661. #define YY_READ_BUF_SIZE 8192
  662. #endif /* __ia64__ */
  663. #endif
  664. /* Copy whatever the last rule matched to the standard output. */
  665. #ifndef ECHO
  666. /* This used to be an fputs(), but since the string might contain NUL's,
  667. * we now use fwrite().
  668. */
  669. #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
  670. #endif
  671. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  672. * is returned in "result".
  673. */
  674. #ifndef YY_INPUT
  675. #define YY_INPUT(buf,result,max_size) \
  676. if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  677. { \
  678. int c = '*'; \
  679. int n; \
  680. for ( n = 0; n < max_size && \
  681. (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  682. buf[n] = (char) c; \
  683. if ( c == '\n' ) \
  684. buf[n++] = (char) c; \
  685. if ( c == EOF && ferror( yyin ) ) \
  686. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  687. result = n; \
  688. } \
  689. else \
  690. { \
  691. errno=0; \
  692. while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
  693. { \
  694. if( errno != EINTR) \
  695. { \
  696. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  697. break; \
  698. } \
  699. errno=0; \
  700. clearerr(yyin); \
  701. } \
  702. }\
  703. \
  704. #endif
  705. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  706. * we don't want an extra ';' after the "return" because that will cause
  707. * some compilers to complain about unreachable statements.
  708. */
  709. #ifndef yyterminate
  710. #define yyterminate() return YY_NULL
  711. #endif
  712. /* Number of entries by which start-condition stack grows. */
  713. #ifndef YY_START_STACK_INCR
  714. #define YY_START_STACK_INCR 25
  715. #endif
  716. /* Report a fatal error. */
  717. #ifndef YY_FATAL_ERROR
  718. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
  719. #endif
  720. /* end tables serialization structures and prototypes */
  721. /* Default declaration of generated scanner - a define so the user can
  722. * easily add parameters.
  723. */
  724. #ifndef YY_DECL
  725. #define YY_DECL_IS_OURS 1
  726. extern int yylex (yyscan_t yyscanner);
  727. #define YY_DECL int yylex (yyscan_t yyscanner)
  728. #endif /* !YY_DECL */
  729. /* Code executed at the beginning of each rule, after yytext and yyleng
  730. * have been set up.
  731. */
  732. #ifndef YY_USER_ACTION
  733. #define YY_USER_ACTION
  734. #endif
  735. /* Code executed at the end of each rule. */
  736. #ifndef YY_BREAK
  737. #define YY_BREAK /*LINTED*/break;
  738. #endif
  739. #define YY_RULE_SETUP \
  740. YY_USER_ACTION
  741. /** The main scanner function which does all the work.
  742. */
  743. YY_DECL
  744. {
  745. yy_state_type yy_current_state;
  746. char *yy_cp, *yy_bp;
  747. int yy_act;
  748. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  749. if ( !yyg->yy_init )
  750. {
  751. yyg->yy_init = 1;
  752. #ifdef YY_USER_INIT
  753. YY_USER_INIT;
  754. #endif
  755. if ( ! yyg->yy_start )
  756. yyg->yy_start = 1; /* first start state */
  757. if ( ! yyin )
  758. yyin = stdin;
  759. if ( ! yyout )
  760. yyout = stdout;
  761. if ( ! YY_CURRENT_BUFFER ) {
  762. yyensure_buffer_stack (yyscanner);
  763. YY_CURRENT_BUFFER_LVALUE =
  764. yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
  765. }
  766. yy_load_buffer_state( yyscanner );
  767. }
  768. {
  769. while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
  770. {
  771. yy_cp = yyg->yy_c_buf_p;
  772. /* Support of yytext. */
  773. *yy_cp = yyg->yy_hold_char;
  774. /* yy_bp points to the position in yy_ch_buf of the start of
  775. * the current run.
  776. */
  777. yy_bp = yy_cp;
  778. yy_current_state = yyg->yy_start;
  779. yy_match:
  780. do
  781. {
  782. YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
  783. if ( yy_accept[yy_current_state] )
  784. {
  785. yyg->yy_last_accepting_state = yy_current_state;
  786. yyg->yy_last_accepting_cpos = yy_cp;
  787. }
  788. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  789. {
  790. yy_current_state = (int) yy_def[yy_current_state];
  791. if ( yy_current_state >= 30 )
  792. yy_c = yy_meta[yy_c];
  793. }
  794. yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  795. ++yy_cp;
  796. }
  797. while ( yy_base[yy_current_state] != 41 );
  798. yy_find_action:
  799. yy_act = yy_accept[yy_current_state];
  800. if ( yy_act == 0 )
  801. { /* have to back up */
  802. yy_cp = yyg->yy_last_accepting_cpos;
  803. yy_current_state = yyg->yy_last_accepting_state;
  804. yy_act = yy_accept[yy_current_state];
  805. }
  806. YY_DO_BEFORE_ACTION;
  807. do_action: /* This label is used only to access EOF actions. */
  808. switch ( yy_act )
  809. { /* beginning of action switch */
  810. case 0: /* must back up */
  811. /* undo the effects of YY_DO_BEFORE_ACTION */
  812. *yy_cp = yyg->yy_hold_char;
  813. yy_cp = yyg->yy_last_accepting_cpos;
  814. yy_current_state = yyg->yy_last_accepting_state;
  815. goto yy_find_action;
  816. case 1:
  817. YY_RULE_SETUP
  818. {
  819. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  820. yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
  821. return cal_ENVCURLY;
  822. }
  823. YY_BREAK
  824. case 2:
  825. YY_RULE_SETUP
  826. {
  827. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  828. yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
  829. return cal_NCURLY;
  830. }
  831. YY_BREAK
  832. case 3:
  833. YY_RULE_SETUP
  834. {
  835. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  836. yyextra->AllocateParserType(yylvalp, yytext+1, strlen(yytext)-2);
  837. return cal_ATNAME;
  838. }
  839. YY_BREAK
  840. case 4:
  841. YY_RULE_SETUP
  842. {
  843. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  844. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  845. yylvalp->str = DCURLYVariable;
  846. return cal_DCURLY;
  847. }
  848. YY_BREAK
  849. case 5:
  850. YY_RULE_SETUP
  851. {
  852. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  853. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  854. yylvalp->str = RCURLYVariable;
  855. return cal_RCURLY;
  856. }
  857. YY_BREAK
  858. case 6:
  859. YY_RULE_SETUP
  860. {
  861. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  862. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  863. yylvalp->str = ATVariable;
  864. return cal_AT;
  865. }
  866. YY_BREAK
  867. case 7:
  868. YY_RULE_SETUP
  869. {
  870. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  871. yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  872. return cal_NAME;
  873. }
  874. YY_BREAK
  875. case 8:
  876. YY_RULE_SETUP
  877. {
  878. if ( !yyextra->HandleEscapeSymbol(yylvalp, *(yytext+1)) )
  879. {
  880. return cal_ERROR;
  881. }
  882. return cal_SYMBOL;
  883. }
  884. YY_BREAK
  885. case 9:
  886. /* rule 9 can match eol */
  887. YY_RULE_SETUP
  888. {
  889. //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl;
  890. yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  891. return cal_SYMBOL;
  892. }
  893. YY_BREAK
  894. case 10:
  895. YY_RULE_SETUP
  896. {
  897. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  898. yylvalp->str = DOLLARVariable;
  899. return cal_DOLLAR;
  900. }
  901. YY_BREAK
  902. case 11:
  903. YY_RULE_SETUP
  904. {
  905. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  906. yylvalp->str = LCURLYVariable;
  907. return cal_LCURLY;
  908. }
  909. YY_BREAK
  910. case 12:
  911. YY_RULE_SETUP
  912. {
  913. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  914. yylvalp->str = BSLASHVariable;
  915. return cal_BSLASH;
  916. }
  917. YY_BREAK
  918. case 13:
  919. YY_RULE_SETUP
  920. {
  921. //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext));
  922. yylvalp->str = BSLASHVariable;
  923. return cal_SYMBOL;
  924. }
  925. YY_BREAK
  926. case 14:
  927. YY_RULE_SETUP
  928. ECHO;
  929. YY_BREAK
  930. case YY_STATE_EOF(INITIAL):
  931. case YY_STATE_EOF(ESCAPES):
  932. case YY_STATE_EOF(NOESCAPES):
  933. yyterminate();
  934. case YY_END_OF_BUFFER:
  935. {
  936. /* Amount of text matched not including the EOB char. */
  937. int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
  938. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  939. *yy_cp = yyg->yy_hold_char;
  940. YY_RESTORE_YY_MORE_OFFSET
  941. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  942. {
  943. /* We're scanning a new file or input source. It's
  944. * possible that this happened because the user
  945. * just pointed yyin at a new source and called
  946. * yylex(). If so, then we have to assure
  947. * consistency between YY_CURRENT_BUFFER and our
  948. * globals. Here is the right place to do so, because
  949. * this is the first action (other than possibly a
  950. * back-up) that will match for the new input source.
  951. */
  952. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  953. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  954. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  955. }
  956. /* Note that here we test for yy_c_buf_p "<=" to the position
  957. * of the first EOB in the buffer, since yy_c_buf_p will
  958. * already have been incremented past the NUL character
  959. * (since all states make transitions on EOB to the
  960. * end-of-buffer state). Contrast this with the test
  961. * in input().
  962. */
  963. if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  964. { /* This was really a NUL. */
  965. yy_state_type yy_next_state;
  966. yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
  967. yy_current_state = yy_get_previous_state( yyscanner );
  968. /* Okay, we're now positioned to make the NUL
  969. * transition. We couldn't have
  970. * yy_get_previous_state() go ahead and do it
  971. * for us because it doesn't know how to deal
  972. * with the possibility of jamming (and we don't
  973. * want to build jamming into it because then it
  974. * will run more slowly).
  975. */
  976. yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
  977. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  978. if ( yy_next_state )
  979. {
  980. /* Consume the NUL. */
  981. yy_cp = ++yyg->yy_c_buf_p;
  982. yy_current_state = yy_next_state;
  983. goto yy_match;
  984. }
  985. else
  986. {
  987. yy_cp = yyg->yy_c_buf_p;
  988. goto yy_find_action;
  989. }
  990. }
  991. else switch ( yy_get_next_buffer( yyscanner ) )
  992. {
  993. case EOB_ACT_END_OF_FILE:
  994. {
  995. yyg->yy_did_buffer_switch_on_eof = 0;
  996. if ( yywrap( yyscanner ) )
  997. {
  998. /* Note: because we've taken care in
  999. * yy_get_next_buffer() to have set up
  1000. * yytext, we can now set up
  1001. * yy_c_buf_p so that if some total
  1002. * hoser (like flex itself) wants to
  1003. * call the scanner after we return the
  1004. * YY_NULL, it'll still work - another
  1005. * YY_NULL will get returned.
  1006. */
  1007. yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
  1008. yy_act = YY_STATE_EOF(YY_START);
  1009. goto do_action;
  1010. }
  1011. else
  1012. {
  1013. if ( ! yyg->yy_did_buffer_switch_on_eof )
  1014. YY_NEW_FILE;
  1015. }
  1016. break;
  1017. }
  1018. case EOB_ACT_CONTINUE_SCAN:
  1019. yyg->yy_c_buf_p =
  1020. yyg->yytext_ptr + yy_amount_of_matched_text;
  1021. yy_current_state = yy_get_previous_state( yyscanner );
  1022. yy_cp = yyg->yy_c_buf_p;
  1023. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  1024. goto yy_match;
  1025. case EOB_ACT_LAST_MATCH:
  1026. yyg->yy_c_buf_p =
  1027. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
  1028. yy_current_state = yy_get_previous_state( yyscanner );
  1029. yy_cp = yyg->yy_c_buf_p;
  1030. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  1031. goto yy_find_action;
  1032. }
  1033. break;
  1034. }
  1035. default:
  1036. YY_FATAL_ERROR(
  1037. "fatal flex scanner internal error--no action found" );
  1038. } /* end of action switch */
  1039. } /* end of scanning one token */
  1040. } /* end of user's declarations */
  1041. } /* end of yylex */
  1042. /* yy_get_next_buffer - try to read in a new buffer
  1043. *
  1044. * Returns a code representing an action:
  1045. * EOB_ACT_LAST_MATCH -
  1046. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  1047. * EOB_ACT_END_OF_FILE - end of file
  1048. */
  1049. static int yy_get_next_buffer (yyscan_t yyscanner)
  1050. {
  1051. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1052. char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  1053. char *source = yyg->yytext_ptr;
  1054. int number_to_move, i;
  1055. int ret_val;
  1056. if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
  1057. YY_FATAL_ERROR(
  1058. "fatal flex scanner internal error--end of buffer missed" );
  1059. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  1060. { /* Don't try to fill the buffer, so this is an EOF. */
  1061. if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
  1062. {
  1063. /* We matched a single character, the EOB, so
  1064. * treat this as a final EOF.
  1065. */
  1066. return EOB_ACT_END_OF_FILE;
  1067. }
  1068. else
  1069. {
  1070. /* We matched some text prior to the EOB, first
  1071. * process it.
  1072. */
  1073. return EOB_ACT_LAST_MATCH;
  1074. }
  1075. }
  1076. /* Try to read more data. */
  1077. /* First move last chars to start of buffer. */
  1078. number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
  1079. for ( i = 0; i < number_to_move; ++i )
  1080. *(dest++) = *(source++);
  1081. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  1082. /* don't do the read, it's not guaranteed to return an EOF,
  1083. * just force an EOF
  1084. */
  1085. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
  1086. else
  1087. {
  1088. int num_to_read =
  1089. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  1090. while ( num_to_read <= 0 )
  1091. { /* Not enough room in the buffer - grow it. */
  1092. /* just a shorter name for the current buffer */
  1093. YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
  1094. int yy_c_buf_p_offset =
  1095. (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
  1096. if ( b->yy_is_our_buffer )
  1097. {
  1098. int new_size = b->yy_buf_size * 2;
  1099. if ( new_size <= 0 )
  1100. b->yy_buf_size += b->yy_buf_size / 8;
  1101. else
  1102. b->yy_buf_size *= 2;
  1103. b->yy_ch_buf = (char *)
  1104. /* Include room in for 2 EOB chars. */
  1105. yyrealloc( (void *) b->yy_ch_buf,
  1106. (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
  1107. }
  1108. else
  1109. /* Can't grow it, we don't own it. */
  1110. b->yy_ch_buf = NULL;
  1111. if ( ! b->yy_ch_buf )
  1112. YY_FATAL_ERROR(
  1113. "fatal error - scanner input buffer overflow" );
  1114. yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  1115. num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  1116. number_to_move - 1;
  1117. }
  1118. if ( num_to_read > YY_READ_BUF_SIZE )
  1119. num_to_read = YY_READ_BUF_SIZE;
  1120. /* Read in more data. */
  1121. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  1122. yyg->yy_n_chars, num_to_read );
  1123. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1124. }
  1125. if ( yyg->yy_n_chars == 0 )
  1126. {
  1127. if ( number_to_move == YY_MORE_ADJ )
  1128. {
  1129. ret_val = EOB_ACT_END_OF_FILE;
  1130. yyrestart( yyin , yyscanner);
  1131. }
  1132. else
  1133. {
  1134. ret_val = EOB_ACT_LAST_MATCH;
  1135. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  1136. YY_BUFFER_EOF_PENDING;
  1137. }
  1138. }
  1139. else
  1140. ret_val = EOB_ACT_CONTINUE_SCAN;
  1141. if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
  1142. /* Extend the array by 50%, plus the number we really need. */
  1143. int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
  1144. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
  1145. (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
  1146. if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1147. YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
  1148. /* "- 2" to take care of EOB's */
  1149. YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
  1150. }
  1151. yyg->yy_n_chars += number_to_move;
  1152. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  1153. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  1154. yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  1155. return ret_val;
  1156. }
  1157. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1158. static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
  1159. {
  1160. yy_state_type yy_current_state;
  1161. char *yy_cp;
  1162. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1163. yy_current_state = yyg->yy_start;
  1164. for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
  1165. {
  1166. YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  1167. if ( yy_accept[yy_current_state] )
  1168. {
  1169. yyg->yy_last_accepting_state = yy_current_state;
  1170. yyg->yy_last_accepting_cpos = yy_cp;
  1171. }
  1172. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1173. {
  1174. yy_current_state = (int) yy_def[yy_current_state];
  1175. if ( yy_current_state >= 30 )
  1176. yy_c = yy_meta[yy_c];
  1177. }
  1178. yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  1179. }
  1180. return yy_current_state;
  1181. }
  1182. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1183. *
  1184. * synopsis
  1185. * next_state = yy_try_NUL_trans( current_state );
  1186. */
  1187. static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
  1188. {
  1189. int yy_is_jam;
  1190. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
  1191. char *yy_cp = yyg->yy_c_buf_p;
  1192. YY_CHAR yy_c = 1;
  1193. if ( yy_accept[yy_current_state] )
  1194. {
  1195. yyg->yy_last_accepting_state = yy_current_state;
  1196. yyg->yy_last_accepting_cpos = yy_cp;
  1197. }
  1198. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1199. {
  1200. yy_current_state = (int) yy_def[yy_current_state];
  1201. if ( yy_current_state >= 30 )
  1202. yy_c = yy_meta[yy_c];
  1203. }
  1204. yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  1205. yy_is_jam = (yy_current_state == 29);
  1206. (void)yyg;
  1207. return yy_is_jam ? 0 : yy_current_state;
  1208. }
  1209. #ifndef YY_NO_UNPUT
  1210. #endif
  1211. #ifndef YY_NO_INPUT
  1212. #ifdef __cplusplus
  1213. static int yyinput (yyscan_t yyscanner)
  1214. #else
  1215. static int input (yyscan_t yyscanner)
  1216. #endif
  1217. {
  1218. int c;
  1219. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1220. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1221. if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1222. {
  1223. /* yy_c_buf_p now points to the character we want to return.
  1224. * If this occurs *before* the EOB characters, then it's a
  1225. * valid NUL; if not, then we've hit the end of the buffer.
  1226. */
  1227. if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  1228. /* This was really a NUL. */
  1229. *yyg->yy_c_buf_p = '\0';
  1230. else
  1231. { /* need more input */
  1232. int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
  1233. ++yyg->yy_c_buf_p;
  1234. switch ( yy_get_next_buffer( yyscanner ) )
  1235. {
  1236. case EOB_ACT_LAST_MATCH:
  1237. /* This happens because yy_g_n_b()
  1238. * sees that we've accumulated a
  1239. * token and flags that we need to
  1240. * try matching the token before
  1241. * proceeding. But for input(),
  1242. * there's no matching to consider.
  1243. * So convert the EOB_ACT_LAST_MATCH
  1244. * to EOB_ACT_END_OF_FILE.
  1245. */
  1246. /* Reset buffer status. */
  1247. yyrestart( yyin , yyscanner);
  1248. /*FALLTHROUGH*/
  1249. case EOB_ACT_END_OF_FILE:
  1250. {
  1251. if ( yywrap( yyscanner ) )
  1252. return 0;
  1253. if ( ! yyg->yy_did_buffer_switch_on_eof )
  1254. YY_NEW_FILE;
  1255. #ifdef __cplusplus
  1256. return yyinput(yyscanner);
  1257. #else
  1258. return input(yyscanner);
  1259. #endif
  1260. }
  1261. case EOB_ACT_CONTINUE_SCAN:
  1262. yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
  1263. break;
  1264. }
  1265. }
  1266. }
  1267. c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
  1268. *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
  1269. yyg->yy_hold_char = *++yyg->yy_c_buf_p;
  1270. return c;
  1271. }
  1272. #endif /* ifndef YY_NO_INPUT */
  1273. /** Immediately switch to a different input stream.
  1274. * @param input_file A readable stream.
  1275. * @param yyscanner The scanner object.
  1276. * @note This function does not reset the start condition to @c INITIAL .
  1277. */
  1278. void yyrestart (FILE * input_file , yyscan_t yyscanner)
  1279. {
  1280. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1281. if ( ! YY_CURRENT_BUFFER ){
  1282. yyensure_buffer_stack (yyscanner);
  1283. YY_CURRENT_BUFFER_LVALUE =
  1284. yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
  1285. }
  1286. yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
  1287. yy_load_buffer_state( yyscanner );
  1288. }
  1289. /** Switch to a different input buffer.
  1290. * @param new_buffer The new input buffer.
  1291. * @param yyscanner The scanner object.
  1292. */
  1293. void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  1294. {
  1295. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1296. /* TODO. We should be able to replace this entire function body
  1297. * with
  1298. * yypop_buffer_state();
  1299. * yypush_buffer_state(new_buffer);
  1300. */
  1301. yyensure_buffer_stack (yyscanner);
  1302. if ( YY_CURRENT_BUFFER == new_buffer )
  1303. return;
  1304. if ( YY_CURRENT_BUFFER )
  1305. {
  1306. /* Flush out information for old buffer. */
  1307. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1308. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  1309. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1310. }
  1311. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1312. yy_load_buffer_state( yyscanner );
  1313. /* We don't actually know whether we did this switch during
  1314. * EOF (yywrap()) processing, but the only time this flag
  1315. * is looked at is after yywrap() is called, so it's safe
  1316. * to go ahead and always set it.
  1317. */
  1318. yyg->yy_did_buffer_switch_on_eof = 1;
  1319. }
  1320. static void yy_load_buffer_state (yyscan_t yyscanner)
  1321. {
  1322. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1323. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1324. yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  1325. yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  1326. yyg->yy_hold_char = *yyg->yy_c_buf_p;
  1327. }
  1328. /** Allocate and initialize an input buffer state.
  1329. * @param file A readable stream.
  1330. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  1331. * @param yyscanner The scanner object.
  1332. * @return the allocated buffer state.
  1333. */
  1334. YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
  1335. {
  1336. YY_BUFFER_STATE b;
  1337. b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
  1338. if ( ! b )
  1339. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1340. b->yy_buf_size = size;
  1341. /* yy_ch_buf has to be 2 characters longer than the size given because
  1342. * we need to put in 2 end-of-buffer characters.
  1343. */
  1344. b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
  1345. if ( ! b->yy_ch_buf )
  1346. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1347. b->yy_is_our_buffer = 1;
  1348. yy_init_buffer( b, file , yyscanner);
  1349. return b;
  1350. }
  1351. /** Destroy the buffer.
  1352. * @param b a buffer created with yy_create_buffer()
  1353. * @param yyscanner The scanner object.
  1354. */
  1355. void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  1356. {
  1357. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1358. if ( ! b )
  1359. return;
  1360. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  1361. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  1362. if ( b->yy_is_our_buffer )
  1363. yyfree( (void *) b->yy_ch_buf , yyscanner );
  1364. yyfree( (void *) b , yyscanner );
  1365. }
  1366. /* Initializes or reinitializes a buffer.
  1367. * This function is sometimes called more than once on the same buffer,
  1368. * such as during a yyrestart() or at EOF.
  1369. */
  1370. static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
  1371. {
  1372. int oerrno = errno;
  1373. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1374. yy_flush_buffer( b , yyscanner);
  1375. b->yy_input_file = file;
  1376. b->yy_fill_buffer = 1;
  1377. /* If b is the current buffer, then yy_init_buffer was _probably_
  1378. * called from yyrestart() or through yy_get_next_buffer.
  1379. * In that case, we don't want to reset the lineno or column.
  1380. */
  1381. if (b != YY_CURRENT_BUFFER){
  1382. b->yy_bs_lineno = 1;
  1383. b->yy_bs_column = 0;
  1384. }
  1385. b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1386. errno = oerrno;
  1387. }
  1388. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  1389. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  1390. * @param yyscanner The scanner object.
  1391. */
  1392. void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  1393. {
  1394. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1395. if ( ! b )
  1396. return;
  1397. b->yy_n_chars = 0;
  1398. /* We always need two end-of-buffer characters. The first causes
  1399. * a transition to the end-of-buffer state. The second causes
  1400. * a jam in that state.
  1401. */
  1402. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1403. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1404. b->yy_buf_pos = &b->yy_ch_buf[0];
  1405. b->yy_at_bol = 1;
  1406. b->yy_buffer_status = YY_BUFFER_NEW;
  1407. if ( b == YY_CURRENT_BUFFER )
  1408. yy_load_buffer_state( yyscanner );
  1409. }
  1410. /** Pushes the new state onto the stack. The new state becomes
  1411. * the current state. This function will allocate the stack
  1412. * if necessary.
  1413. * @param new_buffer The new state.
  1414. * @param yyscanner The scanner object.
  1415. */
  1416. void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  1417. {
  1418. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1419. if (new_buffer == NULL)
  1420. return;
  1421. yyensure_buffer_stack(yyscanner);
  1422. /* This block is copied from yy_switch_to_buffer. */
  1423. if ( YY_CURRENT_BUFFER )
  1424. {
  1425. /* Flush out information for old buffer. */
  1426. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1427. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  1428. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1429. }
  1430. /* Only push if top exists. Otherwise, replace top. */
  1431. if (YY_CURRENT_BUFFER)
  1432. yyg->yy_buffer_stack_top++;
  1433. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1434. /* copied from yy_switch_to_buffer. */
  1435. yy_load_buffer_state( yyscanner );
  1436. yyg->yy_did_buffer_switch_on_eof = 1;
  1437. }
  1438. /** Removes and deletes the top of the stack, if present.
  1439. * The next element becomes the new top.
  1440. * @param yyscanner The scanner object.
  1441. */
  1442. void yypop_buffer_state (yyscan_t yyscanner)
  1443. {
  1444. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1445. if (!YY_CURRENT_BUFFER)
  1446. return;
  1447. yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
  1448. YY_CURRENT_BUFFER_LVALUE = NULL;
  1449. if (yyg->yy_buffer_stack_top > 0)
  1450. --yyg->yy_buffer_stack_top;
  1451. if (YY_CURRENT_BUFFER) {
  1452. yy_load_buffer_state( yyscanner );
  1453. yyg->yy_did_buffer_switch_on_eof = 1;
  1454. }
  1455. }
  1456. /* Allocates the stack if it does not exist.
  1457. * Guarantees space for at least one push.
  1458. */
  1459. static void yyensure_buffer_stack (yyscan_t yyscanner)
  1460. {
  1461. yy_size_t num_to_alloc;
  1462. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1463. if (!yyg->yy_buffer_stack) {
  1464. /* First allocation is just for 2 elements, since we don't know if this
  1465. * scanner will even need a stack. We use 2 instead of 1 to avoid an
  1466. * immediate realloc on the next call.
  1467. */
  1468. num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
  1469. yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
  1470. (num_to_alloc * sizeof(struct yy_buffer_state*)
  1471. , yyscanner);
  1472. if ( ! yyg->yy_buffer_stack )
  1473. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1474. memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  1475. yyg->yy_buffer_stack_max = num_to_alloc;
  1476. yyg->yy_buffer_stack_top = 0;
  1477. return;
  1478. }
  1479. if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
  1480. /* Increase the buffer to prepare for a possible push. */
  1481. yy_size_t grow_size = 8 /* arbitrary grow size */;
  1482. num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
  1483. yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
  1484. (yyg->yy_buffer_stack,
  1485. num_to_alloc * sizeof(struct yy_buffer_state*)
  1486. , yyscanner);
  1487. if ( ! yyg->yy_buffer_stack )
  1488. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1489. /* zero only the new slots.*/
  1490. memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
  1491. yyg->yy_buffer_stack_max = num_to_alloc;
  1492. }
  1493. }
  1494. /** Setup the input buffer state to scan directly from a user-specified character buffer.
  1495. * @param base the character buffer
  1496. * @param size the size in bytes of the character buffer
  1497. * @param yyscanner The scanner object.
  1498. * @return the newly allocated buffer state object.
  1499. */
  1500. YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
  1501. {
  1502. YY_BUFFER_STATE b;
  1503. if ( size < 2 ||
  1504. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1505. base[size-1] != YY_END_OF_BUFFER_CHAR )
  1506. /* They forgot to leave room for the EOB's. */
  1507. return NULL;
  1508. b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
  1509. if ( ! b )
  1510. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  1511. b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
  1512. b->yy_buf_pos = b->yy_ch_buf = base;
  1513. b->yy_is_our_buffer = 0;
  1514. b->yy_input_file = NULL;
  1515. b->yy_n_chars = b->yy_buf_size;
  1516. b->yy_is_interactive = 0;
  1517. b->yy_at_bol = 1;
  1518. b->yy_fill_buffer = 0;
  1519. b->yy_buffer_status = YY_BUFFER_NEW;
  1520. yy_switch_to_buffer( b , yyscanner );
  1521. return b;
  1522. }
  1523. /** Setup the input buffer state to scan a string. The next call to yylex() will
  1524. * scan from a @e copy of @a str.
  1525. * @param yystr a NUL-terminated string to scan
  1526. * @param yyscanner The scanner object.
  1527. * @return the newly allocated buffer state object.
  1528. * @note If you want to scan bytes that may contain NUL values, then use
  1529. * yy_scan_bytes() instead.
  1530. */
  1531. YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
  1532. {
  1533. return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
  1534. }
  1535. /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  1536. * scan from a @e copy of @a bytes.
  1537. * @param yybytes the byte buffer to scan
  1538. * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  1539. * @param yyscanner The scanner object.
  1540. * @return the newly allocated buffer state object.
  1541. */
  1542. YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
  1543. {
  1544. YY_BUFFER_STATE b;
  1545. char *buf;
  1546. yy_size_t n;
  1547. int i;
  1548. /* Get memory for full buffer, including space for trailing EOB's. */
  1549. n = (yy_size_t) (_yybytes_len + 2);
  1550. buf = (char *) yyalloc( n , yyscanner );
  1551. if ( ! buf )
  1552. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  1553. for ( i = 0; i < _yybytes_len; ++i )
  1554. buf[i] = yybytes[i];
  1555. buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
  1556. b = yy_scan_buffer( buf, n , yyscanner);
  1557. if ( ! b )
  1558. YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  1559. /* It's okay to grow etc. this buffer, and we should throw it
  1560. * away when we're done.
  1561. */
  1562. b->yy_is_our_buffer = 1;
  1563. return b;
  1564. }
  1565. #ifndef YY_EXIT_FAILURE
  1566. #define YY_EXIT_FAILURE 2
  1567. #endif
  1568. static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
  1569. {
  1570. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1571. (void)yyg;
  1572. fprintf( stderr, "%s\n", msg );
  1573. exit( YY_EXIT_FAILURE );
  1574. }
  1575. /* Redefine yyless() so it works in section 3 code. */
  1576. #undef yyless
  1577. #define yyless(n) \
  1578. do \
  1579. { \
  1580. /* Undo effects of setting up yytext. */ \
  1581. int yyless_macro_arg = (n); \
  1582. YY_LESS_LINENO(yyless_macro_arg);\
  1583. yytext[yyleng] = yyg->yy_hold_char; \
  1584. yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
  1585. yyg->yy_hold_char = *yyg->yy_c_buf_p; \
  1586. *yyg->yy_c_buf_p = '\0'; \
  1587. yyleng = yyless_macro_arg; \
  1588. } \
  1589. while ( 0 )
  1590. /* Accessor methods (get/set functions) to struct members. */
  1591. /** Get the user-defined data for this scanner.
  1592. * @param yyscanner The scanner object.
  1593. */
  1594. YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
  1595. {
  1596. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1597. return yyextra;
  1598. }
  1599. /** Get the current line number.
  1600. * @param yyscanner The scanner object.
  1601. */
  1602. int yyget_lineno (yyscan_t yyscanner)
  1603. {
  1604. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1605. if (! YY_CURRENT_BUFFER)
  1606. return 0;
  1607. return yylineno;
  1608. }
  1609. /** Get the current column number.
  1610. * @param yyscanner The scanner object.
  1611. */
  1612. int yyget_column (yyscan_t yyscanner)
  1613. {
  1614. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1615. if (! YY_CURRENT_BUFFER)
  1616. return 0;
  1617. return yycolumn;
  1618. }
  1619. /** Get the input stream.
  1620. * @param yyscanner The scanner object.
  1621. */
  1622. FILE *yyget_in (yyscan_t yyscanner)
  1623. {
  1624. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1625. return yyin;
  1626. }
  1627. /** Get the output stream.
  1628. * @param yyscanner The scanner object.
  1629. */
  1630. FILE *yyget_out (yyscan_t yyscanner)
  1631. {
  1632. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1633. return yyout;
  1634. }
  1635. /** Get the length of the current token.
  1636. * @param yyscanner The scanner object.
  1637. */
  1638. int yyget_leng (yyscan_t yyscanner)
  1639. {
  1640. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1641. return yyleng;
  1642. }
  1643. /** Get the current token.
  1644. * @param yyscanner The scanner object.
  1645. */
  1646. char *yyget_text (yyscan_t yyscanner)
  1647. {
  1648. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1649. return yytext;
  1650. }
  1651. /** Set the user-defined data. This data is never touched by the scanner.
  1652. * @param user_defined The data to be associated with this scanner.
  1653. * @param yyscanner The scanner object.
  1654. */
  1655. void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
  1656. {
  1657. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1658. yyextra = user_defined ;
  1659. }
  1660. /** Set the current line number.
  1661. * @param _line_number line number
  1662. * @param yyscanner The scanner object.
  1663. */
  1664. void yyset_lineno (int _line_number , yyscan_t yyscanner)
  1665. {
  1666. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1667. /* lineno is only valid if an input buffer exists. */
  1668. if (! YY_CURRENT_BUFFER )
  1669. YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
  1670. yylineno = _line_number;
  1671. }
  1672. /** Set the current column.
  1673. * @param _column_no column number
  1674. * @param yyscanner The scanner object.
  1675. */
  1676. void yyset_column (int _column_no , yyscan_t yyscanner)
  1677. {
  1678. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1679. /* column is only valid if an input buffer exists. */
  1680. if (! YY_CURRENT_BUFFER )
  1681. YY_FATAL_ERROR( "yyset_column called with no buffer" );
  1682. yycolumn = _column_no;
  1683. }
  1684. /** Set the input stream. This does not discard the current
  1685. * input buffer.
  1686. * @param _in_str A readable stream.
  1687. * @param yyscanner The scanner object.
  1688. * @see yy_switch_to_buffer
  1689. */
  1690. void yyset_in (FILE * _in_str , yyscan_t yyscanner)
  1691. {
  1692. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1693. yyin = _in_str ;
  1694. }
  1695. void yyset_out (FILE * _out_str , yyscan_t yyscanner)
  1696. {
  1697. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1698. yyout = _out_str ;
  1699. }
  1700. int yyget_debug (yyscan_t yyscanner)
  1701. {
  1702. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1703. return yy_flex_debug;
  1704. }
  1705. void yyset_debug (int _bdebug , yyscan_t yyscanner)
  1706. {
  1707. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1708. yy_flex_debug = _bdebug ;
  1709. }
  1710. /* Accessor methods for yylval and yylloc */
  1711. /* User-visible API */
  1712. /* yylex_init is special because it creates the scanner itself, so it is
  1713. * the ONLY reentrant function that doesn't take the scanner as the last argument.
  1714. * That's why we explicitly handle the declaration, instead of using our macros.
  1715. */
  1716. int yylex_init(yyscan_t* ptr_yy_globals)
  1717. {
  1718. if (ptr_yy_globals == NULL){
  1719. errno = EINVAL;
  1720. return 1;
  1721. }
  1722. *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
  1723. if (*ptr_yy_globals == NULL){
  1724. errno = ENOMEM;
  1725. return 1;
  1726. }
  1727. /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
  1728. memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  1729. return yy_init_globals ( *ptr_yy_globals );
  1730. }
  1731. /* yylex_init_extra has the same functionality as yylex_init, but follows the
  1732. * convention of taking the scanner as the last argument. Note however, that
  1733. * this is a *pointer* to a scanner, as it will be allocated by this call (and
  1734. * is the reason, too, why this function also must handle its own declaration).
  1735. * The user defined value in the first argument will be available to yyalloc in
  1736. * the yyextra field.
  1737. */
  1738. int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
  1739. {
  1740. struct yyguts_t dummy_yyguts;
  1741. yyset_extra (yy_user_defined, &dummy_yyguts);
  1742. if (ptr_yy_globals == NULL){
  1743. errno = EINVAL;
  1744. return 1;
  1745. }
  1746. *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
  1747. if (*ptr_yy_globals == NULL){
  1748. errno = ENOMEM;
  1749. return 1;
  1750. }
  1751. /* By setting to 0xAA, we expose bugs in
  1752. yy_init_globals. Leave at 0x00 for releases. */
  1753. memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  1754. yyset_extra (yy_user_defined, *ptr_yy_globals);
  1755. return yy_init_globals ( *ptr_yy_globals );
  1756. }
  1757. static int yy_init_globals (yyscan_t yyscanner)
  1758. {
  1759. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1760. /* Initialization is the same as for the non-reentrant scanner.
  1761. * This function is called from yylex_destroy(), so don't allocate here.
  1762. */
  1763. yyg->yy_buffer_stack = NULL;
  1764. yyg->yy_buffer_stack_top = 0;
  1765. yyg->yy_buffer_stack_max = 0;
  1766. yyg->yy_c_buf_p = NULL;
  1767. yyg->yy_init = 0;
  1768. yyg->yy_start = 0;
  1769. yyg->yy_start_stack_ptr = 0;
  1770. yyg->yy_start_stack_depth = 0;
  1771. yyg->yy_start_stack = NULL;
  1772. /* Defined in main.c */
  1773. #ifdef YY_STDINIT
  1774. yyin = stdin;
  1775. yyout = stdout;
  1776. #else
  1777. yyin = NULL;
  1778. yyout = NULL;
  1779. #endif
  1780. /* For future reference: Set errno on error, since we are called by
  1781. * yylex_init()
  1782. */
  1783. return 0;
  1784. }
  1785. /* yylex_destroy is for both reentrant and non-reentrant scanners. */
  1786. int yylex_destroy (yyscan_t yyscanner)
  1787. {
  1788. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1789. /* Pop the buffer stack, destroying each element. */
  1790. while(YY_CURRENT_BUFFER){
  1791. yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
  1792. YY_CURRENT_BUFFER_LVALUE = NULL;
  1793. yypop_buffer_state(yyscanner);
  1794. }
  1795. /* Destroy the stack itself. */
  1796. yyfree(yyg->yy_buffer_stack , yyscanner);
  1797. yyg->yy_buffer_stack = NULL;
  1798. /* Destroy the start condition stack. */
  1799. yyfree( yyg->yy_start_stack , yyscanner );
  1800. yyg->yy_start_stack = NULL;
  1801. /* Reset the globals. This is important in a non-reentrant scanner so the next time
  1802. * yylex() is called, initialization will occur. */
  1803. yy_init_globals( yyscanner);
  1804. /* Destroy the main struct (reentrant only). */
  1805. yyfree ( yyscanner , yyscanner );
  1806. yyscanner = NULL;
  1807. return 0;
  1808. }
  1809. /*
  1810. * Internal utility routines.
  1811. */
  1812. #ifndef yytext_ptr
  1813. static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
  1814. {
  1815. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1816. (void)yyg;
  1817. int i;
  1818. for ( i = 0; i < n; ++i )
  1819. s1[i] = s2[i];
  1820. }
  1821. #endif
  1822. #ifdef YY_NEED_STRLEN
  1823. static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
  1824. {
  1825. int n;
  1826. for ( n = 0; s[n]; ++n )
  1827. ;
  1828. return n;
  1829. }
  1830. #endif
  1831. void *yyalloc (yy_size_t size , yyscan_t yyscanner)
  1832. {
  1833. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1834. (void)yyg;
  1835. return malloc(size);
  1836. }
  1837. void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
  1838. {
  1839. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1840. (void)yyg;
  1841. /* The cast to (char *) in the following accommodates both
  1842. * implementations that use char* generic pointers, and those
  1843. * that use void* generic pointers. It works with the latter
  1844. * because both ANSI C and C++ allow castless assignment from
  1845. * any pointer type to void*, and deal with argument conversions
  1846. * as though doing an assignment.
  1847. */
  1848. return realloc(ptr, size);
  1849. }
  1850. void yyfree (void * ptr , yyscan_t yyscanner)
  1851. {
  1852. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1853. (void)yyg;
  1854. free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
  1855. }
  1856. #define YYTABLES_NAME "yytables"
  1857. /*--------------------------------------------------------------------------*/
  1858. void cmCommandArgument_SetupEscapes(yyscan_t yyscanner, bool noEscapes)
  1859. {
  1860. /* Hack into the internal flex-generated scanner to set the state. */
  1861. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1862. if(noEscapes) {
  1863. BEGIN(NOESCAPES);
  1864. } else {
  1865. BEGIN(ESCAPES);
  1866. }
  1867. }
  1868. #endif /* __clang_analyzer__ */