cmListFileLexer.c 75 KB

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