lex.zconf.c_shipped 57 KB

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