zconf.lex.c_shipped 59 KB

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