1
0

zconf.tab.c_shipped 77 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693
  1. /* A Bison parser, made by GNU Bison 2.5. */
  2. /* Bison implementation for Yacc-like parsers in C
  3. Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. /* As a special exception, you may create a larger work that contains
  15. part or all of the Bison parser skeleton and distribute that work
  16. under terms of your choice, so long as that work isn't itself a
  17. parser generator using the skeleton or a modified version thereof
  18. as a parser skeleton. Alternatively, if you modify or redistribute
  19. the parser skeleton itself, you may (at your option) remove this
  20. special exception, which will cause the skeleton and the resulting
  21. Bison output files to be licensed under the GNU General Public
  22. License without this special exception.
  23. This special exception was added by the Free Software Foundation in
  24. version 2.2 of Bison. */
  25. /* C LALR(1) parser skeleton written by Richard Stallman, by
  26. simplifying the original so-called "semantic" parser. */
  27. /* All symbols defined below should begin with yy or YY, to avoid
  28. infringing on user name space. This should be done even for local
  29. variables, as they might otherwise be expanded by user macros.
  30. There are some unavoidable exceptions within include files to
  31. define necessary library symbols; they are noted "INFRINGES ON
  32. USER NAME SPACE" below. */
  33. /* Identify Bison output. */
  34. #define YYBISON 1
  35. /* Bison version. */
  36. #define YYBISON_VERSION "2.5"
  37. /* Skeleton name. */
  38. #define YYSKELETON_NAME "yacc.c"
  39. /* Pure parsers. */
  40. #define YYPURE 0
  41. /* Push parsers. */
  42. #define YYPUSH 0
  43. /* Pull parsers. */
  44. #define YYPULL 1
  45. /* Using locations. */
  46. #define YYLSP_NEEDED 0
  47. /* Substitute the variable and function names. */
  48. #define yyparse zconfparse
  49. #define yylex zconflex
  50. #define yyerror zconferror
  51. #define yylval zconflval
  52. #define yychar zconfchar
  53. #define yydebug zconfdebug
  54. #define yynerrs zconfnerrs
  55. /* Copy the first part of user declarations. */
  56. /* Line 268 of yacc.c */
  57. #line 1 "zconf.y"
  58. /*
  59. * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
  60. * Released under the terms of the GNU GPL v2.0.
  61. */
  62. #include <ctype.h>
  63. #include <stdarg.h>
  64. #include <stdio.h>
  65. #include <stdlib.h>
  66. #include <string.h>
  67. #include <stdbool.h>
  68. #include "lkc.h"
  69. #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
  70. #define PRINTD 0x0001
  71. #define DEBUG_PARSE 0x0002
  72. int cdebug = PRINTD;
  73. extern int zconflex(void);
  74. static void zconfprint(const char *err, ...);
  75. static void zconf_error(const char *err, ...);
  76. static void zconferror(const char *err);
  77. static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
  78. struct symbol *symbol_hash[SYMBOL_HASHSIZE];
  79. static struct menu *current_menu, *current_entry;
  80. /* Line 268 of yacc.c */
  81. #line 114 "zconf.tab.c"
  82. /* Enabling traces. */
  83. #ifndef YYDEBUG
  84. # define YYDEBUG 1
  85. #endif
  86. /* Enabling verbose error messages. */
  87. #ifdef YYERROR_VERBOSE
  88. # undef YYERROR_VERBOSE
  89. # define YYERROR_VERBOSE 1
  90. #else
  91. # define YYERROR_VERBOSE 0
  92. #endif
  93. /* Enabling the token table. */
  94. #ifndef YYTOKEN_TABLE
  95. # define YYTOKEN_TABLE 0
  96. #endif
  97. /* Tokens. */
  98. #ifndef YYTOKENTYPE
  99. # define YYTOKENTYPE
  100. /* Put the tokens into the symbol table, so that GDB and other debuggers
  101. know about them. */
  102. enum yytokentype {
  103. T_MAINMENU = 258,
  104. T_MENU = 259,
  105. T_ENDMENU = 260,
  106. T_SOURCE = 261,
  107. T_CHOICE = 262,
  108. T_ENDCHOICE = 263,
  109. T_COMMENT = 264,
  110. T_CONFIG = 265,
  111. T_MENUCONFIG = 266,
  112. T_HELP = 267,
  113. T_HELPTEXT = 268,
  114. T_IF = 269,
  115. T_ENDIF = 270,
  116. T_DEPENDS = 271,
  117. T_OPTIONAL = 272,
  118. T_PROMPT = 273,
  119. T_TYPE = 274,
  120. T_DEFAULT = 275,
  121. T_SELECT = 276,
  122. T_RANGE = 277,
  123. T_VISIBLE = 278,
  124. T_OPTION = 279,
  125. T_ON = 280,
  126. T_WORD = 281,
  127. T_WORD_QUOTE = 282,
  128. T_UNEQUAL = 283,
  129. T_CLOSE_PAREN = 284,
  130. T_OPEN_PAREN = 285,
  131. T_EOL = 286,
  132. T_OR = 287,
  133. T_AND = 288,
  134. T_EQUAL = 289,
  135. T_NOT = 290
  136. };
  137. #endif
  138. #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  139. typedef union YYSTYPE
  140. {
  141. /* Line 293 of yacc.c */
  142. #line 37 "zconf.y"
  143. char *string;
  144. struct file *file;
  145. struct symbol *symbol;
  146. struct expr *expr;
  147. struct menu *menu;
  148. const struct kconf_id *id;
  149. /* Line 293 of yacc.c */
  150. #line 196 "zconf.tab.c"
  151. } YYSTYPE;
  152. # define YYSTYPE_IS_TRIVIAL 1
  153. # define yystype YYSTYPE /* obsolescent; will be withdrawn */
  154. # define YYSTYPE_IS_DECLARED 1
  155. #endif
  156. /* Copy the second part of user declarations. */
  157. /* Line 343 of yacc.c */
  158. #line 97 "zconf.y"
  159. /* Include zconf.hash.c here so it can see the token constants. */
  160. #include "zconf.hash.c"
  161. /* Line 343 of yacc.c */
  162. #line 214 "zconf.tab.c"
  163. #ifdef short
  164. # undef short
  165. #endif
  166. #ifdef YYTYPE_UINT8
  167. typedef YYTYPE_UINT8 yytype_uint8;
  168. #else
  169. typedef unsigned char yytype_uint8;
  170. #endif
  171. #ifdef YYTYPE_INT8
  172. typedef YYTYPE_INT8 yytype_int8;
  173. #elif (defined __STDC__ || defined __C99__FUNC__ \
  174. || defined __cplusplus || defined _MSC_VER)
  175. typedef signed char yytype_int8;
  176. #else
  177. typedef short int yytype_int8;
  178. #endif
  179. #ifdef YYTYPE_UINT16
  180. typedef YYTYPE_UINT16 yytype_uint16;
  181. #else
  182. typedef unsigned short int yytype_uint16;
  183. #endif
  184. #ifdef YYTYPE_INT16
  185. typedef YYTYPE_INT16 yytype_int16;
  186. #else
  187. typedef short int yytype_int16;
  188. #endif
  189. #ifndef YYSIZE_T
  190. # ifdef __SIZE_TYPE__
  191. # define YYSIZE_T __SIZE_TYPE__
  192. # elif defined size_t
  193. # define YYSIZE_T size_t
  194. # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
  195. || defined __cplusplus || defined _MSC_VER)
  196. # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  197. # define YYSIZE_T size_t
  198. # else
  199. # define YYSIZE_T unsigned int
  200. # endif
  201. #endif
  202. #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
  203. #ifndef YY_
  204. # if defined YYENABLE_NLS && YYENABLE_NLS
  205. # if ENABLE_NLS
  206. # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
  207. # define YY_(msgid) dgettext ("bison-runtime", msgid)
  208. # endif
  209. # endif
  210. # ifndef YY_
  211. # define YY_(msgid) msgid
  212. # endif
  213. #endif
  214. /* Suppress unused-variable warnings by "using" E. */
  215. #if ! defined lint || defined __GNUC__
  216. # define YYUSE(e) ((void) (e))
  217. #else
  218. # define YYUSE(e) /* empty */
  219. #endif
  220. /* Identity function, used to suppress warnings about constant conditions. */
  221. #ifndef lint
  222. # define YYID(n) (n)
  223. #else
  224. #if (defined __STDC__ || defined __C99__FUNC__ \
  225. || defined __cplusplus || defined _MSC_VER)
  226. static int
  227. YYID (int yyi)
  228. #else
  229. static int
  230. YYID (yyi)
  231. int yyi;
  232. #endif
  233. {
  234. return yyi;
  235. }
  236. #endif
  237. #if ! defined yyoverflow || YYERROR_VERBOSE
  238. /* The parser invokes alloca or malloc; define the necessary symbols. */
  239. # ifdef YYSTACK_USE_ALLOCA
  240. # if YYSTACK_USE_ALLOCA
  241. # ifdef __GNUC__
  242. # define YYSTACK_ALLOC __builtin_alloca
  243. # elif defined __BUILTIN_VA_ARG_INCR
  244. # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
  245. # elif defined _AIX
  246. # define YYSTACK_ALLOC __alloca
  247. # elif defined _MSC_VER
  248. # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
  249. # define alloca _alloca
  250. # else
  251. # define YYSTACK_ALLOC alloca
  252. # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
  253. || defined __cplusplus || defined _MSC_VER)
  254. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  255. # ifndef EXIT_SUCCESS
  256. # define EXIT_SUCCESS 0
  257. # endif
  258. # endif
  259. # endif
  260. # endif
  261. # endif
  262. # ifdef YYSTACK_ALLOC
  263. /* Pacify GCC's `empty if-body' warning. */
  264. # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
  265. # ifndef YYSTACK_ALLOC_MAXIMUM
  266. /* The OS might guarantee only one guard page at the bottom of the stack,
  267. and a page size can be as small as 4096 bytes. So we cannot safely
  268. invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
  269. to allow for a few compiler-allocated temporary stack slots. */
  270. # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
  271. # endif
  272. # else
  273. # define YYSTACK_ALLOC YYMALLOC
  274. # define YYSTACK_FREE YYFREE
  275. # ifndef YYSTACK_ALLOC_MAXIMUM
  276. # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
  277. # endif
  278. # if (defined __cplusplus && ! defined EXIT_SUCCESS \
  279. && ! ((defined YYMALLOC || defined malloc) \
  280. && (defined YYFREE || defined free)))
  281. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  282. # ifndef EXIT_SUCCESS
  283. # define EXIT_SUCCESS 0
  284. # endif
  285. # endif
  286. # ifndef YYMALLOC
  287. # define YYMALLOC malloc
  288. # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
  289. || defined __cplusplus || defined _MSC_VER)
  290. void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
  291. # endif
  292. # endif
  293. # ifndef YYFREE
  294. # define YYFREE free
  295. # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
  296. || defined __cplusplus || defined _MSC_VER)
  297. void free (void *); /* INFRINGES ON USER NAME SPACE */
  298. # endif
  299. # endif
  300. # endif
  301. #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
  302. #if (! defined yyoverflow \
  303. && (! defined __cplusplus \
  304. || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
  305. /* A type that is properly aligned for any stack member. */
  306. union yyalloc
  307. {
  308. yytype_int16 yyss_alloc;
  309. YYSTYPE yyvs_alloc;
  310. };
  311. /* The size of the maximum gap between one aligned stack and the next. */
  312. # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  313. /* The size of an array large to enough to hold all stacks, each with
  314. N elements. */
  315. # define YYSTACK_BYTES(N) \
  316. ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
  317. + YYSTACK_GAP_MAXIMUM)
  318. # define YYCOPY_NEEDED 1
  319. /* Relocate STACK from its old location to the new one. The
  320. local variables YYSIZE and YYSTACKSIZE give the old and new number of
  321. elements in the stack, and YYPTR gives the new location of the
  322. stack. Advance YYPTR to a properly aligned location for the next
  323. stack. */
  324. # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
  325. do \
  326. { \
  327. YYSIZE_T yynewbytes; \
  328. YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
  329. Stack = &yyptr->Stack_alloc; \
  330. yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  331. yyptr += yynewbytes / sizeof (*yyptr); \
  332. } \
  333. while (YYID (0))
  334. #endif
  335. #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
  336. /* Copy COUNT objects from FROM to TO. The source and destination do
  337. not overlap. */
  338. # ifndef YYCOPY
  339. # if defined __GNUC__ && 1 < __GNUC__
  340. # define YYCOPY(To, From, Count) \
  341. __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
  342. # else
  343. # define YYCOPY(To, From, Count) \
  344. do \
  345. { \
  346. YYSIZE_T yyi; \
  347. for (yyi = 0; yyi < (Count); yyi++) \
  348. (To)[yyi] = (From)[yyi]; \
  349. } \
  350. while (YYID (0))
  351. # endif
  352. # endif
  353. #endif /* !YYCOPY_NEEDED */
  354. /* YYFINAL -- State number of the termination state. */
  355. #define YYFINAL 11
  356. /* YYLAST -- Last index in YYTABLE. */
  357. #define YYLAST 296
  358. /* YYNTOKENS -- Number of terminals. */
  359. #define YYNTOKENS 36
  360. /* YYNNTS -- Number of nonterminals. */
  361. #define YYNNTS 50
  362. /* YYNRULES -- Number of rules. */
  363. #define YYNRULES 119
  364. /* YYNRULES -- Number of states. */
  365. #define YYNSTATES 194
  366. /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
  367. #define YYUNDEFTOK 2
  368. #define YYMAXUTOK 290
  369. #define YYTRANSLATE(YYX) \
  370. ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  371. /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
  372. static const yytype_uint8 yytranslate[] =
  373. {
  374. 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  375. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  376. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  377. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  378. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  379. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  380. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  381. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  382. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  383. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  384. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  385. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  386. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  387. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  388. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  389. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  390. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  391. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  392. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  393. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  394. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  395. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  396. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  397. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  398. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  399. 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
  400. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  401. 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
  402. 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
  403. 35
  404. };
  405. #if YYDEBUG
  406. /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
  407. YYRHS. */
  408. static const yytype_uint16 yyprhs[] =
  409. {
  410. 0, 0, 3, 6, 8, 11, 13, 14, 17, 20,
  411. 23, 26, 31, 36, 40, 42, 44, 46, 48, 50,
  412. 52, 54, 56, 58, 60, 62, 64, 66, 68, 72,
  413. 75, 79, 82, 86, 89, 90, 93, 96, 99, 102,
  414. 105, 108, 112, 117, 122, 127, 133, 139, 143, 144,
  415. 148, 149, 152, 156, 159, 161, 165, 166, 169, 172,
  416. 175, 178, 181, 186, 190, 193, 198, 199, 202, 206,
  417. 208, 212, 213, 216, 219, 222, 226, 230, 234, 236,
  418. 240, 241, 244, 247, 250, 254, 258, 261, 264, 267,
  419. 268, 271, 274, 277, 282, 283, 286, 289, 292, 293,
  420. 296, 298, 300, 303, 306, 309, 311, 314, 315, 318,
  421. 320, 324, 328, 332, 335, 339, 343, 345, 347, 348
  422. };
  423. /* YYRHS -- A `-1'-separated list of the rules' RHS. */
  424. static const yytype_int8 yyrhs[] =
  425. {
  426. 37, 0, -1, 81, 38, -1, 38, -1, 63, 39,
  427. -1, 39, -1, -1, 39, 41, -1, 39, 55, -1,
  428. 39, 67, -1, 39, 80, -1, 39, 26, 1, 31,
  429. -1, 39, 40, 1, 31, -1, 39, 1, 31, -1,
  430. 16, -1, 18, -1, 19, -1, 21, -1, 17, -1,
  431. 22, -1, 20, -1, 23, -1, 31, -1, 61, -1,
  432. 71, -1, 44, -1, 46, -1, 69, -1, 26, 1,
  433. 31, -1, 1, 31, -1, 10, 26, 31, -1, 43,
  434. 47, -1, 11, 26, 31, -1, 45, 47, -1, -1,
  435. 47, 48, -1, 47, 49, -1, 47, 75, -1, 47,
  436. 73, -1, 47, 42, -1, 47, 31, -1, 19, 78,
  437. 31, -1, 18, 79, 82, 31, -1, 20, 83, 82,
  438. 31, -1, 21, 26, 82, 31, -1, 21, 26, 83,
  439. 82, 31, -1, 22, 84, 84, 82, 31, -1, 24,
  440. 50, 31, -1, -1, 50, 26, 51, -1, -1, 34,
  441. 79, -1, 7, 85, 31, -1, 52, 56, -1, 80,
  442. -1, 53, 58, 54, -1, -1, 56, 57, -1, 56,
  443. 75, -1, 56, 73, -1, 56, 31, -1, 56, 42,
  444. -1, 18, 79, 82, 31, -1, 19, 78, 31, -1,
  445. 17, 31, -1, 20, 26, 82, 31, -1, -1, 58,
  446. 41, -1, 14, 83, 81, -1, 80, -1, 59, 62,
  447. 60, -1, -1, 62, 41, -1, 62, 67, -1, 62,
  448. 55, -1, 3, 79, 81, -1, 4, 79, 31, -1,
  449. 64, 76, 74, -1, 80, -1, 65, 68, 66, -1,
  450. -1, 68, 41, -1, 68, 67, -1, 68, 55, -1,
  451. 6, 79, 31, -1, 9, 79, 31, -1, 70, 74,
  452. -1, 12, 31, -1, 72, 13, -1, -1, 74, 75,
  453. -1, 74, 31, -1, 74, 42, -1, 16, 25, 83,
  454. 31, -1, -1, 76, 77, -1, 76, 31, -1, 23,
  455. 82, -1, -1, 79, 82, -1, 26, -1, 27, -1,
  456. 5, 31, -1, 8, 31, -1, 15, 31, -1, 31,
  457. -1, 81, 31, -1, -1, 14, 83, -1, 84, -1,
  458. 84, 34, 84, -1, 84, 28, 84, -1, 30, 83,
  459. 29, -1, 35, 83, -1, 83, 32, 83, -1, 83,
  460. 33, 83, -1, 26, -1, 27, -1, -1, 26, -1
  461. };
  462. /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
  463. static const yytype_uint16 yyrline[] =
  464. {
  465. 0, 103, 103, 103, 105, 105, 107, 109, 110, 111,
  466. 112, 113, 114, 118, 122, 122, 122, 122, 122, 122,
  467. 122, 122, 126, 127, 128, 129, 130, 131, 135, 136,
  468. 142, 150, 156, 164, 174, 176, 177, 178, 179, 180,
  469. 181, 184, 192, 198, 208, 214, 220, 226, 229, 231,
  470. 242, 243, 248, 257, 262, 270, 273, 275, 276, 277,
  471. 278, 279, 282, 288, 299, 305, 315, 317, 322, 330,
  472. 338, 341, 343, 344, 345, 350, 357, 364, 369, 377,
  473. 380, 382, 383, 384, 387, 395, 402, 409, 415, 422,
  474. 424, 425, 426, 429, 437, 439, 440, 443, 450, 452,
  475. 457, 458, 461, 462, 463, 467, 468, 471, 472, 475,
  476. 476, 477, 478, 479, 480, 481, 484, 485, 488, 489
  477. };
  478. #endif
  479. #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
  480. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  481. First, the terminals, then, starting at YYNTOKENS, nonterminals. */
  482. static const char *const yytname[] =
  483. {
  484. "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
  485. "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
  486. "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
  487. "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE",
  488. "T_VISIBLE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
  489. "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
  490. "T_NOT", "$accept", "input", "start", "stmt_list", "option_name",
  491. "common_stmt", "option_error", "config_entry_start", "config_stmt",
  492. "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
  493. "config_option", "symbol_option", "symbol_option_list",
  494. "symbol_option_arg", "choice", "choice_entry", "choice_end",
  495. "choice_stmt", "choice_option_list", "choice_option", "choice_block",
  496. "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu",
  497. "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt",
  498. "comment", "comment_stmt", "help_start", "help", "depends_list",
  499. "depends", "visibility_list", "visible", "prompt_stmt_opt", "prompt",
  500. "end", "nl", "if_expr", "expr", "symbol", "word_opt", 0
  501. };
  502. #endif
  503. # ifdef YYPRINT
  504. /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
  505. token YYLEX-NUM. */
  506. static const yytype_uint16 yytoknum[] =
  507. {
  508. 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
  509. 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
  510. 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
  511. 285, 286, 287, 288, 289, 290
  512. };
  513. # endif
  514. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
  515. static const yytype_uint8 yyr1[] =
  516. {
  517. 0, 36, 37, 37, 38, 38, 39, 39, 39, 39,
  518. 39, 39, 39, 39, 40, 40, 40, 40, 40, 40,
  519. 40, 40, 41, 41, 41, 41, 41, 41, 42, 42,
  520. 43, 44, 45, 46, 47, 47, 47, 47, 47, 47,
  521. 47, 48, 48, 48, 48, 48, 48, 49, 50, 50,
  522. 51, 51, 52, 53, 54, 55, 56, 56, 56, 56,
  523. 56, 56, 57, 57, 57, 57, 58, 58, 59, 60,
  524. 61, 62, 62, 62, 62, 63, 64, 65, 66, 67,
  525. 68, 68, 68, 68, 69, 70, 71, 72, 73, 74,
  526. 74, 74, 74, 75, 76, 76, 76, 77, 78, 78,
  527. 79, 79, 80, 80, 80, 81, 81, 82, 82, 83,
  528. 83, 83, 83, 83, 83, 83, 84, 84, 85, 85
  529. };
  530. /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
  531. static const yytype_uint8 yyr2[] =
  532. {
  533. 0, 2, 2, 1, 2, 1, 0, 2, 2, 2,
  534. 2, 4, 4, 3, 1, 1, 1, 1, 1, 1,
  535. 1, 1, 1, 1, 1, 1, 1, 1, 3, 2,
  536. 3, 2, 3, 2, 0, 2, 2, 2, 2, 2,
  537. 2, 3, 4, 4, 4, 5, 5, 3, 0, 3,
  538. 0, 2, 3, 2, 1, 3, 0, 2, 2, 2,
  539. 2, 2, 4, 3, 2, 4, 0, 2, 3, 1,
  540. 3, 0, 2, 2, 2, 3, 3, 3, 1, 3,
  541. 0, 2, 2, 2, 3, 3, 2, 2, 2, 0,
  542. 2, 2, 2, 4, 0, 2, 2, 2, 0, 2,
  543. 1, 1, 2, 2, 2, 1, 2, 0, 2, 1,
  544. 3, 3, 3, 2, 3, 3, 1, 1, 0, 1
  545. };
  546. /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
  547. Performed when YYTABLE doesn't specify something else to do. Zero
  548. means the default is an error. */
  549. static const yytype_uint8 yydefact[] =
  550. {
  551. 6, 0, 105, 0, 3, 0, 6, 6, 100, 101,
  552. 0, 1, 0, 0, 0, 0, 118, 0, 0, 0,
  553. 0, 0, 0, 14, 18, 15, 16, 20, 17, 19,
  554. 21, 0, 22, 0, 7, 34, 25, 34, 26, 56,
  555. 66, 8, 71, 23, 94, 80, 9, 27, 89, 24,
  556. 10, 0, 106, 2, 75, 13, 0, 102, 0, 119,
  557. 0, 103, 0, 0, 0, 116, 117, 0, 0, 0,
  558. 109, 104, 0, 0, 0, 0, 0, 0, 0, 89,
  559. 0, 0, 76, 84, 52, 85, 30, 32, 0, 113,
  560. 0, 0, 68, 0, 0, 11, 12, 0, 0, 0,
  561. 0, 98, 0, 0, 0, 48, 0, 40, 39, 35,
  562. 36, 0, 38, 37, 0, 0, 98, 0, 60, 61,
  563. 57, 59, 58, 67, 55, 54, 72, 74, 70, 73,
  564. 69, 107, 96, 0, 95, 81, 83, 79, 82, 78,
  565. 91, 92, 90, 112, 114, 115, 111, 110, 29, 87,
  566. 0, 107, 0, 107, 107, 107, 0, 0, 0, 88,
  567. 64, 107, 0, 107, 0, 97, 0, 0, 41, 99,
  568. 0, 0, 107, 107, 50, 47, 28, 0, 63, 0,
  569. 108, 93, 42, 43, 44, 0, 0, 0, 49, 62,
  570. 65, 45, 46, 51
  571. };
  572. /* YYDEFGOTO[NTERM-NUM]. */
  573. static const yytype_int16 yydefgoto[] =
  574. {
  575. -1, 3, 4, 5, 33, 34, 108, 35, 36, 37,
  576. 38, 74, 109, 110, 157, 188, 39, 40, 124, 41,
  577. 76, 120, 77, 42, 128, 43, 78, 6, 44, 45,
  578. 137, 46, 80, 47, 48, 49, 111, 112, 81, 113,
  579. 79, 134, 152, 153, 50, 7, 165, 69, 70, 60
  580. };
  581. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  582. STATE-NUM. */
  583. #define YYPACT_NINF -90
  584. static const yytype_int16 yypact[] =
  585. {
  586. 4, 77, -90, 61, -90, 129, -90, 15, -90, -90,
  587. 37, -90, 47, 77, 51, 77, 59, 63, 77, 66,
  588. 71, 60, 69, -90, -90, -90, -90, -90, -90, -90,
  589. -90, 125, -90, 127, -90, -90, -90, -90, -90, -90,
  590. -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
  591. -90, 157, -90, -90, 100, -90, 128, -90, 154, -90,
  592. 156, -90, 160, 161, 170, -90, -90, 60, 60, 203,
  593. 49, -90, 171, 182, 33, 101, 213, 252, 241, -2,
  594. 241, 189, -90, -90, -90, -90, -90, -90, -13, -90,
  595. 60, 60, 100, 115, 115, -90, -90, 185, 186, 201,
  596. 77, 77, 60, 211, 115, -90, 237, -90, -90, -90,
  597. -90, 230, -90, -90, 222, 77, 77, 228, -90, -90,
  598. -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
  599. -90, 245, -90, 65, -90, -90, -90, -90, -90, -90,
  600. -90, -90, -90, -90, 231, -90, -90, -90, -90, -90,
  601. 60, 245, 234, 245, -5, -4, 115, 62, 238, -90,
  602. -90, 245, 239, 245, 60, -90, 209, 240, -90, -90,
  603. 242, 244, -5, 245, 246, -90, -90, 248, -90, 250,
  604. 137, -90, -90, -90, -90, 251, 254, 77, -90, -90,
  605. -90, -90, -90, -90
  606. };
  607. /* YYPGOTO[NTERM-NUM]. */
  608. static const yytype_int16 yypgoto[] =
  609. {
  610. -90, -90, 261, 281, -90, 76, -70, -90, -90, -90,
  611. -90, 253, -90, -90, -90, -90, -90, -90, -90, -48,
  612. -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
  613. -90, -20, -90, -90, -90, -90, -90, 212, 210, -68,
  614. -90, -90, 175, -1, 104, -7, 123, -66, -89, -90
  615. };
  616. /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
  617. positive, shift that token. If negative, reduce the rule which
  618. number is the opposite. If YYTABLE_NINF, syntax error. */
  619. #define YYTABLE_NINF -87
  620. static const yytype_int16 yytable[] =
  621. {
  622. 10, 88, 89, 54, 146, 147, 119, 1, 122, 164,
  623. 164, 141, 56, 142, 58, 156, 143, 62, 1, 90,
  624. 91, 131, 65, 66, 144, 145, 67, 90, 91, 132,
  625. 127, 68, 136, -31, 97, 2, 154, -31, -31, -31,
  626. -31, -31, -31, -31, -31, 98, 52, -31, -31, 99,
  627. -31, 100, 101, 102, 103, 104, -31, 105, 129, 106,
  628. 138, 11, 92, 141, 107, 142, 97, 173, 2, -77,
  629. -77, -77, -77, -77, -77, -77, -77, 93, 55, -77,
  630. -77, 99, 57, 94, 166, 59, 65, 66, 174, 172,
  631. 67, 106, 63, 175, 61, 68, 140, 64, 180, 151,
  632. 71, -33, 97, 8, 9, -33, -33, -33, -33, -33,
  633. -33, -33, -33, 98, 161, -33, -33, 99, -33, 100,
  634. 101, 102, 103, 104, -33, 105, 72, 106, 73, -5,
  635. 12, 52, 107, 13, 14, 15, 16, 17, 18, 19,
  636. 20, 65, 66, 21, 22, 23, 24, 25, 26, 27,
  637. 28, 29, 30, 123, 126, 31, 135, -4, 12, 82,
  638. 32, 13, 14, 15, 16, 17, 18, 19, 20, 90,
  639. 91, 21, 22, 23, 24, 25, 26, 27, 28, 29,
  640. 30, 125, 130, 31, 139, 83, 193, 84, 32, -86,
  641. 97, 85, 86, -86, -86, -86, -86, -86, -86, -86,
  642. -86, 87, 95, -86, -86, 99, -86, -86, -86, -86,
  643. -86, -86, -86, 96, 97, 106, 148, 149, -53, -53,
  644. 140, -53, -53, -53, -53, 98, 150, -53, -53, 99,
  645. 114, 115, 116, 117, 2, 90, 91, 155, 158, 106,
  646. 181, 90, 91, 159, 118, 13, 14, 15, 16, 17,
  647. 18, 19, 20, 160, 163, 21, 22, 14, 15, 164,
  648. 17, 18, 19, 20, 91, 168, 21, 22, 53, 176,
  649. 178, 182, 32, 183, 167, 184, 169, 170, 171, 189,
  650. 187, 190, 191, 32, 177, 192, 179, 51, 121, 133,
  651. 75, 162, 0, 0, 0, 185, 186
  652. };
  653. #define yypact_value_is_default(yystate) \
  654. ((yystate) == (-90))
  655. #define yytable_value_is_error(yytable_value) \
  656. YYID (0)
  657. static const yytype_int16 yycheck[] =
  658. {
  659. 1, 67, 68, 10, 93, 94, 76, 3, 76, 14,
  660. 14, 81, 13, 81, 15, 104, 29, 18, 3, 32,
  661. 33, 23, 26, 27, 90, 91, 30, 32, 33, 31,
  662. 78, 35, 80, 0, 1, 31, 102, 4, 5, 6,
  663. 7, 8, 9, 10, 11, 12, 31, 14, 15, 16,
  664. 17, 18, 19, 20, 21, 22, 23, 24, 78, 26,
  665. 80, 0, 69, 133, 31, 133, 1, 156, 31, 4,
  666. 5, 6, 7, 8, 9, 10, 11, 28, 31, 14,
  667. 15, 16, 31, 34, 150, 26, 26, 27, 26, 155,
  668. 30, 26, 26, 31, 31, 35, 31, 26, 164, 100,
  669. 31, 0, 1, 26, 27, 4, 5, 6, 7, 8,
  670. 9, 10, 11, 12, 115, 14, 15, 16, 17, 18,
  671. 19, 20, 21, 22, 23, 24, 1, 26, 1, 0,
  672. 1, 31, 31, 4, 5, 6, 7, 8, 9, 10,
  673. 11, 26, 27, 14, 15, 16, 17, 18, 19, 20,
  674. 21, 22, 23, 77, 78, 26, 80, 0, 1, 31,
  675. 31, 4, 5, 6, 7, 8, 9, 10, 11, 32,
  676. 33, 14, 15, 16, 17, 18, 19, 20, 21, 22,
  677. 23, 77, 78, 26, 80, 31, 187, 31, 31, 0,
  678. 1, 31, 31, 4, 5, 6, 7, 8, 9, 10,
  679. 11, 31, 31, 14, 15, 16, 17, 18, 19, 20,
  680. 21, 22, 23, 31, 1, 26, 31, 31, 5, 6,
  681. 31, 8, 9, 10, 11, 12, 25, 14, 15, 16,
  682. 17, 18, 19, 20, 31, 32, 33, 26, 1, 26,
  683. 31, 32, 33, 13, 31, 4, 5, 6, 7, 8,
  684. 9, 10, 11, 31, 26, 14, 15, 5, 6, 14,
  685. 8, 9, 10, 11, 33, 31, 14, 15, 7, 31,
  686. 31, 31, 31, 31, 151, 31, 153, 154, 155, 31,
  687. 34, 31, 31, 31, 161, 31, 163, 6, 76, 79,
  688. 37, 116, -1, -1, -1, 172, 173
  689. };
  690. /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  691. symbol of state STATE-NUM. */
  692. static const yytype_uint8 yystos[] =
  693. {
  694. 0, 3, 31, 37, 38, 39, 63, 81, 26, 27,
  695. 79, 0, 1, 4, 5, 6, 7, 8, 9, 10,
  696. 11, 14, 15, 16, 17, 18, 19, 20, 21, 22,
  697. 23, 26, 31, 40, 41, 43, 44, 45, 46, 52,
  698. 53, 55, 59, 61, 64, 65, 67, 69, 70, 71,
  699. 80, 39, 31, 38, 81, 31, 79, 31, 79, 26,
  700. 85, 31, 79, 26, 26, 26, 27, 30, 35, 83,
  701. 84, 31, 1, 1, 47, 47, 56, 58, 62, 76,
  702. 68, 74, 31, 31, 31, 31, 31, 31, 83, 83,
  703. 32, 33, 81, 28, 34, 31, 31, 1, 12, 16,
  704. 18, 19, 20, 21, 22, 24, 26, 31, 42, 48,
  705. 49, 72, 73, 75, 17, 18, 19, 20, 31, 42,
  706. 57, 73, 75, 41, 54, 80, 41, 55, 60, 67,
  707. 80, 23, 31, 74, 77, 41, 55, 66, 67, 80,
  708. 31, 42, 75, 29, 83, 83, 84, 84, 31, 31,
  709. 25, 79, 78, 79, 83, 26, 84, 50, 1, 13,
  710. 31, 79, 78, 26, 14, 82, 83, 82, 31, 82,
  711. 82, 82, 83, 84, 26, 31, 31, 82, 31, 82,
  712. 83, 31, 31, 31, 31, 82, 82, 34, 51, 31,
  713. 31, 31, 31, 79
  714. };
  715. #define yyerrok (yyerrstatus = 0)
  716. #define yyclearin (yychar = YYEMPTY)
  717. #define YYEMPTY (-2)
  718. #define YYEOF 0
  719. #define YYACCEPT goto yyacceptlab
  720. #define YYABORT goto yyabortlab
  721. #define YYERROR goto yyerrorlab
  722. /* Like YYERROR except do call yyerror. This remains here temporarily
  723. to ease the transition to the new meaning of YYERROR, for GCC.
  724. Once GCC version 2 has supplanted version 1, this can go. However,
  725. YYFAIL appears to be in use. Nevertheless, it is formally deprecated
  726. in Bison 2.4.2's NEWS entry, where a plan to phase it out is
  727. discussed. */
  728. #define YYFAIL goto yyerrlab
  729. #if defined YYFAIL
  730. /* This is here to suppress warnings from the GCC cpp's
  731. -Wunused-macros. Normally we don't worry about that warning, but
  732. some users do, and we want to make it easy for users to remove
  733. YYFAIL uses, which will produce warnings from Bison 2.5. */
  734. #endif
  735. #define YYRECOVERING() (!!yyerrstatus)
  736. #define YYBACKUP(Token, Value) \
  737. do \
  738. if (yychar == YYEMPTY && yylen == 1) \
  739. { \
  740. yychar = (Token); \
  741. yylval = (Value); \
  742. YYPOPSTACK (1); \
  743. goto yybackup; \
  744. } \
  745. else \
  746. { \
  747. yyerror (YY_("syntax error: cannot back up")); \
  748. YYERROR; \
  749. } \
  750. while (YYID (0))
  751. #define YYTERROR 1
  752. #define YYERRCODE 256
  753. /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
  754. If N is 0, then set CURRENT to the empty location which ends
  755. the previous symbol: RHS[0] (always defined). */
  756. #define YYRHSLOC(Rhs, K) ((Rhs)[K])
  757. #ifndef YYLLOC_DEFAULT
  758. # define YYLLOC_DEFAULT(Current, Rhs, N) \
  759. do \
  760. if (YYID (N)) \
  761. { \
  762. (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
  763. (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
  764. (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
  765. (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
  766. } \
  767. else \
  768. { \
  769. (Current).first_line = (Current).last_line = \
  770. YYRHSLOC (Rhs, 0).last_line; \
  771. (Current).first_column = (Current).last_column = \
  772. YYRHSLOC (Rhs, 0).last_column; \
  773. } \
  774. while (YYID (0))
  775. #endif
  776. /* This macro is provided for backward compatibility. */
  777. #ifndef YY_LOCATION_PRINT
  778. # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
  779. #endif
  780. /* YYLEX -- calling `yylex' with the right arguments. */
  781. #ifdef YYLEX_PARAM
  782. # define YYLEX yylex (YYLEX_PARAM)
  783. #else
  784. # define YYLEX yylex ()
  785. #endif
  786. /* Enable debugging if requested. */
  787. #if YYDEBUG
  788. # ifndef YYFPRINTF
  789. # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
  790. # define YYFPRINTF fprintf
  791. # endif
  792. # define YYDPRINTF(Args) \
  793. do { \
  794. if (yydebug) \
  795. YYFPRINTF Args; \
  796. } while (YYID (0))
  797. # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
  798. do { \
  799. if (yydebug) \
  800. { \
  801. YYFPRINTF (stderr, "%s ", Title); \
  802. yy_symbol_print (stderr, \
  803. Type, Value); \
  804. YYFPRINTF (stderr, "\n"); \
  805. } \
  806. } while (YYID (0))
  807. /*--------------------------------.
  808. | Print this symbol on YYOUTPUT. |
  809. `--------------------------------*/
  810. /*ARGSUSED*/
  811. #if (defined __STDC__ || defined __C99__FUNC__ \
  812. || defined __cplusplus || defined _MSC_VER)
  813. static void
  814. yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  815. #else
  816. static void
  817. yy_symbol_value_print (yyoutput, yytype, yyvaluep)
  818. FILE *yyoutput;
  819. int yytype;
  820. YYSTYPE const * const yyvaluep;
  821. #endif
  822. {
  823. if (!yyvaluep)
  824. return;
  825. # ifdef YYPRINT
  826. if (yytype < YYNTOKENS)
  827. YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
  828. # else
  829. YYUSE (yyoutput);
  830. # endif
  831. switch (yytype)
  832. {
  833. default:
  834. break;
  835. }
  836. }
  837. /*--------------------------------.
  838. | Print this symbol on YYOUTPUT. |
  839. `--------------------------------*/
  840. #if (defined __STDC__ || defined __C99__FUNC__ \
  841. || defined __cplusplus || defined _MSC_VER)
  842. static void
  843. yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  844. #else
  845. static void
  846. yy_symbol_print (yyoutput, yytype, yyvaluep)
  847. FILE *yyoutput;
  848. int yytype;
  849. YYSTYPE const * const yyvaluep;
  850. #endif
  851. {
  852. if (yytype < YYNTOKENS)
  853. YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
  854. else
  855. YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
  856. yy_symbol_value_print (yyoutput, yytype, yyvaluep);
  857. YYFPRINTF (yyoutput, ")");
  858. }
  859. /*------------------------------------------------------------------.
  860. | yy_stack_print -- Print the state stack from its BOTTOM up to its |
  861. | TOP (included). |
  862. `------------------------------------------------------------------*/
  863. #if (defined __STDC__ || defined __C99__FUNC__ \
  864. || defined __cplusplus || defined _MSC_VER)
  865. static void
  866. yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
  867. #else
  868. static void
  869. yy_stack_print (yybottom, yytop)
  870. yytype_int16 *yybottom;
  871. yytype_int16 *yytop;
  872. #endif
  873. {
  874. YYFPRINTF (stderr, "Stack now");
  875. for (; yybottom <= yytop; yybottom++)
  876. {
  877. int yybot = *yybottom;
  878. YYFPRINTF (stderr, " %d", yybot);
  879. }
  880. YYFPRINTF (stderr, "\n");
  881. }
  882. # define YY_STACK_PRINT(Bottom, Top) \
  883. do { \
  884. if (yydebug) \
  885. yy_stack_print ((Bottom), (Top)); \
  886. } while (YYID (0))
  887. /*------------------------------------------------.
  888. | Report that the YYRULE is going to be reduced. |
  889. `------------------------------------------------*/
  890. #if (defined __STDC__ || defined __C99__FUNC__ \
  891. || defined __cplusplus || defined _MSC_VER)
  892. static void
  893. yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
  894. #else
  895. static void
  896. yy_reduce_print (yyvsp, yyrule)
  897. YYSTYPE *yyvsp;
  898. int yyrule;
  899. #endif
  900. {
  901. int yynrhs = yyr2[yyrule];
  902. int yyi;
  903. unsigned long int yylno = yyrline[yyrule];
  904. YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
  905. yyrule - 1, yylno);
  906. /* The symbols being reduced. */
  907. for (yyi = 0; yyi < yynrhs; yyi++)
  908. {
  909. YYFPRINTF (stderr, " $%d = ", yyi + 1);
  910. yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
  911. &(yyvsp[(yyi + 1) - (yynrhs)])
  912. );
  913. YYFPRINTF (stderr, "\n");
  914. }
  915. }
  916. # define YY_REDUCE_PRINT(Rule) \
  917. do { \
  918. if (yydebug) \
  919. yy_reduce_print (yyvsp, Rule); \
  920. } while (YYID (0))
  921. /* Nonzero means print parse trace. It is left uninitialized so that
  922. multiple parsers can coexist. */
  923. int yydebug;
  924. #else /* !YYDEBUG */
  925. # define YYDPRINTF(Args)
  926. # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
  927. # define YY_STACK_PRINT(Bottom, Top)
  928. # define YY_REDUCE_PRINT(Rule)
  929. #endif /* !YYDEBUG */
  930. /* YYINITDEPTH -- initial size of the parser's stacks. */
  931. #ifndef YYINITDEPTH
  932. # define YYINITDEPTH 200
  933. #endif
  934. /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  935. if the built-in stack extension method is used).
  936. Do not make this value too large; the results are undefined if
  937. YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
  938. evaluated with infinite-precision integer arithmetic. */
  939. #ifndef YYMAXDEPTH
  940. # define YYMAXDEPTH 10000
  941. #endif
  942. #if YYERROR_VERBOSE
  943. # ifndef yystrlen
  944. # if defined __GLIBC__ && defined _STRING_H
  945. # define yystrlen strlen
  946. # else
  947. /* Return the length of YYSTR. */
  948. #if (defined __STDC__ || defined __C99__FUNC__ \
  949. || defined __cplusplus || defined _MSC_VER)
  950. static YYSIZE_T
  951. yystrlen (const char *yystr)
  952. #else
  953. static YYSIZE_T
  954. yystrlen (yystr)
  955. const char *yystr;
  956. #endif
  957. {
  958. YYSIZE_T yylen;
  959. for (yylen = 0; yystr[yylen]; yylen++)
  960. continue;
  961. return yylen;
  962. }
  963. # endif
  964. # endif
  965. # ifndef yystpcpy
  966. # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
  967. # define yystpcpy stpcpy
  968. # else
  969. /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  970. YYDEST. */
  971. #if (defined __STDC__ || defined __C99__FUNC__ \
  972. || defined __cplusplus || defined _MSC_VER)
  973. static char *
  974. yystpcpy (char *yydest, const char *yysrc)
  975. #else
  976. static char *
  977. yystpcpy (yydest, yysrc)
  978. char *yydest;
  979. const char *yysrc;
  980. #endif
  981. {
  982. char *yyd = yydest;
  983. const char *yys = yysrc;
  984. while ((*yyd++ = *yys++) != '\0')
  985. continue;
  986. return yyd - 1;
  987. }
  988. # endif
  989. # endif
  990. # ifndef yytnamerr
  991. /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
  992. quotes and backslashes, so that it's suitable for yyerror. The
  993. heuristic is that double-quoting is unnecessary unless the string
  994. contains an apostrophe, a comma, or backslash (other than
  995. backslash-backslash). YYSTR is taken from yytname. If YYRES is
  996. null, do not copy; instead, return the length of what the result
  997. would have been. */
  998. static YYSIZE_T
  999. yytnamerr (char *yyres, const char *yystr)
  1000. {
  1001. if (*yystr == '"')
  1002. {
  1003. YYSIZE_T yyn = 0;
  1004. char const *yyp = yystr;
  1005. for (;;)
  1006. switch (*++yyp)
  1007. {
  1008. case '\'':
  1009. case ',':
  1010. goto do_not_strip_quotes;
  1011. case '\\':
  1012. if (*++yyp != '\\')
  1013. goto do_not_strip_quotes;
  1014. /* Fall through. */
  1015. default:
  1016. if (yyres)
  1017. yyres[yyn] = *yyp;
  1018. yyn++;
  1019. break;
  1020. case '"':
  1021. if (yyres)
  1022. yyres[yyn] = '\0';
  1023. return yyn;
  1024. }
  1025. do_not_strip_quotes: ;
  1026. }
  1027. if (! yyres)
  1028. return yystrlen (yystr);
  1029. return yystpcpy (yyres, yystr) - yyres;
  1030. }
  1031. # endif
  1032. /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
  1033. about the unexpected token YYTOKEN for the state stack whose top is
  1034. YYSSP.
  1035. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
  1036. not large enough to hold the message. In that case, also set
  1037. *YYMSG_ALLOC to the required number of bytes. Return 2 if the
  1038. required number of bytes is too large to store. */
  1039. static int
  1040. yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
  1041. yytype_int16 *yyssp, int yytoken)
  1042. {
  1043. YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
  1044. YYSIZE_T yysize = yysize0;
  1045. YYSIZE_T yysize1;
  1046. enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  1047. /* Internationalized format string. */
  1048. const char *yyformat = 0;
  1049. /* Arguments of yyformat. */
  1050. char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  1051. /* Number of reported tokens (one for the "unexpected", one per
  1052. "expected"). */
  1053. int yycount = 0;
  1054. /* There are many possibilities here to consider:
  1055. - Assume YYFAIL is not used. It's too flawed to consider. See
  1056. <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
  1057. for details. YYERROR is fine as it does not invoke this
  1058. function.
  1059. - If this state is a consistent state with a default action, then
  1060. the only way this function was invoked is if the default action
  1061. is an error action. In that case, don't check for expected
  1062. tokens because there are none.
  1063. - The only way there can be no lookahead present (in yychar) is if
  1064. this state is a consistent state with a default action. Thus,
  1065. detecting the absence of a lookahead is sufficient to determine
  1066. that there is no unexpected or expected token to report. In that
  1067. case, just report a simple "syntax error".
  1068. - Don't assume there isn't a lookahead just because this state is a
  1069. consistent state with a default action. There might have been a
  1070. previous inconsistent state, consistent state with a non-default
  1071. action, or user semantic action that manipulated yychar.
  1072. - Of course, the expected token list depends on states to have
  1073. correct lookahead information, and it depends on the parser not
  1074. to perform extra reductions after fetching a lookahead from the
  1075. scanner and before detecting a syntax error. Thus, state merging
  1076. (from LALR or IELR) and default reductions corrupt the expected
  1077. token list. However, the list is correct for canonical LR with
  1078. one exception: it will still contain any token that will not be
  1079. accepted due to an error action in a later state.
  1080. */
  1081. if (yytoken != YYEMPTY)
  1082. {
  1083. int yyn = yypact[*yyssp];
  1084. yyarg[yycount++] = yytname[yytoken];
  1085. if (!yypact_value_is_default (yyn))
  1086. {
  1087. /* Start YYX at -YYN if negative to avoid negative indexes in
  1088. YYCHECK. In other words, skip the first -YYN actions for
  1089. this state because they are default actions. */
  1090. int yyxbegin = yyn < 0 ? -yyn : 0;
  1091. /* Stay within bounds of both yycheck and yytname. */
  1092. int yychecklim = YYLAST - yyn + 1;
  1093. int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
  1094. int yyx;
  1095. for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  1096. if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
  1097. && !yytable_value_is_error (yytable[yyx + yyn]))
  1098. {
  1099. if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
  1100. {
  1101. yycount = 1;
  1102. yysize = yysize0;
  1103. break;
  1104. }
  1105. yyarg[yycount++] = yytname[yyx];
  1106. yysize1 = yysize + yytnamerr (0, yytname[yyx]);
  1107. if (! (yysize <= yysize1
  1108. && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
  1109. return 2;
  1110. yysize = yysize1;
  1111. }
  1112. }
  1113. }
  1114. switch (yycount)
  1115. {
  1116. # define YYCASE_(N, S) \
  1117. case N: \
  1118. yyformat = S; \
  1119. break
  1120. YYCASE_(0, YY_("syntax error"));
  1121. YYCASE_(1, YY_("syntax error, unexpected %s"));
  1122. YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
  1123. YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
  1124. YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
  1125. YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
  1126. # undef YYCASE_
  1127. }
  1128. yysize1 = yysize + yystrlen (yyformat);
  1129. if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
  1130. return 2;
  1131. yysize = yysize1;
  1132. if (*yymsg_alloc < yysize)
  1133. {
  1134. *yymsg_alloc = 2 * yysize;
  1135. if (! (yysize <= *yymsg_alloc
  1136. && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
  1137. *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
  1138. return 1;
  1139. }
  1140. /* Avoid sprintf, as that infringes on the user's name space.
  1141. Don't have undefined behavior even if the translation
  1142. produced a string with the wrong number of "%s"s. */
  1143. {
  1144. char *yyp = *yymsg;
  1145. int yyi = 0;
  1146. while ((*yyp = *yyformat) != '\0')
  1147. if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
  1148. {
  1149. yyp += yytnamerr (yyp, yyarg[yyi++]);
  1150. yyformat += 2;
  1151. }
  1152. else
  1153. {
  1154. yyp++;
  1155. yyformat++;
  1156. }
  1157. }
  1158. return 0;
  1159. }
  1160. #endif /* YYERROR_VERBOSE */
  1161. /*-----------------------------------------------.
  1162. | Release the memory associated to this symbol. |
  1163. `-----------------------------------------------*/
  1164. /*ARGSUSED*/
  1165. #if (defined __STDC__ || defined __C99__FUNC__ \
  1166. || defined __cplusplus || defined _MSC_VER)
  1167. static void
  1168. yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
  1169. #else
  1170. static void
  1171. yydestruct (yymsg, yytype, yyvaluep)
  1172. const char *yymsg;
  1173. int yytype;
  1174. YYSTYPE *yyvaluep;
  1175. #endif
  1176. {
  1177. YYUSE (yyvaluep);
  1178. if (!yymsg)
  1179. yymsg = "Deleting";
  1180. YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  1181. switch (yytype)
  1182. {
  1183. case 53: /* "choice_entry" */
  1184. /* Line 1391 of yacc.c */
  1185. #line 90 "zconf.y"
  1186. {
  1187. fprintf(stderr, "%s:%d: missing end statement for this entry\n",
  1188. (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
  1189. if (current_menu == (yyvaluep->menu))
  1190. menu_end_menu();
  1191. };
  1192. /* Line 1391 of yacc.c */
  1193. #line 1357 "zconf.tab.c"
  1194. break;
  1195. case 59: /* "if_entry" */
  1196. /* Line 1391 of yacc.c */
  1197. #line 90 "zconf.y"
  1198. {
  1199. fprintf(stderr, "%s:%d: missing end statement for this entry\n",
  1200. (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
  1201. if (current_menu == (yyvaluep->menu))
  1202. menu_end_menu();
  1203. };
  1204. /* Line 1391 of yacc.c */
  1205. #line 1371 "zconf.tab.c"
  1206. break;
  1207. case 65: /* "menu_entry" */
  1208. /* Line 1391 of yacc.c */
  1209. #line 90 "zconf.y"
  1210. {
  1211. fprintf(stderr, "%s:%d: missing end statement for this entry\n",
  1212. (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
  1213. if (current_menu == (yyvaluep->menu))
  1214. menu_end_menu();
  1215. };
  1216. /* Line 1391 of yacc.c */
  1217. #line 1385 "zconf.tab.c"
  1218. break;
  1219. default:
  1220. break;
  1221. }
  1222. }
  1223. /* Prevent warnings from -Wmissing-prototypes. */
  1224. #ifdef YYPARSE_PARAM
  1225. #if defined __STDC__ || defined __cplusplus
  1226. int yyparse (void *YYPARSE_PARAM);
  1227. #else
  1228. int yyparse ();
  1229. #endif
  1230. #else /* ! YYPARSE_PARAM */
  1231. #if defined __STDC__ || defined __cplusplus
  1232. int yyparse (void);
  1233. #else
  1234. int yyparse ();
  1235. #endif
  1236. #endif /* ! YYPARSE_PARAM */
  1237. /* The lookahead symbol. */
  1238. int yychar;
  1239. /* The semantic value of the lookahead symbol. */
  1240. YYSTYPE yylval;
  1241. /* Number of syntax errors so far. */
  1242. int yynerrs;
  1243. /*----------.
  1244. | yyparse. |
  1245. `----------*/
  1246. #ifdef YYPARSE_PARAM
  1247. #if (defined __STDC__ || defined __C99__FUNC__ \
  1248. || defined __cplusplus || defined _MSC_VER)
  1249. int
  1250. yyparse (void *YYPARSE_PARAM)
  1251. #else
  1252. int
  1253. yyparse (YYPARSE_PARAM)
  1254. void *YYPARSE_PARAM;
  1255. #endif
  1256. #else /* ! YYPARSE_PARAM */
  1257. #if (defined __STDC__ || defined __C99__FUNC__ \
  1258. || defined __cplusplus || defined _MSC_VER)
  1259. int
  1260. yyparse (void)
  1261. #else
  1262. int
  1263. yyparse ()
  1264. #endif
  1265. #endif
  1266. {
  1267. int yystate;
  1268. /* Number of tokens to shift before error messages enabled. */
  1269. int yyerrstatus;
  1270. /* The stacks and their tools:
  1271. `yyss': related to states.
  1272. `yyvs': related to semantic values.
  1273. Refer to the stacks thru separate pointers, to allow yyoverflow
  1274. to reallocate them elsewhere. */
  1275. /* The state stack. */
  1276. yytype_int16 yyssa[YYINITDEPTH];
  1277. yytype_int16 *yyss;
  1278. yytype_int16 *yyssp;
  1279. /* The semantic value stack. */
  1280. YYSTYPE yyvsa[YYINITDEPTH];
  1281. YYSTYPE *yyvs;
  1282. YYSTYPE *yyvsp;
  1283. YYSIZE_T yystacksize;
  1284. int yyn;
  1285. int yyresult;
  1286. /* Lookahead token as an internal (translated) token number. */
  1287. int yytoken;
  1288. /* The variables used to return semantic value and location from the
  1289. action routines. */
  1290. YYSTYPE yyval;
  1291. #if YYERROR_VERBOSE
  1292. /* Buffer for error messages, and its allocated size. */
  1293. char yymsgbuf[128];
  1294. char *yymsg = yymsgbuf;
  1295. YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
  1296. #endif
  1297. #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
  1298. /* The number of symbols on the RHS of the reduced rule.
  1299. Keep to zero when no symbol should be popped. */
  1300. int yylen = 0;
  1301. yytoken = 0;
  1302. yyss = yyssa;
  1303. yyvs = yyvsa;
  1304. yystacksize = YYINITDEPTH;
  1305. YYDPRINTF ((stderr, "Starting parse\n"));
  1306. yystate = 0;
  1307. yyerrstatus = 0;
  1308. yynerrs = 0;
  1309. yychar = YYEMPTY; /* Cause a token to be read. */
  1310. /* Initialize stack pointers.
  1311. Waste one element of value and location stack
  1312. so that they stay on the same level as the state stack.
  1313. The wasted elements are never initialized. */
  1314. yyssp = yyss;
  1315. yyvsp = yyvs;
  1316. goto yysetstate;
  1317. /*------------------------------------------------------------.
  1318. | yynewstate -- Push a new state, which is found in yystate. |
  1319. `------------------------------------------------------------*/
  1320. yynewstate:
  1321. /* In all cases, when you get here, the value and location stacks
  1322. have just been pushed. So pushing a state here evens the stacks. */
  1323. yyssp++;
  1324. yysetstate:
  1325. *yyssp = yystate;
  1326. if (yyss + yystacksize - 1 <= yyssp)
  1327. {
  1328. /* Get the current used size of the three stacks, in elements. */
  1329. YYSIZE_T yysize = yyssp - yyss + 1;
  1330. #ifdef yyoverflow
  1331. {
  1332. /* Give user a chance to reallocate the stack. Use copies of
  1333. these so that the &'s don't force the real ones into
  1334. memory. */
  1335. YYSTYPE *yyvs1 = yyvs;
  1336. yytype_int16 *yyss1 = yyss;
  1337. /* Each stack pointer address is followed by the size of the
  1338. data in use in that stack, in bytes. This used to be a
  1339. conditional around just the two extra args, but that might
  1340. be undefined if yyoverflow is a macro. */
  1341. yyoverflow (YY_("memory exhausted"),
  1342. &yyss1, yysize * sizeof (*yyssp),
  1343. &yyvs1, yysize * sizeof (*yyvsp),
  1344. &yystacksize);
  1345. yyss = yyss1;
  1346. yyvs = yyvs1;
  1347. }
  1348. #else /* no yyoverflow */
  1349. # ifndef YYSTACK_RELOCATE
  1350. goto yyexhaustedlab;
  1351. # else
  1352. /* Extend the stack our own way. */
  1353. if (YYMAXDEPTH <= yystacksize)
  1354. goto yyexhaustedlab;
  1355. yystacksize *= 2;
  1356. if (YYMAXDEPTH < yystacksize)
  1357. yystacksize = YYMAXDEPTH;
  1358. {
  1359. yytype_int16 *yyss1 = yyss;
  1360. union yyalloc *yyptr =
  1361. (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  1362. if (! yyptr)
  1363. goto yyexhaustedlab;
  1364. YYSTACK_RELOCATE (yyss_alloc, yyss);
  1365. YYSTACK_RELOCATE (yyvs_alloc, yyvs);
  1366. # undef YYSTACK_RELOCATE
  1367. if (yyss1 != yyssa)
  1368. YYSTACK_FREE (yyss1);
  1369. }
  1370. # endif
  1371. #endif /* no yyoverflow */
  1372. yyssp = yyss + yysize - 1;
  1373. yyvsp = yyvs + yysize - 1;
  1374. YYDPRINTF ((stderr, "Stack size increased to %lu\n",
  1375. (unsigned long int) yystacksize));
  1376. if (yyss + yystacksize - 1 <= yyssp)
  1377. YYABORT;
  1378. }
  1379. YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  1380. if (yystate == YYFINAL)
  1381. YYACCEPT;
  1382. goto yybackup;
  1383. /*-----------.
  1384. | yybackup. |
  1385. `-----------*/
  1386. yybackup:
  1387. /* Do appropriate processing given the current state. Read a
  1388. lookahead token if we need one and don't already have one. */
  1389. /* First try to decide what to do without reference to lookahead token. */
  1390. yyn = yypact[yystate];
  1391. if (yypact_value_is_default (yyn))
  1392. goto yydefault;
  1393. /* Not known => get a lookahead token if don't already have one. */
  1394. /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
  1395. if (yychar == YYEMPTY)
  1396. {
  1397. YYDPRINTF ((stderr, "Reading a token: "));
  1398. yychar = YYLEX;
  1399. }
  1400. if (yychar <= YYEOF)
  1401. {
  1402. yychar = yytoken = YYEOF;
  1403. YYDPRINTF ((stderr, "Now at end of input.\n"));
  1404. }
  1405. else
  1406. {
  1407. yytoken = YYTRANSLATE (yychar);
  1408. YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  1409. }
  1410. /* If the proper action on seeing token YYTOKEN is to reduce or to
  1411. detect an error, take that action. */
  1412. yyn += yytoken;
  1413. if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  1414. goto yydefault;
  1415. yyn = yytable[yyn];
  1416. if (yyn <= 0)
  1417. {
  1418. if (yytable_value_is_error (yyn))
  1419. goto yyerrlab;
  1420. yyn = -yyn;
  1421. goto yyreduce;
  1422. }
  1423. /* Count tokens shifted since error; after three, turn off error
  1424. status. */
  1425. if (yyerrstatus)
  1426. yyerrstatus--;
  1427. /* Shift the lookahead token. */
  1428. YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  1429. /* Discard the shifted token. */
  1430. yychar = YYEMPTY;
  1431. yystate = yyn;
  1432. *++yyvsp = yylval;
  1433. goto yynewstate;
  1434. /*-----------------------------------------------------------.
  1435. | yydefault -- do the default action for the current state. |
  1436. `-----------------------------------------------------------*/
  1437. yydefault:
  1438. yyn = yydefact[yystate];
  1439. if (yyn == 0)
  1440. goto yyerrlab;
  1441. goto yyreduce;
  1442. /*-----------------------------.
  1443. | yyreduce -- Do a reduction. |
  1444. `-----------------------------*/
  1445. yyreduce:
  1446. /* yyn is the number of a rule to reduce with. */
  1447. yylen = yyr2[yyn];
  1448. /* If YYLEN is nonzero, implement the default value of the action:
  1449. `$$ = $1'.
  1450. Otherwise, the following line sets YYVAL to garbage.
  1451. This behavior is undocumented and Bison
  1452. users should not rely upon it. Assigning to YYVAL
  1453. unconditionally makes the parser a bit smaller, and it avoids a
  1454. GCC warning that YYVAL may be used uninitialized. */
  1455. yyval = yyvsp[1-yylen];
  1456. YY_REDUCE_PRINT (yyn);
  1457. switch (yyn)
  1458. {
  1459. case 10:
  1460. /* Line 1806 of yacc.c */
  1461. #line 112 "zconf.y"
  1462. { zconf_error("unexpected end statement"); }
  1463. break;
  1464. case 11:
  1465. /* Line 1806 of yacc.c */
  1466. #line 113 "zconf.y"
  1467. { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); }
  1468. break;
  1469. case 12:
  1470. /* Line 1806 of yacc.c */
  1471. #line 115 "zconf.y"
  1472. {
  1473. zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
  1474. }
  1475. break;
  1476. case 13:
  1477. /* Line 1806 of yacc.c */
  1478. #line 118 "zconf.y"
  1479. { zconf_error("invalid statement"); }
  1480. break;
  1481. case 28:
  1482. /* Line 1806 of yacc.c */
  1483. #line 135 "zconf.y"
  1484. { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); }
  1485. break;
  1486. case 29:
  1487. /* Line 1806 of yacc.c */
  1488. #line 136 "zconf.y"
  1489. { zconf_error("invalid option"); }
  1490. break;
  1491. case 30:
  1492. /* Line 1806 of yacc.c */
  1493. #line 143 "zconf.y"
  1494. {
  1495. struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
  1496. sym->flags |= SYMBOL_OPTIONAL;
  1497. menu_add_entry(sym);
  1498. printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
  1499. }
  1500. break;
  1501. case 31:
  1502. /* Line 1806 of yacc.c */
  1503. #line 151 "zconf.y"
  1504. {
  1505. menu_end_entry();
  1506. printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
  1507. }
  1508. break;
  1509. case 32:
  1510. /* Line 1806 of yacc.c */
  1511. #line 157 "zconf.y"
  1512. {
  1513. struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
  1514. sym->flags |= SYMBOL_OPTIONAL;
  1515. menu_add_entry(sym);
  1516. printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
  1517. }
  1518. break;
  1519. case 33:
  1520. /* Line 1806 of yacc.c */
  1521. #line 165 "zconf.y"
  1522. {
  1523. if (current_entry->prompt)
  1524. current_entry->prompt->type = P_MENU;
  1525. else
  1526. zconfprint("warning: menuconfig statement without prompt");
  1527. menu_end_entry();
  1528. printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
  1529. }
  1530. break;
  1531. case 41:
  1532. /* Line 1806 of yacc.c */
  1533. #line 185 "zconf.y"
  1534. {
  1535. menu_set_type((yyvsp[(1) - (3)].id)->stype);
  1536. printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
  1537. zconf_curname(), zconf_lineno(),
  1538. (yyvsp[(1) - (3)].id)->stype);
  1539. }
  1540. break;
  1541. case 42:
  1542. /* Line 1806 of yacc.c */
  1543. #line 193 "zconf.y"
  1544. {
  1545. menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
  1546. printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
  1547. }
  1548. break;
  1549. case 43:
  1550. /* Line 1806 of yacc.c */
  1551. #line 199 "zconf.y"
  1552. {
  1553. menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr));
  1554. if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN)
  1555. menu_set_type((yyvsp[(1) - (4)].id)->stype);
  1556. printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
  1557. zconf_curname(), zconf_lineno(),
  1558. (yyvsp[(1) - (4)].id)->stype);
  1559. }
  1560. break;
  1561. case 44:
  1562. /* Line 1806 of yacc.c */
  1563. #line 209 "zconf.y"
  1564. {
  1565. menu_add_select(sym_lookup((yyvsp[(2) - (4)].string), 0), NULL, (yyvsp[(3) - (4)].expr));
  1566. printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
  1567. }
  1568. break;
  1569. case 45:
  1570. /* Line 1806 of yacc.c */
  1571. #line 215 "zconf.y"
  1572. {
  1573. menu_add_select(sym_lookup((yyvsp[(2) - (5)].string), 0), (yyvsp[(3) - (5)].expr), (yyvsp[(4) - (5)].expr));
  1574. printd(DEBUG_PARSE, "%s:%d:select with value\n", zconf_curname(), zconf_lineno());
  1575. }
  1576. break;
  1577. case 46:
  1578. /* Line 1806 of yacc.c */
  1579. #line 221 "zconf.y"
  1580. {
  1581. menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr));
  1582. printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
  1583. }
  1584. break;
  1585. case 49:
  1586. /* Line 1806 of yacc.c */
  1587. #line 232 "zconf.y"
  1588. {
  1589. const struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
  1590. if (id && id->flags & TF_OPTION)
  1591. menu_add_option(id->token, (yyvsp[(3) - (3)].string));
  1592. else
  1593. zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string));
  1594. free((yyvsp[(2) - (3)].string));
  1595. }
  1596. break;
  1597. case 50:
  1598. /* Line 1806 of yacc.c */
  1599. #line 242 "zconf.y"
  1600. { (yyval.string) = NULL; }
  1601. break;
  1602. case 51:
  1603. /* Line 1806 of yacc.c */
  1604. #line 243 "zconf.y"
  1605. { (yyval.string) = (yyvsp[(2) - (2)].string); }
  1606. break;
  1607. case 52:
  1608. /* Line 1806 of yacc.c */
  1609. #line 249 "zconf.y"
  1610. {
  1611. struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE);
  1612. sym->flags |= SYMBOL_AUTO;
  1613. menu_add_entry(sym);
  1614. menu_add_expr(P_CHOICE, NULL, NULL);
  1615. printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
  1616. }
  1617. break;
  1618. case 53:
  1619. /* Line 1806 of yacc.c */
  1620. #line 258 "zconf.y"
  1621. {
  1622. (yyval.menu) = menu_add_menu();
  1623. }
  1624. break;
  1625. case 54:
  1626. /* Line 1806 of yacc.c */
  1627. #line 263 "zconf.y"
  1628. {
  1629. if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) {
  1630. menu_end_menu();
  1631. printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
  1632. }
  1633. }
  1634. break;
  1635. case 62:
  1636. /* Line 1806 of yacc.c */
  1637. #line 283 "zconf.y"
  1638. {
  1639. menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
  1640. printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
  1641. }
  1642. break;
  1643. case 63:
  1644. /* Line 1806 of yacc.c */
  1645. #line 289 "zconf.y"
  1646. {
  1647. if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) {
  1648. menu_set_type((yyvsp[(1) - (3)].id)->stype);
  1649. printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
  1650. zconf_curname(), zconf_lineno(),
  1651. (yyvsp[(1) - (3)].id)->stype);
  1652. } else
  1653. YYERROR;
  1654. }
  1655. break;
  1656. case 64:
  1657. /* Line 1806 of yacc.c */
  1658. #line 300 "zconf.y"
  1659. {
  1660. current_entry->sym->flags |= SYMBOL_OPTIONAL;
  1661. printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
  1662. }
  1663. break;
  1664. case 65:
  1665. /* Line 1806 of yacc.c */
  1666. #line 306 "zconf.y"
  1667. {
  1668. if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) {
  1669. menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
  1670. printd(DEBUG_PARSE, "%s:%d:default\n",
  1671. zconf_curname(), zconf_lineno());
  1672. } else
  1673. YYERROR;
  1674. }
  1675. break;
  1676. case 68:
  1677. /* Line 1806 of yacc.c */
  1678. #line 323 "zconf.y"
  1679. {
  1680. printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
  1681. menu_add_entry(NULL);
  1682. menu_add_dep((yyvsp[(2) - (3)].expr));
  1683. (yyval.menu) = menu_add_menu();
  1684. }
  1685. break;
  1686. case 69:
  1687. /* Line 1806 of yacc.c */
  1688. #line 331 "zconf.y"
  1689. {
  1690. if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) {
  1691. menu_end_menu();
  1692. printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
  1693. }
  1694. }
  1695. break;
  1696. case 75:
  1697. /* Line 1806 of yacc.c */
  1698. #line 351 "zconf.y"
  1699. {
  1700. menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
  1701. }
  1702. break;
  1703. case 76:
  1704. /* Line 1806 of yacc.c */
  1705. #line 358 "zconf.y"
  1706. {
  1707. menu_add_entry(NULL);
  1708. menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
  1709. printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
  1710. }
  1711. break;
  1712. case 77:
  1713. /* Line 1806 of yacc.c */
  1714. #line 365 "zconf.y"
  1715. {
  1716. (yyval.menu) = menu_add_menu();
  1717. }
  1718. break;
  1719. case 78:
  1720. /* Line 1806 of yacc.c */
  1721. #line 370 "zconf.y"
  1722. {
  1723. if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) {
  1724. menu_end_menu();
  1725. printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
  1726. }
  1727. }
  1728. break;
  1729. case 84:
  1730. /* Line 1806 of yacc.c */
  1731. #line 388 "zconf.y"
  1732. {
  1733. printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
  1734. zconf_nextfile((yyvsp[(2) - (3)].string));
  1735. }
  1736. break;
  1737. case 85:
  1738. /* Line 1806 of yacc.c */
  1739. #line 396 "zconf.y"
  1740. {
  1741. menu_add_entry(NULL);
  1742. menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL);
  1743. printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
  1744. }
  1745. break;
  1746. case 86:
  1747. /* Line 1806 of yacc.c */
  1748. #line 403 "zconf.y"
  1749. {
  1750. menu_end_entry();
  1751. }
  1752. break;
  1753. case 87:
  1754. /* Line 1806 of yacc.c */
  1755. #line 410 "zconf.y"
  1756. {
  1757. printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
  1758. zconf_starthelp();
  1759. }
  1760. break;
  1761. case 88:
  1762. /* Line 1806 of yacc.c */
  1763. #line 416 "zconf.y"
  1764. {
  1765. current_entry->help = (yyvsp[(2) - (2)].string);
  1766. }
  1767. break;
  1768. case 93:
  1769. /* Line 1806 of yacc.c */
  1770. #line 430 "zconf.y"
  1771. {
  1772. menu_add_dep((yyvsp[(3) - (4)].expr));
  1773. printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
  1774. }
  1775. break;
  1776. case 97:
  1777. /* Line 1806 of yacc.c */
  1778. #line 444 "zconf.y"
  1779. {
  1780. menu_add_visibility((yyvsp[(2) - (2)].expr));
  1781. }
  1782. break;
  1783. case 99:
  1784. /* Line 1806 of yacc.c */
  1785. #line 453 "zconf.y"
  1786. {
  1787. menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
  1788. }
  1789. break;
  1790. case 102:
  1791. /* Line 1806 of yacc.c */
  1792. #line 461 "zconf.y"
  1793. { (yyval.id) = (yyvsp[(1) - (2)].id); }
  1794. break;
  1795. case 103:
  1796. /* Line 1806 of yacc.c */
  1797. #line 462 "zconf.y"
  1798. { (yyval.id) = (yyvsp[(1) - (2)].id); }
  1799. break;
  1800. case 104:
  1801. /* Line 1806 of yacc.c */
  1802. #line 463 "zconf.y"
  1803. { (yyval.id) = (yyvsp[(1) - (2)].id); }
  1804. break;
  1805. case 107:
  1806. /* Line 1806 of yacc.c */
  1807. #line 471 "zconf.y"
  1808. { (yyval.expr) = NULL; }
  1809. break;
  1810. case 108:
  1811. /* Line 1806 of yacc.c */
  1812. #line 472 "zconf.y"
  1813. { (yyval.expr) = (yyvsp[(2) - (2)].expr); }
  1814. break;
  1815. case 109:
  1816. /* Line 1806 of yacc.c */
  1817. #line 475 "zconf.y"
  1818. { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); }
  1819. break;
  1820. case 110:
  1821. /* Line 1806 of yacc.c */
  1822. #line 476 "zconf.y"
  1823. { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); }
  1824. break;
  1825. case 111:
  1826. /* Line 1806 of yacc.c */
  1827. #line 477 "zconf.y"
  1828. { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); }
  1829. break;
  1830. case 112:
  1831. /* Line 1806 of yacc.c */
  1832. #line 478 "zconf.y"
  1833. { (yyval.expr) = (yyvsp[(2) - (3)].expr); }
  1834. break;
  1835. case 113:
  1836. /* Line 1806 of yacc.c */
  1837. #line 479 "zconf.y"
  1838. { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); }
  1839. break;
  1840. case 114:
  1841. /* Line 1806 of yacc.c */
  1842. #line 480 "zconf.y"
  1843. { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
  1844. break;
  1845. case 115:
  1846. /* Line 1806 of yacc.c */
  1847. #line 481 "zconf.y"
  1848. { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
  1849. break;
  1850. case 116:
  1851. /* Line 1806 of yacc.c */
  1852. #line 484 "zconf.y"
  1853. { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); }
  1854. break;
  1855. case 117:
  1856. /* Line 1806 of yacc.c */
  1857. #line 485 "zconf.y"
  1858. { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); }
  1859. break;
  1860. case 118:
  1861. /* Line 1806 of yacc.c */
  1862. #line 488 "zconf.y"
  1863. { (yyval.string) = NULL; }
  1864. break;
  1865. /* Line 1806 of yacc.c */
  1866. #line 2204 "zconf.tab.c"
  1867. default: break;
  1868. }
  1869. /* User semantic actions sometimes alter yychar, and that requires
  1870. that yytoken be updated with the new translation. We take the
  1871. approach of translating immediately before every use of yytoken.
  1872. One alternative is translating here after every semantic action,
  1873. but that translation would be missed if the semantic action invokes
  1874. YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
  1875. if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
  1876. incorrect destructor might then be invoked immediately. In the
  1877. case of YYERROR or YYBACKUP, subsequent parser actions might lead
  1878. to an incorrect destructor call or verbose syntax error message
  1879. before the lookahead is translated. */
  1880. YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  1881. YYPOPSTACK (yylen);
  1882. yylen = 0;
  1883. YY_STACK_PRINT (yyss, yyssp);
  1884. *++yyvsp = yyval;
  1885. /* Now `shift' the result of the reduction. Determine what state
  1886. that goes to, based on the state we popped back to and the rule
  1887. number reduced by. */
  1888. yyn = yyr1[yyn];
  1889. yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  1890. if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1891. yystate = yytable[yystate];
  1892. else
  1893. yystate = yydefgoto[yyn - YYNTOKENS];
  1894. goto yynewstate;
  1895. /*------------------------------------.
  1896. | yyerrlab -- here on detecting error |
  1897. `------------------------------------*/
  1898. yyerrlab:
  1899. /* Make sure we have latest lookahead translation. See comments at
  1900. user semantic actions for why this is necessary. */
  1901. yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
  1902. /* If not already recovering from an error, report this error. */
  1903. if (!yyerrstatus)
  1904. {
  1905. ++yynerrs;
  1906. #if ! YYERROR_VERBOSE
  1907. yyerror (YY_("syntax error"));
  1908. #else
  1909. # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
  1910. yyssp, yytoken)
  1911. {
  1912. char const *yymsgp = YY_("syntax error");
  1913. int yysyntax_error_status;
  1914. yysyntax_error_status = YYSYNTAX_ERROR;
  1915. if (yysyntax_error_status == 0)
  1916. yymsgp = yymsg;
  1917. else if (yysyntax_error_status == 1)
  1918. {
  1919. if (yymsg != yymsgbuf)
  1920. YYSTACK_FREE (yymsg);
  1921. yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
  1922. if (!yymsg)
  1923. {
  1924. yymsg = yymsgbuf;
  1925. yymsg_alloc = sizeof yymsgbuf;
  1926. yysyntax_error_status = 2;
  1927. }
  1928. else
  1929. {
  1930. yysyntax_error_status = YYSYNTAX_ERROR;
  1931. yymsgp = yymsg;
  1932. }
  1933. }
  1934. yyerror (yymsgp);
  1935. if (yysyntax_error_status == 2)
  1936. goto yyexhaustedlab;
  1937. }
  1938. # undef YYSYNTAX_ERROR
  1939. #endif
  1940. }
  1941. if (yyerrstatus == 3)
  1942. {
  1943. /* If just tried and failed to reuse lookahead token after an
  1944. error, discard it. */
  1945. if (yychar <= YYEOF)
  1946. {
  1947. /* Return failure if at end of input. */
  1948. if (yychar == YYEOF)
  1949. YYABORT;
  1950. }
  1951. else
  1952. {
  1953. yydestruct ("Error: discarding",
  1954. yytoken, &yylval);
  1955. yychar = YYEMPTY;
  1956. }
  1957. }
  1958. /* Else will try to reuse lookahead token after shifting the error
  1959. token. */
  1960. goto yyerrlab1;
  1961. /*---------------------------------------------------.
  1962. | yyerrorlab -- error raised explicitly by YYERROR. |
  1963. `---------------------------------------------------*/
  1964. yyerrorlab:
  1965. /* Pacify compilers like GCC when the user code never invokes
  1966. YYERROR and the label yyerrorlab therefore never appears in user
  1967. code. */
  1968. if (/*CONSTCOND*/ 0)
  1969. goto yyerrorlab;
  1970. /* Do not reclaim the symbols of the rule which action triggered
  1971. this YYERROR. */
  1972. YYPOPSTACK (yylen);
  1973. yylen = 0;
  1974. YY_STACK_PRINT (yyss, yyssp);
  1975. yystate = *yyssp;
  1976. goto yyerrlab1;
  1977. /*-------------------------------------------------------------.
  1978. | yyerrlab1 -- common code for both syntax error and YYERROR. |
  1979. `-------------------------------------------------------------*/
  1980. yyerrlab1:
  1981. yyerrstatus = 3; /* Each real token shifted decrements this. */
  1982. for (;;)
  1983. {
  1984. yyn = yypact[yystate];
  1985. if (!yypact_value_is_default (yyn))
  1986. {
  1987. yyn += YYTERROR;
  1988. if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  1989. {
  1990. yyn = yytable[yyn];
  1991. if (0 < yyn)
  1992. break;
  1993. }
  1994. }
  1995. /* Pop the current state because it cannot handle the error token. */
  1996. if (yyssp == yyss)
  1997. YYABORT;
  1998. yydestruct ("Error: popping",
  1999. yystos[yystate], yyvsp);
  2000. YYPOPSTACK (1);
  2001. yystate = *yyssp;
  2002. YY_STACK_PRINT (yyss, yyssp);
  2003. }
  2004. *++yyvsp = yylval;
  2005. /* Shift the error token. */
  2006. YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
  2007. yystate = yyn;
  2008. goto yynewstate;
  2009. /*-------------------------------------.
  2010. | yyacceptlab -- YYACCEPT comes here. |
  2011. `-------------------------------------*/
  2012. yyacceptlab:
  2013. yyresult = 0;
  2014. goto yyreturn;
  2015. /*-----------------------------------.
  2016. | yyabortlab -- YYABORT comes here. |
  2017. `-----------------------------------*/
  2018. yyabortlab:
  2019. yyresult = 1;
  2020. goto yyreturn;
  2021. #if !defined(yyoverflow) || YYERROR_VERBOSE
  2022. /*-------------------------------------------------.
  2023. | yyexhaustedlab -- memory exhaustion comes here. |
  2024. `-------------------------------------------------*/
  2025. yyexhaustedlab:
  2026. yyerror (YY_("memory exhausted"));
  2027. yyresult = 2;
  2028. /* Fall through. */
  2029. #endif
  2030. yyreturn:
  2031. if (yychar != YYEMPTY)
  2032. {
  2033. /* Make sure we have latest lookahead translation. See comments at
  2034. user semantic actions for why this is necessary. */
  2035. yytoken = YYTRANSLATE (yychar);
  2036. yydestruct ("Cleanup: discarding lookahead",
  2037. yytoken, &yylval);
  2038. }
  2039. /* Do not reclaim the symbols of the rule which action triggered
  2040. this YYABORT or YYACCEPT. */
  2041. YYPOPSTACK (yylen);
  2042. YY_STACK_PRINT (yyss, yyssp);
  2043. while (yyssp != yyss)
  2044. {
  2045. yydestruct ("Cleanup: popping",
  2046. yystos[*yyssp], yyvsp);
  2047. YYPOPSTACK (1);
  2048. }
  2049. #ifndef yyoverflow
  2050. if (yyss != yyssa)
  2051. YYSTACK_FREE (yyss);
  2052. #endif
  2053. #if YYERROR_VERBOSE
  2054. if (yymsg != yymsgbuf)
  2055. YYSTACK_FREE (yymsg);
  2056. #endif
  2057. /* Make sure YYID is used. */
  2058. return YYID (yyresult);
  2059. }
  2060. /* Line 2067 of yacc.c */
  2061. #line 491 "zconf.y"
  2062. void conf_parse(const char *name)
  2063. {
  2064. struct symbol *sym;
  2065. int i;
  2066. zconf_initscan(name);
  2067. sym_init();
  2068. _menu_init();
  2069. rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
  2070. if (getenv("ZCONF_DEBUG"))
  2071. zconfdebug = 1;
  2072. zconfparse();
  2073. if (zconfnerrs)
  2074. exit(1);
  2075. if (!modules_sym)
  2076. modules_sym = sym_find( "n" );
  2077. rootmenu.prompt->text = _(rootmenu.prompt->text);
  2078. rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
  2079. menu_finalize(&rootmenu);
  2080. for_all_symbols(i, sym) {
  2081. if (sym_check_deps(sym))
  2082. zconfnerrs++;
  2083. }
  2084. if (zconfnerrs)
  2085. exit(1);
  2086. sym_set_change_count(1);
  2087. }
  2088. static const char *zconf_tokenname(int token)
  2089. {
  2090. switch (token) {
  2091. case T_MENU: return "menu";
  2092. case T_ENDMENU: return "endmenu";
  2093. case T_CHOICE: return "choice";
  2094. case T_ENDCHOICE: return "endchoice";
  2095. case T_IF: return "if";
  2096. case T_ENDIF: return "endif";
  2097. case T_DEPENDS: return "depends";
  2098. case T_VISIBLE: return "visible";
  2099. }
  2100. return "<token>";
  2101. }
  2102. static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken)
  2103. {
  2104. if (id->token != endtoken) {
  2105. zconf_error("unexpected '%s' within %s block",
  2106. kconf_id_strings + id->name, zconf_tokenname(starttoken));
  2107. zconfnerrs++;
  2108. return false;
  2109. }
  2110. if (current_menu->file != current_file) {
  2111. zconf_error("'%s' in different file than '%s'",
  2112. kconf_id_strings + id->name, zconf_tokenname(starttoken));
  2113. fprintf(stderr, "%s:%d: location of the '%s'\n",
  2114. current_menu->file->name, current_menu->lineno,
  2115. zconf_tokenname(starttoken));
  2116. zconfnerrs++;
  2117. return false;
  2118. }
  2119. return true;
  2120. }
  2121. static void zconfprint(const char *err, ...)
  2122. {
  2123. va_list ap;
  2124. fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
  2125. va_start(ap, err);
  2126. vfprintf(stderr, err, ap);
  2127. va_end(ap);
  2128. fprintf(stderr, "\n");
  2129. }
  2130. static void zconf_error(const char *err, ...)
  2131. {
  2132. va_list ap;
  2133. zconfnerrs++;
  2134. fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
  2135. va_start(ap, err);
  2136. vfprintf(stderr, err, ap);
  2137. va_end(ap);
  2138. fprintf(stderr, "\n");
  2139. }
  2140. static void zconferror(const char *err)
  2141. {
  2142. fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
  2143. }
  2144. static void print_quoted_string(FILE *out, const char *str)
  2145. {
  2146. const char *p;
  2147. int len;
  2148. putc('"', out);
  2149. while ((p = strchr(str, '"'))) {
  2150. len = p - str;
  2151. if (len)
  2152. fprintf(out, "%.*s", len, str);
  2153. fputs("\\\"", out);
  2154. str = p + 1;
  2155. }
  2156. fputs(str, out);
  2157. putc('"', out);
  2158. }
  2159. static void print_symbol(FILE *out, struct menu *menu)
  2160. {
  2161. struct symbol *sym = menu->sym;
  2162. struct property *prop;
  2163. if (sym_is_choice(sym))
  2164. fprintf(out, "\nchoice\n");
  2165. else
  2166. fprintf(out, "\nconfig %s\n", sym->name);
  2167. switch (sym->type) {
  2168. case S_BOOLEAN:
  2169. fputs(" boolean\n", out);
  2170. break;
  2171. case S_TRISTATE:
  2172. fputs(" tristate\n", out);
  2173. break;
  2174. case S_STRING:
  2175. fputs(" string\n", out);
  2176. break;
  2177. case S_INT:
  2178. fputs(" integer\n", out);
  2179. break;
  2180. case S_HEX:
  2181. fputs(" hex\n", out);
  2182. break;
  2183. default:
  2184. fputs(" ???\n", out);
  2185. break;
  2186. }
  2187. for (prop = sym->prop; prop; prop = prop->next) {
  2188. if (prop->menu != menu)
  2189. continue;
  2190. switch (prop->type) {
  2191. case P_PROMPT:
  2192. fputs(" prompt ", out);
  2193. print_quoted_string(out, prop->text);
  2194. if (!expr_is_yes(prop->visible.expr)) {
  2195. fputs(" if ", out);
  2196. expr_fprint(prop->visible.expr, out);
  2197. }
  2198. fputc('\n', out);
  2199. break;
  2200. case P_DEFAULT:
  2201. fputs( " default ", out);
  2202. expr_fprint(prop->expr, out);
  2203. if (!expr_is_yes(prop->visible.expr)) {
  2204. fputs(" if ", out);
  2205. expr_fprint(prop->visible.expr, out);
  2206. }
  2207. fputc('\n', out);
  2208. break;
  2209. case P_CHOICE:
  2210. fputs(" #choice value\n", out);
  2211. break;
  2212. case P_SELECT:
  2213. fputs( " select ", out);
  2214. expr_fprint(prop->expr, out);
  2215. if (prop->value) {
  2216. fputs(" (value=", out);
  2217. expr_fprint(prop->value, out);
  2218. fputc(')', out);
  2219. }
  2220. if (!expr_is_yes(prop->visible.expr)) {
  2221. fputs(" if ", out);
  2222. expr_fprint(prop->visible.expr, out);
  2223. }
  2224. fputc('\n', out);
  2225. break;
  2226. case P_RANGE:
  2227. fputs( " range ", out);
  2228. expr_fprint(prop->expr, out);
  2229. fputc('\n', out);
  2230. break;
  2231. case P_MENU:
  2232. fputs( " menu ", out);
  2233. print_quoted_string(out, prop->text);
  2234. fputc('\n', out);
  2235. break;
  2236. default:
  2237. fprintf(out, " unknown prop %d!\n", prop->type);
  2238. break;
  2239. }
  2240. }
  2241. if (menu->help) {
  2242. int len = strlen(menu->help);
  2243. while (menu->help[--len] == '\n')
  2244. menu->help[len] = 0;
  2245. fprintf(out, " help\n%s\n", menu->help);
  2246. }
  2247. }
  2248. void zconfdump(FILE *out)
  2249. {
  2250. struct property *prop;
  2251. struct symbol *sym;
  2252. struct menu *menu;
  2253. menu = rootmenu.list;
  2254. while (menu) {
  2255. if ((sym = menu->sym))
  2256. print_symbol(out, menu);
  2257. else if ((prop = menu->prompt)) {
  2258. switch (prop->type) {
  2259. case P_COMMENT:
  2260. fputs("\ncomment ", out);
  2261. print_quoted_string(out, prop->text);
  2262. fputs("\n", out);
  2263. break;
  2264. case P_MENU:
  2265. fputs("\nmenu ", out);
  2266. print_quoted_string(out, prop->text);
  2267. fputs("\n", out);
  2268. break;
  2269. default:
  2270. ;
  2271. }
  2272. if (!expr_is_yes(prop->visible.expr)) {
  2273. fputs(" depends ", out);
  2274. expr_fprint(prop->visible.expr, out);
  2275. fputc('\n', out);
  2276. }
  2277. }
  2278. if (menu->list)
  2279. menu = menu->list;
  2280. else if (menu->next)
  2281. menu = menu->next;
  2282. else while ((menu = menu->parent)) {
  2283. if (menu->prompt && menu->prompt->type == P_MENU)
  2284. fputs("\nendmenu\n", out);
  2285. if (menu->next) {
  2286. menu = menu->next;
  2287. break;
  2288. }
  2289. }
  2290. }
  2291. }
  2292. #include "zconf.lex.c"
  2293. #include "util.c"
  2294. #include "confdata.c"
  2295. #include "expr.c"
  2296. #include "symbol.c"
  2297. #include "menu.c"