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