1
0

zconf.lex.c_shipped 58 KB

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