cmListFileLexer.c 78 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859
  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 cmListFileLexer_yy_create_buffer_ALREADY_DEFINED
  14. #else
  15. #define yy_create_buffer cmListFileLexer_yy_create_buffer
  16. #endif
  17. #ifdef yy_delete_buffer
  18. #define cmListFileLexer_yy_delete_buffer_ALREADY_DEFINED
  19. #else
  20. #define yy_delete_buffer cmListFileLexer_yy_delete_buffer
  21. #endif
  22. #ifdef yy_scan_buffer
  23. #define cmListFileLexer_yy_scan_buffer_ALREADY_DEFINED
  24. #else
  25. #define yy_scan_buffer cmListFileLexer_yy_scan_buffer
  26. #endif
  27. #ifdef yy_scan_string
  28. #define cmListFileLexer_yy_scan_string_ALREADY_DEFINED
  29. #else
  30. #define yy_scan_string cmListFileLexer_yy_scan_string
  31. #endif
  32. #ifdef yy_scan_bytes
  33. #define cmListFileLexer_yy_scan_bytes_ALREADY_DEFINED
  34. #else
  35. #define yy_scan_bytes cmListFileLexer_yy_scan_bytes
  36. #endif
  37. #ifdef yy_init_buffer
  38. #define cmListFileLexer_yy_init_buffer_ALREADY_DEFINED
  39. #else
  40. #define yy_init_buffer cmListFileLexer_yy_init_buffer
  41. #endif
  42. #ifdef yy_flush_buffer
  43. #define cmListFileLexer_yy_flush_buffer_ALREADY_DEFINED
  44. #else
  45. #define yy_flush_buffer cmListFileLexer_yy_flush_buffer
  46. #endif
  47. #ifdef yy_load_buffer_state
  48. #define cmListFileLexer_yy_load_buffer_state_ALREADY_DEFINED
  49. #else
  50. #define yy_load_buffer_state cmListFileLexer_yy_load_buffer_state
  51. #endif
  52. #ifdef yy_switch_to_buffer
  53. #define cmListFileLexer_yy_switch_to_buffer_ALREADY_DEFINED
  54. #else
  55. #define yy_switch_to_buffer cmListFileLexer_yy_switch_to_buffer
  56. #endif
  57. #ifdef yypush_buffer_state
  58. #define cmListFileLexer_yypush_buffer_state_ALREADY_DEFINED
  59. #else
  60. #define yypush_buffer_state cmListFileLexer_yypush_buffer_state
  61. #endif
  62. #ifdef yypop_buffer_state
  63. #define cmListFileLexer_yypop_buffer_state_ALREADY_DEFINED
  64. #else
  65. #define yypop_buffer_state cmListFileLexer_yypop_buffer_state
  66. #endif
  67. #ifdef yyensure_buffer_stack
  68. #define cmListFileLexer_yyensure_buffer_stack_ALREADY_DEFINED
  69. #else
  70. #define yyensure_buffer_stack cmListFileLexer_yyensure_buffer_stack
  71. #endif
  72. #ifdef yylex
  73. #define cmListFileLexer_yylex_ALREADY_DEFINED
  74. #else
  75. #define yylex cmListFileLexer_yylex
  76. #endif
  77. #ifdef yyrestart
  78. #define cmListFileLexer_yyrestart_ALREADY_DEFINED
  79. #else
  80. #define yyrestart cmListFileLexer_yyrestart
  81. #endif
  82. #ifdef yylex_init
  83. #define cmListFileLexer_yylex_init_ALREADY_DEFINED
  84. #else
  85. #define yylex_init cmListFileLexer_yylex_init
  86. #endif
  87. #ifdef yylex_init_extra
  88. #define cmListFileLexer_yylex_init_extra_ALREADY_DEFINED
  89. #else
  90. #define yylex_init_extra cmListFileLexer_yylex_init_extra
  91. #endif
  92. #ifdef yylex_destroy
  93. #define cmListFileLexer_yylex_destroy_ALREADY_DEFINED
  94. #else
  95. #define yylex_destroy cmListFileLexer_yylex_destroy
  96. #endif
  97. #ifdef yyget_debug
  98. #define cmListFileLexer_yyget_debug_ALREADY_DEFINED
  99. #else
  100. #define yyget_debug cmListFileLexer_yyget_debug
  101. #endif
  102. #ifdef yyset_debug
  103. #define cmListFileLexer_yyset_debug_ALREADY_DEFINED
  104. #else
  105. #define yyset_debug cmListFileLexer_yyset_debug
  106. #endif
  107. #ifdef yyget_extra
  108. #define cmListFileLexer_yyget_extra_ALREADY_DEFINED
  109. #else
  110. #define yyget_extra cmListFileLexer_yyget_extra
  111. #endif
  112. #ifdef yyset_extra
  113. #define cmListFileLexer_yyset_extra_ALREADY_DEFINED
  114. #else
  115. #define yyset_extra cmListFileLexer_yyset_extra
  116. #endif
  117. #ifdef yyget_in
  118. #define cmListFileLexer_yyget_in_ALREADY_DEFINED
  119. #else
  120. #define yyget_in cmListFileLexer_yyget_in
  121. #endif
  122. #ifdef yyset_in
  123. #define cmListFileLexer_yyset_in_ALREADY_DEFINED
  124. #else
  125. #define yyset_in cmListFileLexer_yyset_in
  126. #endif
  127. #ifdef yyget_out
  128. #define cmListFileLexer_yyget_out_ALREADY_DEFINED
  129. #else
  130. #define yyget_out cmListFileLexer_yyget_out
  131. #endif
  132. #ifdef yyset_out
  133. #define cmListFileLexer_yyset_out_ALREADY_DEFINED
  134. #else
  135. #define yyset_out cmListFileLexer_yyset_out
  136. #endif
  137. #ifdef yyget_leng
  138. #define cmListFileLexer_yyget_leng_ALREADY_DEFINED
  139. #else
  140. #define yyget_leng cmListFileLexer_yyget_leng
  141. #endif
  142. #ifdef yyget_text
  143. #define cmListFileLexer_yyget_text_ALREADY_DEFINED
  144. #else
  145. #define yyget_text cmListFileLexer_yyget_text
  146. #endif
  147. #ifdef yyget_lineno
  148. #define cmListFileLexer_yyget_lineno_ALREADY_DEFINED
  149. #else
  150. #define yyget_lineno cmListFileLexer_yyget_lineno
  151. #endif
  152. #ifdef yyset_lineno
  153. #define cmListFileLexer_yyset_lineno_ALREADY_DEFINED
  154. #else
  155. #define yyset_lineno cmListFileLexer_yyset_lineno
  156. #endif
  157. #ifdef yyget_column
  158. #define cmListFileLexer_yyget_column_ALREADY_DEFINED
  159. #else
  160. #define yyget_column cmListFileLexer_yyget_column
  161. #endif
  162. #ifdef yyset_column
  163. #define cmListFileLexer_yyset_column_ALREADY_DEFINED
  164. #else
  165. #define yyset_column cmListFileLexer_yyset_column
  166. #endif
  167. #ifdef yywrap
  168. #define cmListFileLexer_yywrap_ALREADY_DEFINED
  169. #else
  170. #define yywrap cmListFileLexer_yywrap
  171. #endif
  172. #ifdef yyalloc
  173. #define cmListFileLexer_yyalloc_ALREADY_DEFINED
  174. #else
  175. #define yyalloc cmListFileLexer_yyalloc
  176. #endif
  177. #ifdef yyrealloc
  178. #define cmListFileLexer_yyrealloc_ALREADY_DEFINED
  179. #else
  180. #define yyrealloc cmListFileLexer_yyrealloc
  181. #endif
  182. #ifdef yyfree
  183. #define cmListFileLexer_yyfree_ALREADY_DEFINED
  184. #else
  185. #define yyfree cmListFileLexer_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. /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
  324. * access to the local variable yy_act. Since yyless() is a macro, it would break
  325. * existing scanners that call yyless() from OUTSIDE yylex.
  326. * One obvious solution it to make yy_act a global. I tried that, and saw
  327. * a 5% performance hit in a non-yylineno scanner, because yy_act is
  328. * normally declared as a register variable-- so it is not worth it.
  329. */
  330. #define YY_LESS_LINENO(n) \
  331. do { \
  332. int yyl;\
  333. for ( yyl = n; yyl < yyleng; ++yyl )\
  334. if ( yytext[yyl] == '\n' )\
  335. --yylineno;\
  336. }while(0)
  337. #define YY_LINENO_REWIND_TO(dst) \
  338. do {\
  339. const char *p;\
  340. for ( p = yy_cp-1; p >= (dst); --p)\
  341. if ( *p == '\n' )\
  342. --yylineno;\
  343. }while(0)
  344. /* Return all but the first "n" matched characters back to the input stream. */
  345. #define yyless(n) \
  346. do \
  347. { \
  348. /* Undo effects of setting up yytext. */ \
  349. int yyless_macro_arg = (n); \
  350. YY_LESS_LINENO(yyless_macro_arg);\
  351. *yy_cp = yyg->yy_hold_char; \
  352. YY_RESTORE_YY_MORE_OFFSET \
  353. yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  354. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  355. } \
  356. while ( 0 )
  357. #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
  358. #ifndef YY_STRUCT_YY_BUFFER_STATE
  359. #define YY_STRUCT_YY_BUFFER_STATE
  360. struct yy_buffer_state
  361. {
  362. FILE *yy_input_file;
  363. char *yy_ch_buf; /* input buffer */
  364. char *yy_buf_pos; /* current position in input buffer */
  365. /* Size of input buffer in bytes, not including room for EOB
  366. * characters.
  367. */
  368. int yy_buf_size;
  369. /* Number of characters read into yy_ch_buf, not including EOB
  370. * characters.
  371. */
  372. int yy_n_chars;
  373. /* Whether we "own" the buffer - i.e., we know we created it,
  374. * and can realloc() it to grow it, and should free() it to
  375. * delete it.
  376. */
  377. int yy_is_our_buffer;
  378. /* Whether this is an "interactive" input source; if so, and
  379. * if we're using stdio for input, then we want to use getc()
  380. * instead of fread(), to make sure we stop fetching input after
  381. * each newline.
  382. */
  383. int yy_is_interactive;
  384. /* Whether we're considered to be at the beginning of a line.
  385. * If so, '^' rules will be active on the next match, otherwise
  386. * not.
  387. */
  388. int yy_at_bol;
  389. int yy_bs_lineno; /**< The line count. */
  390. int yy_bs_column; /**< The column count. */
  391. /* Whether to try to fill the input buffer when we reach the
  392. * end of it.
  393. */
  394. int yy_fill_buffer;
  395. int yy_buffer_status;
  396. #define YY_BUFFER_NEW 0
  397. #define YY_BUFFER_NORMAL 1
  398. /* When an EOF's been seen but there's still some text to process
  399. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  400. * shouldn't try reading from the input source any more. We might
  401. * still have a bunch of tokens to match, though, because of
  402. * possible backing-up.
  403. *
  404. * When we actually see the EOF, we change the status to "new"
  405. * (via yyrestart()), so that the user can continue scanning by
  406. * just pointing yyin at a new input file.
  407. */
  408. #define YY_BUFFER_EOF_PENDING 2
  409. };
  410. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  411. /* We provide macros for accessing buffer states in case in the
  412. * future we want to put the buffer states in a more general
  413. * "scanner state".
  414. *
  415. * Returns the top of the stack, or NULL.
  416. */
  417. #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
  418. ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
  419. : NULL)
  420. /* Same as previous macro, but useful when we know that the buffer stack is not
  421. * NULL or when we need an lvalue. For internal use only.
  422. */
  423. #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
  424. void yyrestart ( FILE *input_file , yyscan_t yyscanner );
  425. void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
  426. YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
  427. void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
  428. void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
  429. void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
  430. void yypop_buffer_state ( yyscan_t yyscanner );
  431. static void yyensure_buffer_stack ( yyscan_t yyscanner );
  432. static void yy_load_buffer_state ( yyscan_t yyscanner );
  433. static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
  434. #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
  435. YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
  436. YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
  437. YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
  438. void *yyalloc ( yy_size_t , yyscan_t yyscanner );
  439. void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
  440. void yyfree ( void * , yyscan_t yyscanner );
  441. #define yy_new_buffer yy_create_buffer
  442. #define yy_set_interactive(is_interactive) \
  443. { \
  444. if ( ! YY_CURRENT_BUFFER ){ \
  445. yyensure_buffer_stack (yyscanner); \
  446. YY_CURRENT_BUFFER_LVALUE = \
  447. yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
  448. } \
  449. YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  450. }
  451. #define yy_set_bol(at_bol) \
  452. { \
  453. if ( ! YY_CURRENT_BUFFER ){\
  454. yyensure_buffer_stack (yyscanner); \
  455. YY_CURRENT_BUFFER_LVALUE = \
  456. yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
  457. } \
  458. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  459. }
  460. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  461. /* Begin user sect3 */
  462. #define cmListFileLexer_yywrap(yyscanner) (/*CONSTCOND*/1)
  463. #define YY_SKIP_YYWRAP
  464. typedef flex_uint8_t YY_CHAR;
  465. typedef int yy_state_type;
  466. #define yytext_ptr yytext_r
  467. static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
  468. static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
  469. static int yy_get_next_buffer ( yyscan_t yyscanner );
  470. static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
  471. /* Done after the current pattern has been matched and before the
  472. * corresponding action - sets up yytext.
  473. */
  474. #define YY_DO_BEFORE_ACTION \
  475. yyg->yytext_ptr = yy_bp; \
  476. yyleng = (int) (yy_cp - yy_bp); \
  477. yyg->yy_hold_char = *yy_cp; \
  478. *yy_cp = '\0'; \
  479. yyg->yy_c_buf_p = yy_cp;
  480. #define YY_NUM_RULES 24
  481. #define YY_END_OF_BUFFER 25
  482. /* This struct is not used in this scanner,
  483. but its presence is necessary. */
  484. struct yy_trans_info
  485. {
  486. flex_int32_t yy_verify;
  487. flex_int32_t yy_nxt;
  488. };
  489. static const flex_int16_t yy_accept[81] =
  490. { 0,
  491. 0, 0, 0, 0, 0, 0, 0, 0, 4, 4,
  492. 25, 13, 22, 1, 16, 3, 13, 5, 6, 7,
  493. 15, 23, 23, 17, 19, 20, 21, 17, 10, 11,
  494. 8, 10, 12, 9, 24, 4, 13, 0, 13, 0,
  495. 22, 0, 0, 7, 13, 0, 13, 0, 2, 0,
  496. 13, 17, 0, 18, 10, 8, 4, 0, 14, 0,
  497. 0, 0, 0, 14, 0, 0, 14, 0, 0, 0,
  498. 2, 14, 0, 0, 0, 0, 0, 0, 0, 0
  499. } ;
  500. static const YY_CHAR yy_ec[256] =
  501. { 0,
  502. 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
  503. 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
  504. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  505. 1, 2, 1, 5, 6, 7, 1, 1, 1, 8,
  506. 9, 1, 1, 1, 1, 1, 1, 10, 10, 10,
  507. 10, 10, 10, 10, 10, 10, 10, 1, 1, 1,
  508. 11, 1, 1, 1, 12, 12, 12, 12, 12, 12,
  509. 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
  510. 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
  511. 13, 14, 15, 1, 12, 1, 12, 12, 12, 12,
  512. 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
  513. 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
  514. 12, 12, 1, 1, 1, 1, 1, 1, 1, 1,
  515. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  516. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  517. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  518. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  519. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  520. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  521. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  522. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  523. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  524. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  525. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  526. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  527. 1, 1, 1, 1, 1
  528. } ;
  529. static const YY_CHAR yy_meta[17] =
  530. { 0,
  531. 1, 1, 2, 3, 4, 3, 1, 3, 5, 6,
  532. 1, 6, 1, 1, 7, 8
  533. } ;
  534. static const flex_int16_t yy_base[99] =
  535. { 0,
  536. 0, 0, 14, 28, 42, 56, 70, 84, 18, 19,
  537. 69, 100, 16, 323, 323, 55, 59, 323, 323, 13,
  538. 115, 0, 323, 52, 323, 323, 21, 51, 0, 323,
  539. 53, 0, 323, 323, 323, 0, 0, 126, 55, 0,
  540. 25, 25, 53, 0, 0, 136, 53, 0, 57, 0,
  541. 0, 42, 50, 323, 0, 43, 0, 146, 160, 45,
  542. 172, 43, 26, 0, 42, 184, 0, 42, 195, 40,
  543. 323, 40, 0, 38, 37, 34, 32, 31, 23, 323,
  544. 211, 219, 227, 235, 243, 251, 259, 267, 274, 281,
  545. 285, 291, 298, 302, 304, 310, 314, 316
  546. } ;
  547. static const flex_int16_t yy_def[99] =
  548. { 0,
  549. 80, 1, 81, 81, 82, 82, 83, 83, 84, 84,
  550. 80, 80, 80, 80, 80, 80, 12, 80, 80, 12,
  551. 80, 85, 80, 86, 80, 80, 86, 86, 87, 80,
  552. 80, 87, 80, 80, 80, 88, 12, 89, 12, 90,
  553. 80, 80, 91, 20, 12, 92, 12, 21, 80, 93,
  554. 12, 86, 86, 80, 87, 80, 88, 89, 80, 58,
  555. 89, 94, 80, 59, 91, 92, 59, 66, 92, 95,
  556. 80, 59, 96, 97, 94, 98, 95, 97, 98, 0,
  557. 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
  558. 80, 80, 80, 80, 80, 80, 80, 80
  559. } ;
  560. static const flex_int16_t yy_nxt[340] =
  561. { 0,
  562. 12, 13, 14, 13, 15, 16, 17, 18, 19, 12,
  563. 12, 20, 21, 22, 12, 23, 25, 41, 26, 41,
  564. 14, 14, 44, 54, 44, 52, 41, 27, 41, 28,
  565. 25, 66, 26, 35, 35, 63, 63, 49, 49, 58,
  566. 67, 27, 66, 28, 30, 59, 58, 62, 67, 76,
  567. 64, 59, 74, 56, 52, 53, 31, 32, 30, 71,
  568. 70, 64, 62, 56, 53, 53, 43, 42, 80, 80,
  569. 31, 32, 30, 80, 80, 80, 80, 80, 80, 80,
  570. 80, 80, 80, 80, 34, 35, 30, 80, 80, 80,
  571. 80, 80, 80, 80, 80, 80, 80, 80, 34, 35,
  572. 37, 80, 80, 80, 38, 80, 39, 80, 80, 37,
  573. 37, 37, 37, 40, 37, 45, 80, 80, 80, 46,
  574. 80, 47, 80, 80, 45, 48, 45, 49, 50, 45,
  575. 59, 80, 60, 80, 80, 80, 80, 80, 80, 61,
  576. 67, 80, 68, 80, 80, 80, 80, 80, 80, 69,
  577. 59, 80, 60, 80, 80, 80, 80, 80, 80, 61,
  578. 59, 80, 80, 80, 38, 80, 72, 80, 80, 59,
  579. 59, 59, 59, 73, 59, 58, 80, 58, 80, 58,
  580. 58, 80, 80, 80, 80, 80, 80, 58, 67, 80,
  581. 68, 80, 80, 80, 80, 80, 80, 69, 66, 80,
  582. 66, 80, 66, 66, 80, 80, 80, 80, 80, 80,
  583. 66, 24, 24, 24, 24, 24, 24, 24, 24, 29,
  584. 29, 29, 29, 29, 29, 29, 29, 33, 33, 33,
  585. 33, 33, 33, 33, 33, 36, 36, 36, 36, 36,
  586. 36, 36, 36, 51, 80, 51, 51, 51, 51, 51,
  587. 51, 52, 80, 52, 80, 52, 52, 52, 52, 55,
  588. 80, 55, 55, 55, 55, 80, 55, 57, 80, 57,
  589. 57, 57, 57, 57, 58, 80, 80, 58, 80, 58,
  590. 58, 37, 80, 37, 37, 37, 37, 37, 37, 65,
  591. 65, 66, 80, 80, 66, 80, 66, 66, 45, 80,
  592. 45, 45, 45, 45, 45, 45, 75, 75, 77, 77,
  593. 59, 80, 59, 59, 59, 59, 59, 59, 78, 78,
  594. 79, 79, 11, 80, 80, 80, 80, 80, 80, 80,
  595. 80, 80, 80, 80, 80, 80, 80, 80, 80
  596. } ;
  597. static const flex_int16_t yy_chk[340] =
  598. { 0,
  599. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  600. 1, 1, 1, 1, 1, 1, 3, 13, 3, 13,
  601. 9, 10, 20, 27, 20, 27, 41, 3, 41, 3,
  602. 4, 79, 4, 9, 10, 42, 63, 42, 63, 78,
  603. 77, 4, 76, 4, 5, 75, 74, 72, 70, 68,
  604. 65, 62, 60, 56, 53, 52, 5, 5, 6, 49,
  605. 47, 43, 39, 31, 28, 24, 17, 16, 11, 0,
  606. 6, 6, 7, 0, 0, 0, 0, 0, 0, 0,
  607. 0, 0, 0, 0, 7, 7, 8, 0, 0, 0,
  608. 0, 0, 0, 0, 0, 0, 0, 0, 8, 8,
  609. 12, 0, 0, 0, 12, 0, 12, 0, 0, 12,
  610. 12, 12, 12, 12, 12, 21, 0, 0, 0, 21,
  611. 0, 21, 0, 0, 21, 21, 21, 21, 21, 21,
  612. 38, 0, 38, 0, 0, 0, 0, 0, 0, 38,
  613. 46, 0, 46, 0, 0, 0, 0, 0, 0, 46,
  614. 58, 0, 58, 0, 0, 0, 0, 0, 0, 58,
  615. 59, 0, 0, 0, 59, 0, 59, 0, 0, 59,
  616. 59, 59, 59, 59, 59, 61, 0, 61, 0, 61,
  617. 61, 0, 0, 0, 0, 0, 0, 61, 66, 0,
  618. 66, 0, 0, 0, 0, 0, 0, 66, 69, 0,
  619. 69, 0, 69, 69, 0, 0, 0, 0, 0, 0,
  620. 69, 81, 81, 81, 81, 81, 81, 81, 81, 82,
  621. 82, 82, 82, 82, 82, 82, 82, 83, 83, 83,
  622. 83, 83, 83, 83, 83, 84, 84, 84, 84, 84,
  623. 84, 84, 84, 85, 0, 85, 85, 85, 85, 85,
  624. 85, 86, 0, 86, 0, 86, 86, 86, 86, 87,
  625. 0, 87, 87, 87, 87, 0, 87, 88, 0, 88,
  626. 88, 88, 88, 88, 89, 0, 0, 89, 0, 89,
  627. 89, 90, 0, 90, 90, 90, 90, 90, 90, 91,
  628. 91, 92, 0, 0, 92, 0, 92, 92, 93, 0,
  629. 93, 93, 93, 93, 93, 93, 94, 94, 95, 95,
  630. 96, 0, 96, 96, 96, 96, 96, 96, 97, 97,
  631. 98, 98, 80, 80, 80, 80, 80, 80, 80, 80,
  632. 80, 80, 80, 80, 80, 80, 80, 80, 80
  633. } ;
  634. /* Table of booleans, true if rule could match eol. */
  635. static const flex_int32_t yy_rule_can_match_eol[25] =
  636. { 0,
  637. 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1,
  638. 0, 0, 0, 0, 0, };
  639. /* The intent behind this definition is that it'll catch
  640. * any uses of REJECT which flex missed.
  641. */
  642. #define REJECT reject_used_but_not_detected
  643. #define yymore() yymore_used_but_not_detected
  644. #define YY_MORE_ADJ 0
  645. #define YY_RESTORE_YY_MORE_OFFSET
  646. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  647. file Copyright.txt or https://cmake.org/licensing for details. */
  648. /*
  649. This file must be translated to C and modified to build everywhere.
  650. Run flex >= 2.6 like this:
  651. flex --nounistd -DFLEXINT_H --noline -ocmListFileLexer.c cmListFileLexer.in.l
  652. Modify cmListFileLexer.c:
  653. - remove trailing whitespace: sed -i 's/\s*$//' cmListFileLexer.c
  654. - remove blank lines at end of file: sed -i '${/^$/d;}' cmListFileLexer.c
  655. - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmListFileLexer.c
  656. */
  657. /* IWYU pragma: no_forward_declare yyguts_t */
  658. #ifdef WIN32
  659. #include "cmsys/Encoding.h"
  660. #endif
  661. /* Setup the proper cmListFileLexer_yylex declaration. */
  662. #define YY_EXTRA_TYPE cmListFileLexer*
  663. #define YY_DECL int cmListFileLexer_yylex (yyscan_t yyscanner, cmListFileLexer* lexer)
  664. #include "cmListFileLexer.h"
  665. /*--------------------------------------------------------------------------*/
  666. struct cmListFileLexer_s
  667. {
  668. cmListFileLexer_Token token;
  669. int bracket;
  670. int comment;
  671. int line;
  672. int column;
  673. int size;
  674. FILE* file;
  675. size_t cr;
  676. char* string_buffer;
  677. char* string_position;
  678. int string_left;
  679. yyscan_t scanner;
  680. };
  681. static void cmListFileLexerSetToken(cmListFileLexer* lexer, const char* text,
  682. int length);
  683. static void cmListFileLexerAppend(cmListFileLexer* lexer, const char* text,
  684. int length);
  685. static int cmListFileLexerInput(cmListFileLexer* lexer, char* buffer,
  686. size_t bufferSize);
  687. static void cmListFileLexerInit(cmListFileLexer* lexer);
  688. static void cmListFileLexerDestroy(cmListFileLexer* lexer);
  689. /* Replace the lexer input function. */
  690. #undef YY_INPUT
  691. #define YY_INPUT(buf, result, max_size) \
  692. { result = cmListFileLexerInput(cmListFileLexer_yyget_extra(yyscanner), buf, max_size); }
  693. /*--------------------------------------------------------------------------*/
  694. #define INITIAL 0
  695. #define STRING 1
  696. #define BRACKET 2
  697. #define BRACKETEND 3
  698. #define COMMENT 4
  699. #ifndef YY_EXTRA_TYPE
  700. #define YY_EXTRA_TYPE void *
  701. #endif
  702. /* Holds the entire state of the reentrant scanner. */
  703. struct yyguts_t
  704. {
  705. /* User-defined. Not touched by flex. */
  706. YY_EXTRA_TYPE yyextra_r;
  707. /* The rest are the same as the globals declared in the non-reentrant scanner. */
  708. FILE *yyin_r, *yyout_r;
  709. size_t yy_buffer_stack_top; /**< index of top of stack. */
  710. size_t yy_buffer_stack_max; /**< capacity of stack. */
  711. YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
  712. char yy_hold_char;
  713. int yy_n_chars;
  714. int yyleng_r;
  715. char *yy_c_buf_p;
  716. int yy_init;
  717. int yy_start;
  718. int yy_did_buffer_switch_on_eof;
  719. int yy_start_stack_ptr;
  720. int yy_start_stack_depth;
  721. int *yy_start_stack;
  722. yy_state_type yy_last_accepting_state;
  723. char* yy_last_accepting_cpos;
  724. int yylineno_r;
  725. int yy_flex_debug_r;
  726. char *yytext_r;
  727. int yy_more_flag;
  728. int yy_more_len;
  729. }; /* end struct yyguts_t */
  730. static int yy_init_globals ( yyscan_t yyscanner );
  731. int yylex_init (yyscan_t* scanner);
  732. int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
  733. /* Accessor methods to globals.
  734. These are made visible to non-reentrant scanners for convenience. */
  735. int yylex_destroy ( yyscan_t yyscanner );
  736. int yyget_debug ( yyscan_t yyscanner );
  737. void yyset_debug ( int debug_flag , yyscan_t yyscanner );
  738. YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
  739. void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
  740. FILE *yyget_in ( yyscan_t yyscanner );
  741. void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
  742. FILE *yyget_out ( yyscan_t yyscanner );
  743. void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
  744. int yyget_leng ( yyscan_t yyscanner );
  745. char *yyget_text ( yyscan_t yyscanner );
  746. int yyget_lineno ( yyscan_t yyscanner );
  747. void yyset_lineno ( int _line_number , yyscan_t yyscanner );
  748. int yyget_column ( yyscan_t yyscanner );
  749. void yyset_column ( int _column_no , yyscan_t yyscanner );
  750. /* Macros after this point can all be overridden by user definitions in
  751. * section 1.
  752. */
  753. #ifndef YY_SKIP_YYWRAP
  754. #ifdef __cplusplus
  755. extern "C" int yywrap ( yyscan_t yyscanner );
  756. #else
  757. extern int yywrap ( yyscan_t yyscanner );
  758. #endif
  759. #endif
  760. #ifndef YY_NO_UNPUT
  761. static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner);
  762. #endif
  763. #ifndef yytext_ptr
  764. static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
  765. #endif
  766. #ifdef YY_NEED_STRLEN
  767. static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
  768. #endif
  769. #ifndef YY_NO_INPUT
  770. #ifdef __cplusplus
  771. static int yyinput ( yyscan_t yyscanner );
  772. #else
  773. static int input ( yyscan_t yyscanner );
  774. #endif
  775. #endif
  776. /* Amount of stuff to slurp up with each read. */
  777. #ifndef YY_READ_BUF_SIZE
  778. #ifdef __ia64__
  779. /* On IA-64, the buffer size is 16k, not 8k */
  780. #define YY_READ_BUF_SIZE 16384
  781. #else
  782. #define YY_READ_BUF_SIZE 8192
  783. #endif /* __ia64__ */
  784. #endif
  785. /* Copy whatever the last rule matched to the standard output. */
  786. #ifndef ECHO
  787. /* This used to be an fputs(), but since the string might contain NUL's,
  788. * we now use fwrite().
  789. */
  790. #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
  791. #endif
  792. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  793. * is returned in "result".
  794. */
  795. #ifndef YY_INPUT
  796. #define YY_INPUT(buf,result,max_size) \
  797. if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  798. { \
  799. int c = '*'; \
  800. int n; \
  801. for ( n = 0; n < max_size && \
  802. (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  803. buf[n] = (char) c; \
  804. if ( c == '\n' ) \
  805. buf[n++] = (char) c; \
  806. if ( c == EOF && ferror( yyin ) ) \
  807. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  808. result = n; \
  809. } \
  810. else \
  811. { \
  812. errno=0; \
  813. while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
  814. { \
  815. if( errno != EINTR) \
  816. { \
  817. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  818. break; \
  819. } \
  820. errno=0; \
  821. clearerr(yyin); \
  822. } \
  823. }\
  824. \
  825. #endif
  826. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  827. * we don't want an extra ';' after the "return" because that will cause
  828. * some compilers to complain about unreachable statements.
  829. */
  830. #ifndef yyterminate
  831. #define yyterminate() return YY_NULL
  832. #endif
  833. /* Number of entries by which start-condition stack grows. */
  834. #ifndef YY_START_STACK_INCR
  835. #define YY_START_STACK_INCR 25
  836. #endif
  837. /* Report a fatal error. */
  838. #ifndef YY_FATAL_ERROR
  839. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
  840. #endif
  841. /* end tables serialization structures and prototypes */
  842. /* Default declaration of generated scanner - a define so the user can
  843. * easily add parameters.
  844. */
  845. #ifndef YY_DECL
  846. #define YY_DECL_IS_OURS 1
  847. extern int yylex (yyscan_t yyscanner);
  848. #define YY_DECL int yylex (yyscan_t yyscanner)
  849. #endif /* !YY_DECL */
  850. /* Code executed at the beginning of each rule, after yytext and yyleng
  851. * have been set up.
  852. */
  853. #ifndef YY_USER_ACTION
  854. #define YY_USER_ACTION
  855. #endif
  856. /* Code executed at the end of each rule. */
  857. #ifndef YY_BREAK
  858. #define YY_BREAK /*LINTED*/break;
  859. #endif
  860. #define YY_RULE_SETUP \
  861. YY_USER_ACTION
  862. /** The main scanner function which does all the work.
  863. */
  864. YY_DECL
  865. {
  866. yy_state_type yy_current_state;
  867. char *yy_cp, *yy_bp;
  868. int yy_act;
  869. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  870. if ( !yyg->yy_init )
  871. {
  872. yyg->yy_init = 1;
  873. #ifdef YY_USER_INIT
  874. YY_USER_INIT;
  875. #endif
  876. if ( ! yyg->yy_start )
  877. yyg->yy_start = 1; /* first start state */
  878. if ( ! yyin )
  879. yyin = stdin;
  880. if ( ! yyout )
  881. yyout = stdout;
  882. if ( ! YY_CURRENT_BUFFER ) {
  883. yyensure_buffer_stack (yyscanner);
  884. YY_CURRENT_BUFFER_LVALUE =
  885. yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
  886. }
  887. yy_load_buffer_state( yyscanner );
  888. }
  889. {
  890. while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
  891. {
  892. yy_cp = yyg->yy_c_buf_p;
  893. /* Support of yytext. */
  894. *yy_cp = yyg->yy_hold_char;
  895. /* yy_bp points to the position in yy_ch_buf of the start of
  896. * the current run.
  897. */
  898. yy_bp = yy_cp;
  899. yy_current_state = yyg->yy_start;
  900. yy_match:
  901. do
  902. {
  903. YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
  904. if ( yy_accept[yy_current_state] )
  905. {
  906. yyg->yy_last_accepting_state = yy_current_state;
  907. yyg->yy_last_accepting_cpos = yy_cp;
  908. }
  909. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  910. {
  911. yy_current_state = (int) yy_def[yy_current_state];
  912. if ( yy_current_state >= 81 )
  913. yy_c = yy_meta[yy_c];
  914. }
  915. yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  916. ++yy_cp;
  917. }
  918. while ( yy_base[yy_current_state] != 323 );
  919. yy_find_action:
  920. yy_act = yy_accept[yy_current_state];
  921. if ( yy_act == 0 )
  922. { /* have to back up */
  923. yy_cp = yyg->yy_last_accepting_cpos;
  924. yy_current_state = yyg->yy_last_accepting_state;
  925. yy_act = yy_accept[yy_current_state];
  926. }
  927. YY_DO_BEFORE_ACTION;
  928. if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
  929. {
  930. int yyl;
  931. for ( yyl = 0; yyl < yyleng; ++yyl )
  932. if ( yytext[yyl] == '\n' )
  933. do{ yylineno++;
  934. yycolumn=0;
  935. }while(0)
  936. ;
  937. }
  938. do_action: /* This label is used only to access EOF actions. */
  939. switch ( yy_act )
  940. { /* beginning of action switch */
  941. case 0: /* must back up */
  942. /* undo the effects of YY_DO_BEFORE_ACTION */
  943. *yy_cp = yyg->yy_hold_char;
  944. yy_cp = yyg->yy_last_accepting_cpos;
  945. yy_current_state = yyg->yy_last_accepting_state;
  946. goto yy_find_action;
  947. case 1:
  948. /* rule 1 can match eol */
  949. YY_RULE_SETUP
  950. {
  951. lexer->token.type = cmListFileLexer_Token_Newline;
  952. cmListFileLexerSetToken(lexer, yytext, yyleng);
  953. ++lexer->line;
  954. lexer->column = 1;
  955. BEGIN(INITIAL);
  956. return 1;
  957. }
  958. YY_BREAK
  959. case 2:
  960. /* rule 2 can match eol */
  961. YY_RULE_SETUP
  962. {
  963. const char* bracket = yytext;
  964. lexer->comment = yytext[0] == '#';
  965. if (lexer->comment) {
  966. lexer->token.type = cmListFileLexer_Token_CommentBracket;
  967. bracket += 1;
  968. } else {
  969. lexer->token.type = cmListFileLexer_Token_ArgumentBracket;
  970. }
  971. cmListFileLexerSetToken(lexer, "", 0);
  972. lexer->bracket = strchr(bracket+1, '[') - bracket;
  973. if (yytext[yyleng-1] == '\n') {
  974. ++lexer->line;
  975. lexer->column = 1;
  976. } else {
  977. lexer->column += yyleng;
  978. }
  979. BEGIN(BRACKET);
  980. }
  981. YY_BREAK
  982. case 3:
  983. YY_RULE_SETUP
  984. {
  985. lexer->column += yyleng;
  986. BEGIN(COMMENT);
  987. }
  988. YY_BREAK
  989. case 4:
  990. YY_RULE_SETUP
  991. {
  992. lexer->column += yyleng;
  993. }
  994. YY_BREAK
  995. case 5:
  996. YY_RULE_SETUP
  997. {
  998. lexer->token.type = cmListFileLexer_Token_ParenLeft;
  999. cmListFileLexerSetToken(lexer, yytext, yyleng);
  1000. lexer->column += yyleng;
  1001. return 1;
  1002. }
  1003. YY_BREAK
  1004. case 6:
  1005. YY_RULE_SETUP
  1006. {
  1007. lexer->token.type = cmListFileLexer_Token_ParenRight;
  1008. cmListFileLexerSetToken(lexer, yytext, yyleng);
  1009. lexer->column += yyleng;
  1010. return 1;
  1011. }
  1012. YY_BREAK
  1013. case 7:
  1014. YY_RULE_SETUP
  1015. {
  1016. lexer->token.type = cmListFileLexer_Token_Identifier;
  1017. cmListFileLexerSetToken(lexer, yytext, yyleng);
  1018. lexer->column += yyleng;
  1019. return 1;
  1020. }
  1021. YY_BREAK
  1022. case 8:
  1023. YY_RULE_SETUP
  1024. {
  1025. /* Handle ]]====]=======]*/
  1026. cmListFileLexerAppend(lexer, yytext, yyleng);
  1027. lexer->column += yyleng;
  1028. if (yyleng == lexer->bracket) {
  1029. BEGIN(BRACKETEND);
  1030. }
  1031. }
  1032. YY_BREAK
  1033. case 9:
  1034. YY_RULE_SETUP
  1035. {
  1036. lexer->column += yyleng;
  1037. /* Erase the partial bracket from the token. */
  1038. lexer->token.length -= lexer->bracket;
  1039. lexer->token.text[lexer->token.length] = 0;
  1040. BEGIN(INITIAL);
  1041. return 1;
  1042. }
  1043. YY_BREAK
  1044. case 10:
  1045. YY_RULE_SETUP
  1046. {
  1047. cmListFileLexerAppend(lexer, yytext, yyleng);
  1048. lexer->column += yyleng;
  1049. }
  1050. YY_BREAK
  1051. case 11:
  1052. /* rule 11 can match eol */
  1053. YY_RULE_SETUP
  1054. {
  1055. cmListFileLexerAppend(lexer, yytext, yyleng);
  1056. ++lexer->line;
  1057. lexer->column = 1;
  1058. BEGIN(BRACKET);
  1059. }
  1060. YY_BREAK
  1061. case 12:
  1062. YY_RULE_SETUP
  1063. {
  1064. cmListFileLexerAppend(lexer, yytext, yyleng);
  1065. lexer->column += yyleng;
  1066. BEGIN(BRACKET);
  1067. }
  1068. YY_BREAK
  1069. case YY_STATE_EOF(BRACKET):
  1070. case YY_STATE_EOF(BRACKETEND):
  1071. {
  1072. lexer->token.type = cmListFileLexer_Token_BadBracket;
  1073. BEGIN(INITIAL);
  1074. return 1;
  1075. }
  1076. YY_BREAK
  1077. case 13:
  1078. YY_RULE_SETUP
  1079. {
  1080. lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted;
  1081. cmListFileLexerSetToken(lexer, yytext, yyleng);
  1082. lexer->column += yyleng;
  1083. return 1;
  1084. }
  1085. YY_BREAK
  1086. case 14:
  1087. YY_RULE_SETUP
  1088. {
  1089. lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted;
  1090. cmListFileLexerSetToken(lexer, yytext, yyleng);
  1091. lexer->column += yyleng;
  1092. return 1;
  1093. }
  1094. YY_BREAK
  1095. case 15:
  1096. YY_RULE_SETUP
  1097. {
  1098. lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted;
  1099. cmListFileLexerSetToken(lexer, yytext, yyleng);
  1100. lexer->column += yyleng;
  1101. return 1;
  1102. }
  1103. YY_BREAK
  1104. case 16:
  1105. YY_RULE_SETUP
  1106. {
  1107. lexer->token.type = cmListFileLexer_Token_ArgumentQuoted;
  1108. cmListFileLexerSetToken(lexer, "", 0);
  1109. lexer->column += yyleng;
  1110. BEGIN(STRING);
  1111. }
  1112. YY_BREAK
  1113. case 17:
  1114. YY_RULE_SETUP
  1115. {
  1116. cmListFileLexerAppend(lexer, yytext, yyleng);
  1117. lexer->column += yyleng;
  1118. }
  1119. YY_BREAK
  1120. case 18:
  1121. /* rule 18 can match eol */
  1122. YY_RULE_SETUP
  1123. {
  1124. /* Continuation: text is not part of string */
  1125. ++lexer->line;
  1126. lexer->column = 1;
  1127. }
  1128. YY_BREAK
  1129. case 19:
  1130. /* rule 19 can match eol */
  1131. YY_RULE_SETUP
  1132. {
  1133. cmListFileLexerAppend(lexer, yytext, yyleng);
  1134. ++lexer->line;
  1135. lexer->column = 1;
  1136. }
  1137. YY_BREAK
  1138. case 20:
  1139. YY_RULE_SETUP
  1140. {
  1141. lexer->column += yyleng;
  1142. BEGIN(INITIAL);
  1143. return 1;
  1144. }
  1145. YY_BREAK
  1146. case 21:
  1147. YY_RULE_SETUP
  1148. {
  1149. cmListFileLexerAppend(lexer, yytext, yyleng);
  1150. lexer->column += yyleng;
  1151. }
  1152. YY_BREAK
  1153. case YY_STATE_EOF(STRING):
  1154. {
  1155. lexer->token.type = cmListFileLexer_Token_BadString;
  1156. BEGIN(INITIAL);
  1157. return 1;
  1158. }
  1159. YY_BREAK
  1160. case 22:
  1161. YY_RULE_SETUP
  1162. {
  1163. lexer->token.type = cmListFileLexer_Token_Space;
  1164. cmListFileLexerSetToken(lexer, yytext, yyleng);
  1165. lexer->column += yyleng;
  1166. return 1;
  1167. }
  1168. YY_BREAK
  1169. case 23:
  1170. YY_RULE_SETUP
  1171. {
  1172. lexer->token.type = cmListFileLexer_Token_BadCharacter;
  1173. cmListFileLexerSetToken(lexer, yytext, yyleng);
  1174. lexer->column += yyleng;
  1175. return 1;
  1176. }
  1177. YY_BREAK
  1178. case YY_STATE_EOF(INITIAL):
  1179. case YY_STATE_EOF(COMMENT):
  1180. {
  1181. lexer->token.type = cmListFileLexer_Token_None;
  1182. cmListFileLexerSetToken(lexer, 0, 0);
  1183. return 0;
  1184. }
  1185. YY_BREAK
  1186. case 24:
  1187. YY_RULE_SETUP
  1188. ECHO;
  1189. YY_BREAK
  1190. case YY_END_OF_BUFFER:
  1191. {
  1192. /* Amount of text matched not including the EOB char. */
  1193. int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
  1194. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  1195. *yy_cp = yyg->yy_hold_char;
  1196. YY_RESTORE_YY_MORE_OFFSET
  1197. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  1198. {
  1199. /* We're scanning a new file or input source. It's
  1200. * possible that this happened because the user
  1201. * just pointed yyin at a new source and called
  1202. * yylex(). If so, then we have to assure
  1203. * consistency between YY_CURRENT_BUFFER and our
  1204. * globals. Here is the right place to do so, because
  1205. * this is the first action (other than possibly a
  1206. * back-up) that will match for the new input source.
  1207. */
  1208. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1209. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  1210. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  1211. }
  1212. /* Note that here we test for yy_c_buf_p "<=" to the position
  1213. * of the first EOB in the buffer, since yy_c_buf_p will
  1214. * already have been incremented past the NUL character
  1215. * (since all states make transitions on EOB to the
  1216. * end-of-buffer state). Contrast this with the test
  1217. * in input().
  1218. */
  1219. if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  1220. { /* This was really a NUL. */
  1221. yy_state_type yy_next_state;
  1222. yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
  1223. yy_current_state = yy_get_previous_state( yyscanner );
  1224. /* Okay, we're now positioned to make the NUL
  1225. * transition. We couldn't have
  1226. * yy_get_previous_state() go ahead and do it
  1227. * for us because it doesn't know how to deal
  1228. * with the possibility of jamming (and we don't
  1229. * want to build jamming into it because then it
  1230. * will run more slowly).
  1231. */
  1232. yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
  1233. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  1234. if ( yy_next_state )
  1235. {
  1236. /* Consume the NUL. */
  1237. yy_cp = ++yyg->yy_c_buf_p;
  1238. yy_current_state = yy_next_state;
  1239. goto yy_match;
  1240. }
  1241. else
  1242. {
  1243. yy_cp = yyg->yy_c_buf_p;
  1244. goto yy_find_action;
  1245. }
  1246. }
  1247. else switch ( yy_get_next_buffer( yyscanner ) )
  1248. {
  1249. case EOB_ACT_END_OF_FILE:
  1250. {
  1251. yyg->yy_did_buffer_switch_on_eof = 0;
  1252. if ( yywrap( yyscanner ) )
  1253. {
  1254. /* Note: because we've taken care in
  1255. * yy_get_next_buffer() to have set up
  1256. * yytext, we can now set up
  1257. * yy_c_buf_p so that if some total
  1258. * hoser (like flex itself) wants to
  1259. * call the scanner after we return the
  1260. * YY_NULL, it'll still work - another
  1261. * YY_NULL will get returned.
  1262. */
  1263. yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
  1264. yy_act = YY_STATE_EOF(YY_START);
  1265. goto do_action;
  1266. }
  1267. else
  1268. {
  1269. if ( ! yyg->yy_did_buffer_switch_on_eof )
  1270. YY_NEW_FILE;
  1271. }
  1272. break;
  1273. }
  1274. case EOB_ACT_CONTINUE_SCAN:
  1275. yyg->yy_c_buf_p =
  1276. yyg->yytext_ptr + yy_amount_of_matched_text;
  1277. yy_current_state = yy_get_previous_state( yyscanner );
  1278. yy_cp = yyg->yy_c_buf_p;
  1279. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  1280. goto yy_match;
  1281. case EOB_ACT_LAST_MATCH:
  1282. yyg->yy_c_buf_p =
  1283. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
  1284. yy_current_state = yy_get_previous_state( yyscanner );
  1285. yy_cp = yyg->yy_c_buf_p;
  1286. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  1287. goto yy_find_action;
  1288. }
  1289. break;
  1290. }
  1291. default:
  1292. YY_FATAL_ERROR(
  1293. "fatal flex scanner internal error--no action found" );
  1294. } /* end of action switch */
  1295. } /* end of scanning one token */
  1296. } /* end of user's declarations */
  1297. } /* end of yylex */
  1298. /* yy_get_next_buffer - try to read in a new buffer
  1299. *
  1300. * Returns a code representing an action:
  1301. * EOB_ACT_LAST_MATCH -
  1302. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  1303. * EOB_ACT_END_OF_FILE - end of file
  1304. */
  1305. static int yy_get_next_buffer (yyscan_t yyscanner)
  1306. {
  1307. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1308. char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  1309. char *source = yyg->yytext_ptr;
  1310. int number_to_move, i;
  1311. int ret_val;
  1312. if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
  1313. YY_FATAL_ERROR(
  1314. "fatal flex scanner internal error--end of buffer missed" );
  1315. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  1316. { /* Don't try to fill the buffer, so this is an EOF. */
  1317. if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
  1318. {
  1319. /* We matched a single character, the EOB, so
  1320. * treat this as a final EOF.
  1321. */
  1322. return EOB_ACT_END_OF_FILE;
  1323. }
  1324. else
  1325. {
  1326. /* We matched some text prior to the EOB, first
  1327. * process it.
  1328. */
  1329. return EOB_ACT_LAST_MATCH;
  1330. }
  1331. }
  1332. /* Try to read more data. */
  1333. /* First move last chars to start of buffer. */
  1334. number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
  1335. for ( i = 0; i < number_to_move; ++i )
  1336. *(dest++) = *(source++);
  1337. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  1338. /* don't do the read, it's not guaranteed to return an EOF,
  1339. * just force an EOF
  1340. */
  1341. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
  1342. else
  1343. {
  1344. int num_to_read =
  1345. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  1346. while ( num_to_read <= 0 )
  1347. { /* Not enough room in the buffer - grow it. */
  1348. /* just a shorter name for the current buffer */
  1349. YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
  1350. int yy_c_buf_p_offset =
  1351. (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
  1352. if ( b->yy_is_our_buffer )
  1353. {
  1354. int new_size = b->yy_buf_size * 2;
  1355. if ( new_size <= 0 )
  1356. b->yy_buf_size += b->yy_buf_size / 8;
  1357. else
  1358. b->yy_buf_size *= 2;
  1359. b->yy_ch_buf = (char *)
  1360. /* Include room in for 2 EOB chars. */
  1361. yyrealloc( (void *) b->yy_ch_buf,
  1362. (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
  1363. }
  1364. else
  1365. /* Can't grow it, we don't own it. */
  1366. b->yy_ch_buf = NULL;
  1367. if ( ! b->yy_ch_buf )
  1368. YY_FATAL_ERROR(
  1369. "fatal error - scanner input buffer overflow" );
  1370. yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  1371. num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  1372. number_to_move - 1;
  1373. }
  1374. if ( num_to_read > YY_READ_BUF_SIZE )
  1375. num_to_read = YY_READ_BUF_SIZE;
  1376. /* Read in more data. */
  1377. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  1378. yyg->yy_n_chars, num_to_read );
  1379. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1380. }
  1381. if ( yyg->yy_n_chars == 0 )
  1382. {
  1383. if ( number_to_move == YY_MORE_ADJ )
  1384. {
  1385. ret_val = EOB_ACT_END_OF_FILE;
  1386. yyrestart( yyin , yyscanner);
  1387. }
  1388. else
  1389. {
  1390. ret_val = EOB_ACT_LAST_MATCH;
  1391. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  1392. YY_BUFFER_EOF_PENDING;
  1393. }
  1394. }
  1395. else
  1396. ret_val = EOB_ACT_CONTINUE_SCAN;
  1397. if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
  1398. /* Extend the array by 50%, plus the number we really need. */
  1399. int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
  1400. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
  1401. (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
  1402. if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1403. YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
  1404. /* "- 2" to take care of EOB's */
  1405. YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
  1406. }
  1407. yyg->yy_n_chars += number_to_move;
  1408. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  1409. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  1410. yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  1411. return ret_val;
  1412. }
  1413. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1414. static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
  1415. {
  1416. yy_state_type yy_current_state;
  1417. char *yy_cp;
  1418. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1419. yy_current_state = yyg->yy_start;
  1420. for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
  1421. {
  1422. YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 16);
  1423. if ( yy_accept[yy_current_state] )
  1424. {
  1425. yyg->yy_last_accepting_state = yy_current_state;
  1426. yyg->yy_last_accepting_cpos = yy_cp;
  1427. }
  1428. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1429. {
  1430. yy_current_state = (int) yy_def[yy_current_state];
  1431. if ( yy_current_state >= 81 )
  1432. yy_c = yy_meta[yy_c];
  1433. }
  1434. yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  1435. }
  1436. return yy_current_state;
  1437. }
  1438. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1439. *
  1440. * synopsis
  1441. * next_state = yy_try_NUL_trans( current_state );
  1442. */
  1443. static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
  1444. {
  1445. int yy_is_jam;
  1446. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
  1447. char *yy_cp = yyg->yy_c_buf_p;
  1448. YY_CHAR yy_c = 16;
  1449. if ( yy_accept[yy_current_state] )
  1450. {
  1451. yyg->yy_last_accepting_state = yy_current_state;
  1452. yyg->yy_last_accepting_cpos = yy_cp;
  1453. }
  1454. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1455. {
  1456. yy_current_state = (int) yy_def[yy_current_state];
  1457. if ( yy_current_state >= 81 )
  1458. yy_c = yy_meta[yy_c];
  1459. }
  1460. yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  1461. yy_is_jam = (yy_current_state == 80);
  1462. (void)yyg;
  1463. return yy_is_jam ? 0 : yy_current_state;
  1464. }
  1465. #ifndef YY_NO_UNPUT
  1466. static void yyunput (int c, char * yy_bp , yyscan_t yyscanner)
  1467. {
  1468. char *yy_cp;
  1469. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1470. yy_cp = yyg->yy_c_buf_p;
  1471. /* undo effects of setting up yytext */
  1472. *yy_cp = yyg->yy_hold_char;
  1473. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1474. { /* need to shift things up to make room */
  1475. /* +2 for EOB chars. */
  1476. int number_to_move = yyg->yy_n_chars + 2;
  1477. char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
  1478. YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
  1479. char *source =
  1480. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
  1481. while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1482. *--dest = *--source;
  1483. yy_cp += (int) (dest - source);
  1484. yy_bp += (int) (dest - source);
  1485. YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
  1486. yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
  1487. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1488. YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1489. }
  1490. *--yy_cp = (char) c;
  1491. if ( c == '\n' ){
  1492. --yylineno;
  1493. }
  1494. yyg->yytext_ptr = yy_bp;
  1495. yyg->yy_hold_char = *yy_cp;
  1496. yyg->yy_c_buf_p = yy_cp;
  1497. }
  1498. #endif
  1499. #ifndef YY_NO_INPUT
  1500. #ifdef __cplusplus
  1501. static int yyinput (yyscan_t yyscanner)
  1502. #else
  1503. static int input (yyscan_t yyscanner)
  1504. #endif
  1505. {
  1506. int c;
  1507. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1508. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1509. if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1510. {
  1511. /* yy_c_buf_p now points to the character we want to return.
  1512. * If this occurs *before* the EOB characters, then it's a
  1513. * valid NUL; if not, then we've hit the end of the buffer.
  1514. */
  1515. if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  1516. /* This was really a NUL. */
  1517. *yyg->yy_c_buf_p = '\0';
  1518. else
  1519. { /* need more input */
  1520. int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
  1521. ++yyg->yy_c_buf_p;
  1522. switch ( yy_get_next_buffer( yyscanner ) )
  1523. {
  1524. case EOB_ACT_LAST_MATCH:
  1525. /* This happens because yy_g_n_b()
  1526. * sees that we've accumulated a
  1527. * token and flags that we need to
  1528. * try matching the token before
  1529. * proceeding. But for input(),
  1530. * there's no matching to consider.
  1531. * So convert the EOB_ACT_LAST_MATCH
  1532. * to EOB_ACT_END_OF_FILE.
  1533. */
  1534. /* Reset buffer status. */
  1535. yyrestart( yyin , yyscanner);
  1536. /*FALLTHROUGH*/
  1537. case EOB_ACT_END_OF_FILE:
  1538. {
  1539. if ( yywrap( yyscanner ) )
  1540. return 0;
  1541. if ( ! yyg->yy_did_buffer_switch_on_eof )
  1542. YY_NEW_FILE;
  1543. #ifdef __cplusplus
  1544. return yyinput(yyscanner);
  1545. #else
  1546. return input(yyscanner);
  1547. #endif
  1548. }
  1549. case EOB_ACT_CONTINUE_SCAN:
  1550. yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
  1551. break;
  1552. }
  1553. }
  1554. }
  1555. c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
  1556. *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
  1557. yyg->yy_hold_char = *++yyg->yy_c_buf_p;
  1558. if ( c == '\n' )
  1559. do{ yylineno++;
  1560. yycolumn=0;
  1561. }while(0)
  1562. ;
  1563. return c;
  1564. }
  1565. #endif /* ifndef YY_NO_INPUT */
  1566. /** Immediately switch to a different input stream.
  1567. * @param input_file A readable stream.
  1568. * @param yyscanner The scanner object.
  1569. * @note This function does not reset the start condition to @c INITIAL .
  1570. */
  1571. void yyrestart (FILE * input_file , yyscan_t yyscanner)
  1572. {
  1573. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1574. if ( ! YY_CURRENT_BUFFER ){
  1575. yyensure_buffer_stack (yyscanner);
  1576. YY_CURRENT_BUFFER_LVALUE =
  1577. yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
  1578. }
  1579. yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
  1580. yy_load_buffer_state( yyscanner );
  1581. }
  1582. /** Switch to a different input buffer.
  1583. * @param new_buffer The new input buffer.
  1584. * @param yyscanner The scanner object.
  1585. */
  1586. void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  1587. {
  1588. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1589. /* TODO. We should be able to replace this entire function body
  1590. * with
  1591. * yypop_buffer_state();
  1592. * yypush_buffer_state(new_buffer);
  1593. */
  1594. yyensure_buffer_stack (yyscanner);
  1595. if ( YY_CURRENT_BUFFER == new_buffer )
  1596. return;
  1597. if ( YY_CURRENT_BUFFER )
  1598. {
  1599. /* Flush out information for old buffer. */
  1600. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1601. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  1602. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1603. }
  1604. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1605. yy_load_buffer_state( yyscanner );
  1606. /* We don't actually know whether we did this switch during
  1607. * EOF (yywrap()) processing, but the only time this flag
  1608. * is looked at is after yywrap() is called, so it's safe
  1609. * to go ahead and always set it.
  1610. */
  1611. yyg->yy_did_buffer_switch_on_eof = 1;
  1612. }
  1613. static void yy_load_buffer_state (yyscan_t yyscanner)
  1614. {
  1615. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1616. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1617. yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  1618. yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  1619. yyg->yy_hold_char = *yyg->yy_c_buf_p;
  1620. }
  1621. /** Allocate and initialize an input buffer state.
  1622. * @param file A readable stream.
  1623. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  1624. * @param yyscanner The scanner object.
  1625. * @return the allocated buffer state.
  1626. */
  1627. YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
  1628. {
  1629. YY_BUFFER_STATE b;
  1630. b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
  1631. if ( ! b )
  1632. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1633. b->yy_buf_size = size;
  1634. /* yy_ch_buf has to be 2 characters longer than the size given because
  1635. * we need to put in 2 end-of-buffer characters.
  1636. */
  1637. b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
  1638. if ( ! b->yy_ch_buf )
  1639. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1640. b->yy_is_our_buffer = 1;
  1641. yy_init_buffer( b, file , yyscanner);
  1642. return b;
  1643. }
  1644. /** Destroy the buffer.
  1645. * @param b a buffer created with yy_create_buffer()
  1646. * @param yyscanner The scanner object.
  1647. */
  1648. void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  1649. {
  1650. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1651. if ( ! b )
  1652. return;
  1653. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  1654. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  1655. if ( b->yy_is_our_buffer )
  1656. yyfree( (void *) b->yy_ch_buf , yyscanner );
  1657. yyfree( (void *) b , yyscanner );
  1658. }
  1659. /* Initializes or reinitializes a buffer.
  1660. * This function is sometimes called more than once on the same buffer,
  1661. * such as during a yyrestart() or at EOF.
  1662. */
  1663. static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
  1664. {
  1665. int oerrno = errno;
  1666. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1667. yy_flush_buffer( b , yyscanner);
  1668. b->yy_input_file = file;
  1669. b->yy_fill_buffer = 1;
  1670. /* If b is the current buffer, then yy_init_buffer was _probably_
  1671. * called from yyrestart() or through yy_get_next_buffer.
  1672. * In that case, we don't want to reset the lineno or column.
  1673. */
  1674. if (b != YY_CURRENT_BUFFER){
  1675. b->yy_bs_lineno = 1;
  1676. b->yy_bs_column = 0;
  1677. }
  1678. b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1679. errno = oerrno;
  1680. }
  1681. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  1682. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  1683. * @param yyscanner The scanner object.
  1684. */
  1685. void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  1686. {
  1687. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1688. if ( ! b )
  1689. return;
  1690. b->yy_n_chars = 0;
  1691. /* We always need two end-of-buffer characters. The first causes
  1692. * a transition to the end-of-buffer state. The second causes
  1693. * a jam in that state.
  1694. */
  1695. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1696. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1697. b->yy_buf_pos = &b->yy_ch_buf[0];
  1698. b->yy_at_bol = 1;
  1699. b->yy_buffer_status = YY_BUFFER_NEW;
  1700. if ( b == YY_CURRENT_BUFFER )
  1701. yy_load_buffer_state( yyscanner );
  1702. }
  1703. /** Pushes the new state onto the stack. The new state becomes
  1704. * the current state. This function will allocate the stack
  1705. * if necessary.
  1706. * @param new_buffer The new state.
  1707. * @param yyscanner The scanner object.
  1708. */
  1709. void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  1710. {
  1711. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1712. if (new_buffer == NULL)
  1713. return;
  1714. yyensure_buffer_stack(yyscanner);
  1715. /* This block is copied from yy_switch_to_buffer. */
  1716. if ( YY_CURRENT_BUFFER )
  1717. {
  1718. /* Flush out information for old buffer. */
  1719. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1720. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  1721. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1722. }
  1723. /* Only push if top exists. Otherwise, replace top. */
  1724. if (YY_CURRENT_BUFFER)
  1725. yyg->yy_buffer_stack_top++;
  1726. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1727. /* copied from yy_switch_to_buffer. */
  1728. yy_load_buffer_state( yyscanner );
  1729. yyg->yy_did_buffer_switch_on_eof = 1;
  1730. }
  1731. /** Removes and deletes the top of the stack, if present.
  1732. * The next element becomes the new top.
  1733. * @param yyscanner The scanner object.
  1734. */
  1735. void yypop_buffer_state (yyscan_t yyscanner)
  1736. {
  1737. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1738. if (!YY_CURRENT_BUFFER)
  1739. return;
  1740. yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
  1741. YY_CURRENT_BUFFER_LVALUE = NULL;
  1742. if (yyg->yy_buffer_stack_top > 0)
  1743. --yyg->yy_buffer_stack_top;
  1744. if (YY_CURRENT_BUFFER) {
  1745. yy_load_buffer_state( yyscanner );
  1746. yyg->yy_did_buffer_switch_on_eof = 1;
  1747. }
  1748. }
  1749. /* Allocates the stack if it does not exist.
  1750. * Guarantees space for at least one push.
  1751. */
  1752. static void yyensure_buffer_stack (yyscan_t yyscanner)
  1753. {
  1754. yy_size_t num_to_alloc;
  1755. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1756. if (!yyg->yy_buffer_stack) {
  1757. /* First allocation is just for 2 elements, since we don't know if this
  1758. * scanner will even need a stack. We use 2 instead of 1 to avoid an
  1759. * immediate realloc on the next call.
  1760. */
  1761. num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
  1762. yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
  1763. (num_to_alloc * sizeof(struct yy_buffer_state*)
  1764. , yyscanner);
  1765. if ( ! yyg->yy_buffer_stack )
  1766. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1767. memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  1768. yyg->yy_buffer_stack_max = num_to_alloc;
  1769. yyg->yy_buffer_stack_top = 0;
  1770. return;
  1771. }
  1772. if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
  1773. /* Increase the buffer to prepare for a possible push. */
  1774. yy_size_t grow_size = 8 /* arbitrary grow size */;
  1775. num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
  1776. yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
  1777. (yyg->yy_buffer_stack,
  1778. num_to_alloc * sizeof(struct yy_buffer_state*)
  1779. , yyscanner);
  1780. if ( ! yyg->yy_buffer_stack )
  1781. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1782. /* zero only the new slots.*/
  1783. memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
  1784. yyg->yy_buffer_stack_max = num_to_alloc;
  1785. }
  1786. }
  1787. /** Setup the input buffer state to scan directly from a user-specified character buffer.
  1788. * @param base the character buffer
  1789. * @param size the size in bytes of the character buffer
  1790. * @param yyscanner The scanner object.
  1791. * @return the newly allocated buffer state object.
  1792. */
  1793. YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
  1794. {
  1795. YY_BUFFER_STATE b;
  1796. if ( size < 2 ||
  1797. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1798. base[size-1] != YY_END_OF_BUFFER_CHAR )
  1799. /* They forgot to leave room for the EOB's. */
  1800. return NULL;
  1801. b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
  1802. if ( ! b )
  1803. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  1804. b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
  1805. b->yy_buf_pos = b->yy_ch_buf = base;
  1806. b->yy_is_our_buffer = 0;
  1807. b->yy_input_file = NULL;
  1808. b->yy_n_chars = b->yy_buf_size;
  1809. b->yy_is_interactive = 0;
  1810. b->yy_at_bol = 1;
  1811. b->yy_fill_buffer = 0;
  1812. b->yy_buffer_status = YY_BUFFER_NEW;
  1813. yy_switch_to_buffer( b , yyscanner );
  1814. return b;
  1815. }
  1816. /** Setup the input buffer state to scan a string. The next call to yylex() will
  1817. * scan from a @e copy of @a str.
  1818. * @param yystr a NUL-terminated string to scan
  1819. * @param yyscanner The scanner object.
  1820. * @return the newly allocated buffer state object.
  1821. * @note If you want to scan bytes that may contain NUL values, then use
  1822. * yy_scan_bytes() instead.
  1823. */
  1824. YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
  1825. {
  1826. return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
  1827. }
  1828. /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  1829. * scan from a @e copy of @a bytes.
  1830. * @param yybytes the byte buffer to scan
  1831. * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  1832. * @param yyscanner The scanner object.
  1833. * @return the newly allocated buffer state object.
  1834. */
  1835. YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
  1836. {
  1837. YY_BUFFER_STATE b;
  1838. char *buf;
  1839. yy_size_t n;
  1840. int i;
  1841. /* Get memory for full buffer, including space for trailing EOB's. */
  1842. n = (yy_size_t) (_yybytes_len + 2);
  1843. buf = (char *) yyalloc( n , yyscanner );
  1844. if ( ! buf )
  1845. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  1846. for ( i = 0; i < _yybytes_len; ++i )
  1847. buf[i] = yybytes[i];
  1848. buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
  1849. b = yy_scan_buffer( buf, n , yyscanner);
  1850. if ( ! b )
  1851. YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  1852. /* It's okay to grow etc. this buffer, and we should throw it
  1853. * away when we're done.
  1854. */
  1855. b->yy_is_our_buffer = 1;
  1856. return b;
  1857. }
  1858. #ifndef YY_EXIT_FAILURE
  1859. #define YY_EXIT_FAILURE 2
  1860. #endif
  1861. static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
  1862. {
  1863. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1864. (void)yyg;
  1865. fprintf( stderr, "%s\n", msg );
  1866. exit( YY_EXIT_FAILURE );
  1867. }
  1868. /* Redefine yyless() so it works in section 3 code. */
  1869. #undef yyless
  1870. #define yyless(n) \
  1871. do \
  1872. { \
  1873. /* Undo effects of setting up yytext. */ \
  1874. int yyless_macro_arg = (n); \
  1875. YY_LESS_LINENO(yyless_macro_arg);\
  1876. yytext[yyleng] = yyg->yy_hold_char; \
  1877. yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
  1878. yyg->yy_hold_char = *yyg->yy_c_buf_p; \
  1879. *yyg->yy_c_buf_p = '\0'; \
  1880. yyleng = yyless_macro_arg; \
  1881. } \
  1882. while ( 0 )
  1883. /* Accessor methods (get/set functions) to struct members. */
  1884. /** Get the user-defined data for this scanner.
  1885. * @param yyscanner The scanner object.
  1886. */
  1887. YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
  1888. {
  1889. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1890. return yyextra;
  1891. }
  1892. /** Get the current line number.
  1893. * @param yyscanner The scanner object.
  1894. */
  1895. int yyget_lineno (yyscan_t yyscanner)
  1896. {
  1897. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1898. if (! YY_CURRENT_BUFFER)
  1899. return 0;
  1900. return yylineno;
  1901. }
  1902. /** Get the current column number.
  1903. * @param yyscanner The scanner object.
  1904. */
  1905. int yyget_column (yyscan_t yyscanner)
  1906. {
  1907. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1908. if (! YY_CURRENT_BUFFER)
  1909. return 0;
  1910. return yycolumn;
  1911. }
  1912. /** Get the input stream.
  1913. * @param yyscanner The scanner object.
  1914. */
  1915. FILE *yyget_in (yyscan_t yyscanner)
  1916. {
  1917. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1918. return yyin;
  1919. }
  1920. /** Get the output stream.
  1921. * @param yyscanner The scanner object.
  1922. */
  1923. FILE *yyget_out (yyscan_t yyscanner)
  1924. {
  1925. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1926. return yyout;
  1927. }
  1928. /** Get the length of the current token.
  1929. * @param yyscanner The scanner object.
  1930. */
  1931. int yyget_leng (yyscan_t yyscanner)
  1932. {
  1933. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1934. return yyleng;
  1935. }
  1936. /** Get the current token.
  1937. * @param yyscanner The scanner object.
  1938. */
  1939. char *yyget_text (yyscan_t yyscanner)
  1940. {
  1941. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1942. return yytext;
  1943. }
  1944. /** Set the user-defined data. This data is never touched by the scanner.
  1945. * @param user_defined The data to be associated with this scanner.
  1946. * @param yyscanner The scanner object.
  1947. */
  1948. void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
  1949. {
  1950. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1951. yyextra = user_defined ;
  1952. }
  1953. /** Set the current line number.
  1954. * @param _line_number line number
  1955. * @param yyscanner The scanner object.
  1956. */
  1957. void yyset_lineno (int _line_number , yyscan_t yyscanner)
  1958. {
  1959. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1960. /* lineno is only valid if an input buffer exists. */
  1961. if (! YY_CURRENT_BUFFER )
  1962. YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
  1963. yylineno = _line_number;
  1964. }
  1965. /** Set the current column.
  1966. * @param _column_no column number
  1967. * @param yyscanner The scanner object.
  1968. */
  1969. void yyset_column (int _column_no , yyscan_t yyscanner)
  1970. {
  1971. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1972. /* column is only valid if an input buffer exists. */
  1973. if (! YY_CURRENT_BUFFER )
  1974. YY_FATAL_ERROR( "yyset_column called with no buffer" );
  1975. yycolumn = _column_no;
  1976. }
  1977. /** Set the input stream. This does not discard the current
  1978. * input buffer.
  1979. * @param _in_str A readable stream.
  1980. * @param yyscanner The scanner object.
  1981. * @see yy_switch_to_buffer
  1982. */
  1983. void yyset_in (FILE * _in_str , yyscan_t yyscanner)
  1984. {
  1985. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1986. yyin = _in_str ;
  1987. }
  1988. void yyset_out (FILE * _out_str , yyscan_t yyscanner)
  1989. {
  1990. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1991. yyout = _out_str ;
  1992. }
  1993. int yyget_debug (yyscan_t yyscanner)
  1994. {
  1995. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1996. return yy_flex_debug;
  1997. }
  1998. void yyset_debug (int _bdebug , yyscan_t yyscanner)
  1999. {
  2000. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2001. yy_flex_debug = _bdebug ;
  2002. }
  2003. /* Accessor methods for yylval and yylloc */
  2004. /* User-visible API */
  2005. /* yylex_init is special because it creates the scanner itself, so it is
  2006. * the ONLY reentrant function that doesn't take the scanner as the last argument.
  2007. * That's why we explicitly handle the declaration, instead of using our macros.
  2008. */
  2009. int yylex_init(yyscan_t* ptr_yy_globals)
  2010. {
  2011. if (ptr_yy_globals == NULL){
  2012. errno = EINVAL;
  2013. return 1;
  2014. }
  2015. *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
  2016. if (*ptr_yy_globals == NULL){
  2017. errno = ENOMEM;
  2018. return 1;
  2019. }
  2020. /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
  2021. memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  2022. return yy_init_globals ( *ptr_yy_globals );
  2023. }
  2024. /* yylex_init_extra has the same functionality as yylex_init, but follows the
  2025. * convention of taking the scanner as the last argument. Note however, that
  2026. * this is a *pointer* to a scanner, as it will be allocated by this call (and
  2027. * is the reason, too, why this function also must handle its own declaration).
  2028. * The user defined value in the first argument will be available to yyalloc in
  2029. * the yyextra field.
  2030. */
  2031. int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
  2032. {
  2033. struct yyguts_t dummy_yyguts;
  2034. yyset_extra (yy_user_defined, &dummy_yyguts);
  2035. if (ptr_yy_globals == NULL){
  2036. errno = EINVAL;
  2037. return 1;
  2038. }
  2039. *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
  2040. if (*ptr_yy_globals == NULL){
  2041. errno = ENOMEM;
  2042. return 1;
  2043. }
  2044. /* By setting to 0xAA, we expose bugs in
  2045. yy_init_globals. Leave at 0x00 for releases. */
  2046. memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  2047. yyset_extra (yy_user_defined, *ptr_yy_globals);
  2048. return yy_init_globals ( *ptr_yy_globals );
  2049. }
  2050. static int yy_init_globals (yyscan_t yyscanner)
  2051. {
  2052. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2053. /* Initialization is the same as for the non-reentrant scanner.
  2054. * This function is called from yylex_destroy(), so don't allocate here.
  2055. */
  2056. yyg->yy_buffer_stack = NULL;
  2057. yyg->yy_buffer_stack_top = 0;
  2058. yyg->yy_buffer_stack_max = 0;
  2059. yyg->yy_c_buf_p = NULL;
  2060. yyg->yy_init = 0;
  2061. yyg->yy_start = 0;
  2062. yyg->yy_start_stack_ptr = 0;
  2063. yyg->yy_start_stack_depth = 0;
  2064. yyg->yy_start_stack = NULL;
  2065. /* Defined in main.c */
  2066. #ifdef YY_STDINIT
  2067. yyin = stdin;
  2068. yyout = stdout;
  2069. #else
  2070. yyin = NULL;
  2071. yyout = NULL;
  2072. #endif
  2073. /* For future reference: Set errno on error, since we are called by
  2074. * yylex_init()
  2075. */
  2076. return 0;
  2077. }
  2078. /* yylex_destroy is for both reentrant and non-reentrant scanners. */
  2079. int yylex_destroy (yyscan_t yyscanner)
  2080. {
  2081. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2082. /* Pop the buffer stack, destroying each element. */
  2083. while(YY_CURRENT_BUFFER){
  2084. yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
  2085. YY_CURRENT_BUFFER_LVALUE = NULL;
  2086. yypop_buffer_state(yyscanner);
  2087. }
  2088. /* Destroy the stack itself. */
  2089. yyfree(yyg->yy_buffer_stack , yyscanner);
  2090. yyg->yy_buffer_stack = NULL;
  2091. /* Destroy the start condition stack. */
  2092. yyfree( yyg->yy_start_stack , yyscanner );
  2093. yyg->yy_start_stack = NULL;
  2094. /* Reset the globals. This is important in a non-reentrant scanner so the next time
  2095. * yylex() is called, initialization will occur. */
  2096. yy_init_globals( yyscanner);
  2097. /* Destroy the main struct (reentrant only). */
  2098. yyfree ( yyscanner , yyscanner );
  2099. yyscanner = NULL;
  2100. return 0;
  2101. }
  2102. /*
  2103. * Internal utility routines.
  2104. */
  2105. #ifndef yytext_ptr
  2106. static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
  2107. {
  2108. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2109. (void)yyg;
  2110. int i;
  2111. for ( i = 0; i < n; ++i )
  2112. s1[i] = s2[i];
  2113. }
  2114. #endif
  2115. #ifdef YY_NEED_STRLEN
  2116. static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
  2117. {
  2118. int n;
  2119. for ( n = 0; s[n]; ++n )
  2120. ;
  2121. return n;
  2122. }
  2123. #endif
  2124. void *yyalloc (yy_size_t size , yyscan_t yyscanner)
  2125. {
  2126. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2127. (void)yyg;
  2128. return malloc(size);
  2129. }
  2130. void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
  2131. {
  2132. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2133. (void)yyg;
  2134. /* The cast to (char *) in the following accommodates both
  2135. * implementations that use char* generic pointers, and those
  2136. * that use void* generic pointers. It works with the latter
  2137. * because both ANSI C and C++ allow castless assignment from
  2138. * any pointer type to void*, and deal with argument conversions
  2139. * as though doing an assignment.
  2140. */
  2141. return realloc(ptr, size);
  2142. }
  2143. void yyfree (void * ptr , yyscan_t yyscanner)
  2144. {
  2145. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2146. (void)yyg;
  2147. free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
  2148. }
  2149. #define YYTABLES_NAME "yytables"
  2150. /*--------------------------------------------------------------------------*/
  2151. static void cmListFileLexerSetToken(cmListFileLexer* lexer, const char* text,
  2152. int length)
  2153. {
  2154. /* Set the token line and column number. */
  2155. lexer->token.line = lexer->line;
  2156. lexer->token.column = lexer->column;
  2157. /* Use the same buffer if possible. */
  2158. if (lexer->token.text) {
  2159. if (text && length < lexer->size) {
  2160. strcpy(lexer->token.text, text);
  2161. lexer->token.length = length;
  2162. return;
  2163. }
  2164. free(lexer->token.text);
  2165. lexer->token.text = 0;
  2166. lexer->size = 0;
  2167. }
  2168. /* Need to extend the buffer. */
  2169. if (text) {
  2170. lexer->token.text = strdup(text);
  2171. lexer->token.length = length;
  2172. lexer->size = length + 1;
  2173. } else {
  2174. lexer->token.length = 0;
  2175. }
  2176. }
  2177. /*--------------------------------------------------------------------------*/
  2178. static void cmListFileLexerAppend(cmListFileLexer* lexer, const char* text,
  2179. int length)
  2180. {
  2181. char* temp;
  2182. int newSize;
  2183. /* If the appended text will fit in the buffer, do not reallocate. */
  2184. newSize = lexer->token.length + length + 1;
  2185. if (lexer->token.text && newSize <= lexer->size) {
  2186. strcpy(lexer->token.text + lexer->token.length, text);
  2187. lexer->token.length += length;
  2188. return;
  2189. }
  2190. /* We need to extend the buffer. */
  2191. temp = malloc(newSize);
  2192. if (lexer->token.text) {
  2193. memcpy(temp, lexer->token.text, lexer->token.length);
  2194. free(lexer->token.text);
  2195. }
  2196. memcpy(temp + lexer->token.length, text, length);
  2197. temp[lexer->token.length + length] = 0;
  2198. lexer->token.text = temp;
  2199. lexer->token.length += length;
  2200. lexer->size = newSize;
  2201. }
  2202. /*--------------------------------------------------------------------------*/
  2203. static int cmListFileLexerInput(cmListFileLexer* lexer, char* buffer,
  2204. size_t bufferSize)
  2205. {
  2206. if (lexer) {
  2207. if (lexer->file) {
  2208. /* Convert CRLF -> LF explicitly. The C FILE "t"ext mode
  2209. does not convert newlines on all platforms. Move any
  2210. trailing CR to the start of the buffer for the next read. */
  2211. size_t cr = lexer->cr;
  2212. size_t n;
  2213. buffer[0] = '\r';
  2214. n = fread(buffer + cr, 1, bufferSize - cr, lexer->file);
  2215. if (n) {
  2216. char* o = buffer;
  2217. const char* i = buffer;
  2218. const char* e;
  2219. n += cr;
  2220. cr = (buffer[n - 1] == '\r') ? 1 : 0;
  2221. e = buffer + n - cr;
  2222. while (i != e) {
  2223. if (i[0] == '\r' && i[1] == '\n') {
  2224. ++i;
  2225. }
  2226. *o++ = *i++;
  2227. }
  2228. n = o - buffer;
  2229. } else {
  2230. n = cr;
  2231. cr = 0;
  2232. }
  2233. lexer->cr = cr;
  2234. return n;
  2235. } else if (lexer->string_left) {
  2236. int length = lexer->string_left;
  2237. if ((int)bufferSize < length) {
  2238. length = (int)bufferSize;
  2239. }
  2240. memcpy(buffer, lexer->string_position, length);
  2241. lexer->string_position += length;
  2242. lexer->string_left -= length;
  2243. return length;
  2244. }
  2245. }
  2246. return 0;
  2247. }
  2248. /*--------------------------------------------------------------------------*/
  2249. static void cmListFileLexerInit(cmListFileLexer* lexer)
  2250. {
  2251. if (lexer->file || lexer->string_buffer) {
  2252. cmListFileLexer_yylex_init(&lexer->scanner);
  2253. cmListFileLexer_yyset_extra(lexer, lexer->scanner);
  2254. }
  2255. }
  2256. /*--------------------------------------------------------------------------*/
  2257. static void cmListFileLexerDestroy(cmListFileLexer* lexer)
  2258. {
  2259. cmListFileLexerSetToken(lexer, 0, 0);
  2260. if (lexer->file || lexer->string_buffer) {
  2261. cmListFileLexer_yylex_destroy(lexer->scanner);
  2262. if (lexer->file) {
  2263. fclose(lexer->file);
  2264. lexer->file = 0;
  2265. }
  2266. if (lexer->string_buffer) {
  2267. free(lexer->string_buffer);
  2268. lexer->string_buffer = 0;
  2269. lexer->string_left = 0;
  2270. lexer->string_position = 0;
  2271. }
  2272. }
  2273. }
  2274. /*--------------------------------------------------------------------------*/
  2275. cmListFileLexer* cmListFileLexer_New(void)
  2276. {
  2277. cmListFileLexer* lexer = (cmListFileLexer*)malloc(sizeof(cmListFileLexer));
  2278. if (!lexer) {
  2279. return 0;
  2280. }
  2281. memset(lexer, 0, sizeof(*lexer));
  2282. lexer->line = 1;
  2283. lexer->column = 1;
  2284. return lexer;
  2285. }
  2286. /*--------------------------------------------------------------------------*/
  2287. void cmListFileLexer_Delete(cmListFileLexer* lexer)
  2288. {
  2289. cmListFileLexer_SetFileName(lexer, 0, 0);
  2290. free(lexer);
  2291. }
  2292. /*--------------------------------------------------------------------------*/
  2293. static cmListFileLexer_BOM cmListFileLexer_ReadBOM(FILE* f)
  2294. {
  2295. unsigned char b[2];
  2296. if (fread(b, 1, 2, f) == 2) {
  2297. if (b[0] == 0xEF && b[1] == 0xBB) {
  2298. if (fread(b, 1, 1, f) == 1 && b[0] == 0xBF) {
  2299. return cmListFileLexer_BOM_UTF8;
  2300. }
  2301. } else if (b[0] == 0xFE && b[1] == 0xFF) {
  2302. /* UTF-16 BE */
  2303. return cmListFileLexer_BOM_UTF16BE;
  2304. } else if (b[0] == 0 && b[1] == 0) {
  2305. if (fread(b, 1, 2, f) == 2 && b[0] == 0xFE && b[1] == 0xFF) {
  2306. return cmListFileLexer_BOM_UTF32BE;
  2307. }
  2308. } else if (b[0] == 0xFF && b[1] == 0xFE) {
  2309. fpos_t p;
  2310. fgetpos(f, &p);
  2311. if (fread(b, 1, 2, f) == 2 && b[0] == 0 && b[1] == 0) {
  2312. return cmListFileLexer_BOM_UTF32LE;
  2313. }
  2314. if (fsetpos(f, &p) != 0) {
  2315. return cmListFileLexer_BOM_Broken;
  2316. }
  2317. return cmListFileLexer_BOM_UTF16LE;
  2318. }
  2319. }
  2320. if (fseek(f, 0, SEEK_SET) != 0) {
  2321. return cmListFileLexer_BOM_Broken;
  2322. }
  2323. return cmListFileLexer_BOM_None;
  2324. }
  2325. /*--------------------------------------------------------------------------*/
  2326. int cmListFileLexer_SetFileName(cmListFileLexer* lexer, const char* name,
  2327. cmListFileLexer_BOM* bom)
  2328. {
  2329. int result = 1;
  2330. cmListFileLexerDestroy(lexer);
  2331. if (name) {
  2332. #ifdef _WIN32
  2333. wchar_t* wname = cmsysEncoding_DupToWide(name);
  2334. lexer->file = _wfopen(wname, L"rb");
  2335. free(wname);
  2336. #else
  2337. lexer->file = fopen(name, "rb");
  2338. #endif
  2339. if (lexer->file) {
  2340. if (bom) {
  2341. *bom = cmListFileLexer_ReadBOM(lexer->file);
  2342. }
  2343. } else {
  2344. result = 0;
  2345. }
  2346. }
  2347. cmListFileLexerInit(lexer);
  2348. return result;
  2349. }
  2350. /*--------------------------------------------------------------------------*/
  2351. int cmListFileLexer_SetString(cmListFileLexer* lexer, const char* text)
  2352. {
  2353. int result = 1;
  2354. cmListFileLexerDestroy(lexer);
  2355. if (text) {
  2356. int length = (int)strlen(text);
  2357. lexer->string_buffer = (char*)malloc(length + 1);
  2358. if (lexer->string_buffer) {
  2359. strcpy(lexer->string_buffer, text);
  2360. lexer->string_position = lexer->string_buffer;
  2361. lexer->string_left = length;
  2362. } else {
  2363. result = 0;
  2364. }
  2365. }
  2366. cmListFileLexerInit(lexer);
  2367. return result;
  2368. }
  2369. /*--------------------------------------------------------------------------*/
  2370. cmListFileLexer_Token* cmListFileLexer_Scan(cmListFileLexer* lexer)
  2371. {
  2372. if (!lexer->file) {
  2373. return 0;
  2374. }
  2375. if (cmListFileLexer_yylex(lexer->scanner, lexer)) {
  2376. return &lexer->token;
  2377. } else {
  2378. cmListFileLexer_SetFileName(lexer, 0, 0);
  2379. return 0;
  2380. }
  2381. }
  2382. /*--------------------------------------------------------------------------*/
  2383. long cmListFileLexer_GetCurrentLine(cmListFileLexer* lexer)
  2384. {
  2385. if (lexer->file) {
  2386. return lexer->line;
  2387. } else {
  2388. return 0;
  2389. }
  2390. }
  2391. /*--------------------------------------------------------------------------*/
  2392. long cmListFileLexer_GetCurrentColumn(cmListFileLexer* lexer)
  2393. {
  2394. if (lexer->file) {
  2395. return lexer->column;
  2396. } else {
  2397. return 0;
  2398. }
  2399. }
  2400. /*--------------------------------------------------------------------------*/
  2401. const char* cmListFileLexer_GetTypeAsString(cmListFileLexer* lexer,
  2402. cmListFileLexer_Type type)
  2403. {
  2404. (void)lexer;
  2405. switch (type) {
  2406. case cmListFileLexer_Token_None:
  2407. return "nothing";
  2408. case cmListFileLexer_Token_Space:
  2409. return "space";
  2410. case cmListFileLexer_Token_Newline:
  2411. return "newline";
  2412. case cmListFileLexer_Token_Identifier:
  2413. return "identifier";
  2414. case cmListFileLexer_Token_ParenLeft:
  2415. return "left paren";
  2416. case cmListFileLexer_Token_ParenRight:
  2417. return "right paren";
  2418. case cmListFileLexer_Token_ArgumentUnquoted:
  2419. return "unquoted argument";
  2420. case cmListFileLexer_Token_ArgumentQuoted:
  2421. return "quoted argument";
  2422. case cmListFileLexer_Token_ArgumentBracket:
  2423. return "bracket argument";
  2424. case cmListFileLexer_Token_CommentBracket:
  2425. return "bracket comment";
  2426. case cmListFileLexer_Token_BadCharacter:
  2427. return "bad character";
  2428. case cmListFileLexer_Token_BadBracket:
  2429. return "unterminated bracket";
  2430. case cmListFileLexer_Token_BadString:
  2431. return "unterminated string";
  2432. }
  2433. return "unknown token";
  2434. }