1
0

lex.zconf.c_shipped 58 KB

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