zconf.tab.c_shipped 72 KB

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