lconf.c 58 KB

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