zconf.tab.c_shipped 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554
  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. rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
  1927. #if YYDEBUG
  1928. if (getenv("ZCONF_DEBUG"))
  1929. zconfdebug = 1;
  1930. #endif
  1931. zconfparse();
  1932. if (zconfnerrs)
  1933. exit(1);
  1934. if (!modules_sym)
  1935. modules_sym = sym_find( "n" );
  1936. rootmenu.prompt->text = _(rootmenu.prompt->text);
  1937. rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
  1938. menu_finalize(&rootmenu);
  1939. for_all_symbols(i, sym) {
  1940. if (sym_check_deps(sym))
  1941. zconfnerrs++;
  1942. }
  1943. if (zconfnerrs)
  1944. exit(1);
  1945. sym_set_change_count(1);
  1946. }
  1947. static const char *zconf_tokenname(int token)
  1948. {
  1949. switch (token) {
  1950. case T_MENU: return "menu";
  1951. case T_ENDMENU: return "endmenu";
  1952. case T_CHOICE: return "choice";
  1953. case T_ENDCHOICE: return "endchoice";
  1954. case T_IF: return "if";
  1955. case T_ENDIF: return "endif";
  1956. case T_DEPENDS: return "depends";
  1957. case T_VISIBLE: return "visible";
  1958. }
  1959. return "<token>";
  1960. }
  1961. static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken)
  1962. {
  1963. if (id->token != endtoken) {
  1964. zconf_error("unexpected '%s' within %s block",
  1965. kconf_id_strings + id->name, zconf_tokenname(starttoken));
  1966. zconfnerrs++;
  1967. return false;
  1968. }
  1969. if (current_menu->file != current_file) {
  1970. zconf_error("'%s' in different file than '%s'",
  1971. kconf_id_strings + id->name, zconf_tokenname(starttoken));
  1972. fprintf(stderr, "%s:%d: location of the '%s'\n",
  1973. current_menu->file->name, current_menu->lineno,
  1974. zconf_tokenname(starttoken));
  1975. zconfnerrs++;
  1976. return false;
  1977. }
  1978. return true;
  1979. }
  1980. static void zconfprint(const char *err, ...)
  1981. {
  1982. va_list ap;
  1983. fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
  1984. va_start(ap, err);
  1985. vfprintf(stderr, err, ap);
  1986. va_end(ap);
  1987. fprintf(stderr, "\n");
  1988. }
  1989. static void zconf_error(const char *err, ...)
  1990. {
  1991. va_list ap;
  1992. zconfnerrs++;
  1993. fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
  1994. va_start(ap, err);
  1995. vfprintf(stderr, err, ap);
  1996. va_end(ap);
  1997. fprintf(stderr, "\n");
  1998. }
  1999. static void zconferror(const char *err)
  2000. {
  2001. fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
  2002. }
  2003. static void print_quoted_string(FILE *out, const char *str)
  2004. {
  2005. const char *p;
  2006. int len;
  2007. putc('"', out);
  2008. while ((p = strchr(str, '"'))) {
  2009. len = p - str;
  2010. if (len)
  2011. fprintf(out, "%.*s", len, str);
  2012. fputs("\\\"", out);
  2013. str = p + 1;
  2014. }
  2015. fputs(str, out);
  2016. putc('"', out);
  2017. }
  2018. static void print_symbol(FILE *out, struct menu *menu)
  2019. {
  2020. struct symbol *sym = menu->sym;
  2021. struct property *prop;
  2022. if (sym_is_choice(sym))
  2023. fprintf(out, "\nchoice\n");
  2024. else
  2025. fprintf(out, "\nconfig %s\n", sym->name);
  2026. switch (sym->type) {
  2027. case S_BOOLEAN:
  2028. fputs(" boolean\n", out);
  2029. break;
  2030. case S_TRISTATE:
  2031. fputs(" tristate\n", out);
  2032. break;
  2033. case S_STRING:
  2034. fputs(" string\n", out);
  2035. break;
  2036. case S_INT:
  2037. fputs(" integer\n", out);
  2038. break;
  2039. case S_HEX:
  2040. fputs(" hex\n", out);
  2041. break;
  2042. default:
  2043. fputs(" ???\n", out);
  2044. break;
  2045. }
  2046. for (prop = sym->prop; prop; prop = prop->next) {
  2047. if (prop->menu != menu)
  2048. continue;
  2049. switch (prop->type) {
  2050. case P_PROMPT:
  2051. fputs(" prompt ", out);
  2052. print_quoted_string(out, prop->text);
  2053. if (!expr_is_yes(prop->visible.expr)) {
  2054. fputs(" if ", out);
  2055. expr_fprint(prop->visible.expr, out);
  2056. }
  2057. fputc('\n', out);
  2058. break;
  2059. case P_DEFAULT:
  2060. fputs( " default ", out);
  2061. expr_fprint(prop->expr, out);
  2062. if (!expr_is_yes(prop->visible.expr)) {
  2063. fputs(" if ", out);
  2064. expr_fprint(prop->visible.expr, out);
  2065. }
  2066. fputc('\n', out);
  2067. break;
  2068. case P_CHOICE:
  2069. fputs(" #choice value\n", out);
  2070. break;
  2071. case P_SELECT:
  2072. fputs( " select ", out);
  2073. expr_fprint(prop->expr, out);
  2074. fputc('\n', out);
  2075. break;
  2076. case P_RANGE:
  2077. fputs( " range ", out);
  2078. expr_fprint(prop->expr, out);
  2079. fputc('\n', out);
  2080. break;
  2081. case P_MENU:
  2082. fputs( " menu ", out);
  2083. print_quoted_string(out, prop->text);
  2084. fputc('\n', out);
  2085. break;
  2086. default:
  2087. fprintf(out, " unknown prop %d!\n", prop->type);
  2088. break;
  2089. }
  2090. }
  2091. if (menu->help) {
  2092. int len = strlen(menu->help);
  2093. while (menu->help[--len] == '\n')
  2094. menu->help[len] = 0;
  2095. fprintf(out, " help\n%s\n", menu->help);
  2096. }
  2097. }
  2098. void zconfdump(FILE *out)
  2099. {
  2100. struct property *prop;
  2101. struct symbol *sym;
  2102. struct menu *menu;
  2103. menu = rootmenu.list;
  2104. while (menu) {
  2105. if ((sym = menu->sym))
  2106. print_symbol(out, menu);
  2107. else if ((prop = menu->prompt)) {
  2108. switch (prop->type) {
  2109. case P_COMMENT:
  2110. fputs("\ncomment ", out);
  2111. print_quoted_string(out, prop->text);
  2112. fputs("\n", out);
  2113. break;
  2114. case P_MENU:
  2115. fputs("\nmenu ", out);
  2116. print_quoted_string(out, prop->text);
  2117. fputs("\n", out);
  2118. break;
  2119. default:
  2120. ;
  2121. }
  2122. if (!expr_is_yes(prop->visible.expr)) {
  2123. fputs(" depends ", out);
  2124. expr_fprint(prop->visible.expr, out);
  2125. fputc('\n', out);
  2126. }
  2127. }
  2128. if (menu->list)
  2129. menu = menu->list;
  2130. else if (menu->next)
  2131. menu = menu->next;
  2132. else while ((menu = menu->parent)) {
  2133. if (menu->prompt && menu->prompt->type == P_MENU)
  2134. fputs("\nendmenu\n", out);
  2135. if (menu->next) {
  2136. menu = menu->next;
  2137. break;
  2138. }
  2139. }
  2140. }
  2141. }
  2142. #include "zconf.lex.c"
  2143. #include "util.c"
  2144. #include "confdata.c"
  2145. #include "expr.c"
  2146. #include "symbol.c"
  2147. #include "menu.c"