zconf.lex.c_shipped 58 KB

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