lex.zconf.c_shipped 54 KB

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