cmCommandArgumentLexer.cxx 60 KB

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