zconf.lex.c_shipped 59 KB

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