lex.zconf.c_shipped 55 KB

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