cmListFileLexer.c 75 KB

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