lex.zconf.c_shipped 54 KB

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