lex.zconf.c_shipped 55 KB

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