cmListFileLexer.c 75 KB

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