1
0

zconf.lex.c_shipped 57 KB

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