zconf.lex.c_shipped 59 KB

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