cmCommandArgumentParser.cxx 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461
  1. /* A Bison parser, made by GNU Bison 1.875d. */
  2. /* Skeleton parser for Yacc-like parsing with Bison,
  3. Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software
  4. 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., 59 Temple Place - Suite 330,
  16. Boston, MA 02111-1307, USA. */
  17. /* As a special exception, when this file is copied by Bison into a
  18. Bison output file, you may use that output file without restriction.
  19. This special exception was added by the Free Software Foundation
  20. in version 1.24 of Bison. */
  21. /* Written by Richard Stallman by simplifying the original so called
  22. ``semantic'' parser. */
  23. /* All symbols defined below should begin with yy or YY, to avoid
  24. infringing on user name space. This should be done even for local
  25. variables, as they might otherwise be expanded by user macros.
  26. There are some unavoidable exceptions within include files to
  27. define necessary library symbols; they are noted "INFRINGES ON
  28. USER NAME SPACE" below. */
  29. /* Identify Bison output. */
  30. #define YYBISON 1
  31. /* Skeleton name. */
  32. #define YYSKELETON_NAME "yacc.c"
  33. /* Pure parsers. */
  34. #define YYPURE 1
  35. /* Using locations. */
  36. #define YYLSP_NEEDED 0
  37. /* If NAME_PREFIX is specified substitute the variables and functions
  38. names. */
  39. #define yyparse cmCommandArgument_yyparse
  40. #define yylex cmCommandArgument_yylex
  41. #define yyerror cmCommandArgument_yyerror
  42. #define yylval cmCommandArgument_yylval
  43. #define yychar cmCommandArgument_yychar
  44. #define yydebug cmCommandArgument_yydebug
  45. #define yynerrs cmCommandArgument_yynerrs
  46. /* Tokens. */
  47. #ifndef YYTOKENTYPE
  48. # define YYTOKENTYPE
  49. /* Put the tokens into the symbol table, so that GDB and other debuggers
  50. know about them. */
  51. enum yytokentype {
  52. cal_NCURLY = 258,
  53. cal_DCURLY = 259,
  54. cal_DOLLAR = 260,
  55. cal_LCURLY = 261,
  56. cal_RCURLY = 262,
  57. cal_NAME = 263,
  58. cal_BSLASH = 264,
  59. cal_SYMBOL = 265,
  60. cal_AT = 266,
  61. cal_ERROR = 267,
  62. cal_ATNAME = 268
  63. };
  64. #endif
  65. #define cal_NCURLY 258
  66. #define cal_DCURLY 259
  67. #define cal_DOLLAR 260
  68. #define cal_LCURLY 261
  69. #define cal_RCURLY 262
  70. #define cal_NAME 263
  71. #define cal_BSLASH 264
  72. #define cal_SYMBOL 265
  73. #define cal_AT 266
  74. #define cal_ERROR 267
  75. #define cal_ATNAME 268
  76. /* Copy the first part of user declarations. */
  77. /*=========================================================================
  78. Program: CMake - Cross-Platform Makefile Generator
  79. Module: $RCSfile$
  80. Language: C++
  81. Date: $Date$
  82. Version: $Revision$
  83. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  84. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  85. This software is distributed WITHOUT ANY WARRANTY; without even
  86. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  87. PURPOSE. See the above copyright notices for more information.
  88. =========================================================================*/
  89. /*
  90. This file must be translated to C and modified to build everywhere.
  91. Run bison like this:
  92. bison --yacc --name-prefix=cmCommandArgument_yy \
  93. --defines=cmCommandArgumentParserTokens.h \
  94. -ocmCommandArgumentParser.cxx cmCommandArgumentParser.y
  95. Modify cmCommandArgumentParser.cxx:
  96. - remove TABs
  97. - add __HP_aCC to the #if test for yyerrorlab warning suppression
  98. */
  99. /* Configure the parser to use a lexer object. */
  100. #define YYPARSE_PARAM yyscanner
  101. #define YYLEX_PARAM yyscanner
  102. #define YYERROR_VERBOSE 1
  103. #define cmCommandArgument_yyerror(x) \
  104. cmCommandArgumentError(yyscanner, x)
  105. #define yyGetParser (cmCommandArgument_yyget_extra(yyscanner))
  106. /*-------------------------------------------------------------------------*/
  107. #include "cmCommandArgumentParserHelper.h" /* Interface to parser object. */
  108. #include "cmCommandArgumentLexer.h" /* Interface to lexer object. */
  109. #include "cmCommandArgumentParserTokens.h" /* Need YYSTYPE for YY_DECL. */
  110. /* Forward declare the lexer entry point. */
  111. YY_DECL;
  112. /* Internal utility functions. */
  113. static void cmCommandArgumentError(yyscan_t yyscanner, const char* message);
  114. #define YYDEBUG 1
  115. //#define YYMAXDEPTH 100000
  116. //#define YYINITDEPTH 10000
  117. /* Disable some warnings in the generated code. */
  118. #ifdef __BORLANDC__
  119. # pragma warn -8004 /* Variable assigned a value that is not used. */
  120. #endif
  121. #ifdef _MSC_VER
  122. # pragma warning (disable: 4102) /* Unused goto label. */
  123. # pragma warning (disable: 4065) /* Switch contains default but no case. */
  124. #endif
  125. /* Enabling traces. */
  126. #ifndef YYDEBUG
  127. # define YYDEBUG 0
  128. #endif
  129. /* Enabling verbose error messages. */
  130. #ifdef YYERROR_VERBOSE
  131. # undef YYERROR_VERBOSE
  132. # define YYERROR_VERBOSE 1
  133. #else
  134. # define YYERROR_VERBOSE 0
  135. #endif
  136. #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
  137. typedef int YYSTYPE;
  138. # define yystype YYSTYPE /* obsolescent; will be withdrawn */
  139. # define YYSTYPE_IS_DECLARED 1
  140. # define YYSTYPE_IS_TRIVIAL 1
  141. #endif
  142. /* Copy the second part of user declarations. */
  143. /* Line 214 of yacc.c. */
  144. #if ! defined (yyoverflow) || YYERROR_VERBOSE
  145. # ifndef YYFREE
  146. # define YYFREE free
  147. # endif
  148. # ifndef YYMALLOC
  149. # define YYMALLOC malloc
  150. # endif
  151. /* The parser invokes alloca or malloc; define the necessary symbols. */
  152. # ifdef YYSTACK_USE_ALLOCA
  153. # if YYSTACK_USE_ALLOCA
  154. # define YYSTACK_ALLOC alloca
  155. # endif
  156. # else
  157. # if defined (alloca) || defined (_ALLOCA_H)
  158. # define YYSTACK_ALLOC alloca
  159. # else
  160. # ifdef __GNUC__
  161. # define YYSTACK_ALLOC __builtin_alloca
  162. # endif
  163. # endif
  164. # endif
  165. # ifdef YYSTACK_ALLOC
  166. /* Pacify GCC's `empty if-body' warning. */
  167. # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
  168. # else
  169. # if defined (__STDC__) || defined (__cplusplus)
  170. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  171. # define YYSIZE_T size_t
  172. # endif
  173. # define YYSTACK_ALLOC YYMALLOC
  174. # define YYSTACK_FREE YYFREE
  175. # endif
  176. #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
  177. #if (! defined (yyoverflow) \
  178. && (! defined (__cplusplus) \
  179. || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
  180. /* A type that is properly aligned for any stack member. */
  181. union yyalloc
  182. {
  183. short int yyss;
  184. YYSTYPE yyvs;
  185. };
  186. /* The size of the maximum gap between one aligned stack and the next. */
  187. # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  188. /* The size of an array large to enough to hold all stacks, each with
  189. N elements. */
  190. # define YYSTACK_BYTES(N) \
  191. ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
  192. + YYSTACK_GAP_MAXIMUM)
  193. /* Copy COUNT objects from FROM to TO. The source and destination do
  194. not overlap. */
  195. # ifndef YYCOPY
  196. # if defined (__GNUC__) && 1 < __GNUC__
  197. # define YYCOPY(To, From, Count) \
  198. __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
  199. # else
  200. # define YYCOPY(To, From, Count) \
  201. do \
  202. { \
  203. register YYSIZE_T yyi; \
  204. for (yyi = 0; yyi < (Count); yyi++) \
  205. (To)[yyi] = (From)[yyi]; \
  206. } \
  207. while (0)
  208. # endif
  209. # endif
  210. /* Relocate STACK from its old location to the new one. The
  211. local variables YYSIZE and YYSTACKSIZE give the old and new number of
  212. elements in the stack, and YYPTR gives the new location of the
  213. stack. Advance YYPTR to a properly aligned location for the next
  214. stack. */
  215. # define YYSTACK_RELOCATE(Stack) \
  216. do \
  217. { \
  218. YYSIZE_T yynewbytes; \
  219. YYCOPY (&yyptr->Stack, Stack, yysize); \
  220. Stack = &yyptr->Stack; \
  221. yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  222. yyptr += yynewbytes / sizeof (*yyptr); \
  223. } \
  224. while (0)
  225. #endif
  226. #if defined (__STDC__) || defined (__cplusplus)
  227. typedef signed char yysigned_char;
  228. #else
  229. typedef short int yysigned_char;
  230. #endif
  231. /* YYFINAL -- State number of the termination state. */
  232. #define YYFINAL 21
  233. /* YYLAST -- Last index in YYTABLE. */
  234. #define YYLAST 25
  235. /* YYNTOKENS -- Number of terminals. */
  236. #define YYNTOKENS 14
  237. /* YYNNTS -- Number of nonterminals. */
  238. #define YYNNTS 9
  239. /* YYNRULES -- Number of rules. */
  240. #define YYNRULES 21
  241. /* YYNRULES -- Number of states. */
  242. #define YYNSTATES 27
  243. /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
  244. #define YYUNDEFTOK 2
  245. #define YYMAXUTOK 268
  246. #define YYTRANSLATE(YYX) \
  247. ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  248. /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
  249. static const unsigned char yytranslate[] =
  250. {
  251. 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  252. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  253. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  254. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  255. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  256. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  257. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  258. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  259. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  260. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  261. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  262. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  263. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  264. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  265. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  266. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  267. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  268. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  269. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  270. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  271. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  272. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  273. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  274. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  275. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  276. 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
  277. 5, 6, 7, 8, 9, 10, 11, 12, 13
  278. };
  279. #if YYDEBUG
  280. /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
  281. YYRHS. */
  282. static const unsigned char yyprhs[] =
  283. {
  284. 0, 0, 3, 5, 7, 10, 11, 14, 16, 18,
  285. 20, 22, 24, 26, 28, 30, 34, 38, 40, 41,
  286. 44, 46
  287. };
  288. /* YYRHS -- A `-1'-separated list of the rules' RHS. */
  289. static const yysigned_char yyrhs[] =
  290. {
  291. 15, 0, -1, 16, -1, 17, -1, 17, 9, -1,
  292. -1, 18, 17, -1, 19, -1, 20, -1, 8, -1,
  293. 11, -1, 5, -1, 6, -1, 7, -1, 10, -1,
  294. 3, 21, 7, -1, 4, 21, 7, -1, 13, -1,
  295. -1, 22, 21, -1, 8, -1, 20, -1
  296. };
  297. /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
  298. static const unsigned char yyrline[] =
  299. {
  300. 0, 95, 95, 102, 107, 113, 117, 123, 128, 134,
  301. 139, 144, 149, 154, 159, 165, 171, 177, 183, 187,
  302. 193, 198
  303. };
  304. #endif
  305. #if YYDEBUG || YYERROR_VERBOSE
  306. /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  307. First, the terminals, then, starting at YYNTOKENS, nonterminals. */
  308. static const char *const yytname[] =
  309. {
  310. "$end", "error", "$undefined", "cal_NCURLY", "cal_DCURLY", "cal_DOLLAR",
  311. "cal_LCURLY", "cal_RCURLY", "cal_NAME", "cal_BSLASH", "cal_SYMBOL",
  312. "cal_AT", "cal_ERROR", "cal_ATNAME", "$accept", "Start",
  313. "GoalWithOptionalBackSlash", "Goal", "String", "OuterText", "Variable",
  314. "MultipleIds", "ID", 0
  315. };
  316. #endif
  317. # ifdef YYPRINT
  318. /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
  319. token YYLEX-NUM. */
  320. static const unsigned short int yytoknum[] =
  321. {
  322. 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
  323. 265, 266, 267, 268
  324. };
  325. # endif
  326. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
  327. static const unsigned char yyr1[] =
  328. {
  329. 0, 14, 15, 16, 16, 17, 17, 18, 18, 19,
  330. 19, 19, 19, 19, 19, 20, 20, 20, 21, 21,
  331. 22, 22
  332. };
  333. /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
  334. static const unsigned char yyr2[] =
  335. {
  336. 0, 2, 1, 1, 2, 0, 2, 1, 1, 1,
  337. 1, 1, 1, 1, 1, 3, 3, 1, 0, 2,
  338. 1, 1
  339. };
  340. /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
  341. STATE-NUM when YYTABLE doesn't specify something else to do. Zero
  342. means the default is an error. */
  343. static const unsigned char yydefact[] =
  344. {
  345. 5, 18, 18, 11, 12, 13, 9, 14, 10, 17,
  346. 0, 2, 3, 5, 7, 8, 20, 21, 0, 18,
  347. 0, 1, 4, 6, 15, 19, 16
  348. };
  349. /* YYDEFGOTO[NTERM-NUM]. */
  350. static const yysigned_char yydefgoto[] =
  351. {
  352. -1, 10, 11, 12, 13, 14, 17, 18, 19
  353. };
  354. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  355. STATE-NUM. */
  356. #define YYPACT_NINF -3
  357. static const yysigned_char yypact[] =
  358. {
  359. -1, 12, 12, -3, -3, -3, -3, -3, -3, -3,
  360. 8, -3, 2, -1, -3, -3, -3, -3, 6, 12,
  361. 11, -3, -3, -3, -3, -3, -3
  362. };
  363. /* YYPGOTO[NTERM-NUM]. */
  364. static const yysigned_char yypgoto[] =
  365. {
  366. -3, -3, -3, 9, -3, -3, 1, -2, -3
  367. };
  368. /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
  369. positive, shift that token. If negative, reduce the rule which
  370. number is the opposite. If zero, do what YYDEFACT says.
  371. If YYTABLE_NINF, syntax error. */
  372. #define YYTABLE_NINF -1
  373. static const unsigned char yytable[] =
  374. {
  375. 20, 15, 1, 2, 3, 4, 5, 6, 21, 7,
  376. 8, 22, 9, 24, 15, 1, 2, 25, 26, 0,
  377. 16, 0, 23, 0, 0, 9
  378. };
  379. static const yysigned_char yycheck[] =
  380. {
  381. 2, 0, 3, 4, 5, 6, 7, 8, 0, 10,
  382. 11, 9, 13, 7, 13, 3, 4, 19, 7, -1,
  383. 8, -1, 13, -1, -1, 13
  384. };
  385. /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  386. symbol of state STATE-NUM. */
  387. static const unsigned char yystos[] =
  388. {
  389. 0, 3, 4, 5, 6, 7, 8, 10, 11, 13,
  390. 15, 16, 17, 18, 19, 20, 8, 20, 21, 22,
  391. 21, 0, 9, 17, 7, 21, 7
  392. };
  393. #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
  394. # define YYSIZE_T __SIZE_TYPE__
  395. #endif
  396. #if ! defined (YYSIZE_T) && defined (size_t)
  397. # define YYSIZE_T size_t
  398. #endif
  399. #if ! defined (YYSIZE_T)
  400. # if defined (__STDC__) || defined (__cplusplus)
  401. # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  402. # define YYSIZE_T size_t
  403. # endif
  404. #endif
  405. #if ! defined (YYSIZE_T)
  406. # define YYSIZE_T unsigned int
  407. #endif
  408. #define yyerrok (yyerrstatus = 0)
  409. #define yyclearin (yychar = YYEMPTY)
  410. #define YYEMPTY (-2)
  411. #define YYEOF 0
  412. #define YYACCEPT goto yyacceptlab
  413. #define YYABORT goto yyabortlab
  414. #define YYERROR goto yyerrorlab
  415. /* Like YYERROR except do call yyerror. This remains here temporarily
  416. to ease the transition to the new meaning of YYERROR, for GCC.
  417. Once GCC version 2 has supplanted version 1, this can go. */
  418. #define YYFAIL goto yyerrlab
  419. #define YYRECOVERING() (!!yyerrstatus)
  420. #define YYBACKUP(Token, Value) \
  421. do \
  422. if (yychar == YYEMPTY && yylen == 1) \
  423. { \
  424. yychar = (Token); \
  425. yylval = (Value); \
  426. yytoken = YYTRANSLATE (yychar); \
  427. YYPOPSTACK; \
  428. goto yybackup; \
  429. } \
  430. else \
  431. { \
  432. yyerror ("syntax error: cannot back up");\
  433. YYERROR; \
  434. } \
  435. while (0)
  436. #define YYTERROR 1
  437. #define YYERRCODE 256
  438. /* YYLLOC_DEFAULT -- Compute the default location (before the actions
  439. are run). */
  440. #ifndef YYLLOC_DEFAULT
  441. # define YYLLOC_DEFAULT(Current, Rhs, N) \
  442. ((Current).first_line = (Rhs)[1].first_line, \
  443. (Current).first_column = (Rhs)[1].first_column, \
  444. (Current).last_line = (Rhs)[N].last_line, \
  445. (Current).last_column = (Rhs)[N].last_column)
  446. #endif
  447. /* YYLEX -- calling `yylex' with the right arguments. */
  448. #ifdef YYLEX_PARAM
  449. # define YYLEX yylex (&yylval, YYLEX_PARAM)
  450. #else
  451. # define YYLEX yylex (&yylval)
  452. #endif
  453. /* Enable debugging if requested. */
  454. #if YYDEBUG
  455. # ifndef YYFPRINTF
  456. # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
  457. # define YYFPRINTF fprintf
  458. # endif
  459. # define YYDPRINTF(Args) \
  460. do { \
  461. if (yydebug) \
  462. YYFPRINTF Args; \
  463. } while (0)
  464. # define YYDSYMPRINT(Args) \
  465. do { \
  466. if (yydebug) \
  467. yysymprint Args; \
  468. } while (0)
  469. # define YYDSYMPRINTF(Title, Token, Value, Location) \
  470. do { \
  471. if (yydebug) \
  472. { \
  473. YYFPRINTF (stderr, "%s ", Title); \
  474. yysymprint (stderr, \
  475. Token, Value); \
  476. YYFPRINTF (stderr, "\n"); \
  477. } \
  478. } while (0)
  479. /*------------------------------------------------------------------.
  480. | yy_stack_print -- Print the state stack from its BOTTOM up to its |
  481. | TOP (included). |
  482. `------------------------------------------------------------------*/
  483. #if defined (__STDC__) || defined (__cplusplus)
  484. static void
  485. yy_stack_print (short int *bottom, short int *top)
  486. #else
  487. static void
  488. yy_stack_print (bottom, top)
  489. short int *bottom;
  490. short int *top;
  491. #endif
  492. {
  493. YYFPRINTF (stderr, "Stack now");
  494. for (/* Nothing. */; bottom <= top; ++bottom)
  495. YYFPRINTF (stderr, " %d", *bottom);
  496. YYFPRINTF (stderr, "\n");
  497. }
  498. # define YY_STACK_PRINT(Bottom, Top) \
  499. do { \
  500. if (yydebug) \
  501. yy_stack_print ((Bottom), (Top)); \
  502. } while (0)
  503. /*------------------------------------------------.
  504. | Report that the YYRULE is going to be reduced. |
  505. `------------------------------------------------*/
  506. #if defined (__STDC__) || defined (__cplusplus)
  507. static void
  508. yy_reduce_print (int yyrule)
  509. #else
  510. static void
  511. yy_reduce_print (yyrule)
  512. int yyrule;
  513. #endif
  514. {
  515. int yyi;
  516. unsigned int yylno = yyrline[yyrule];
  517. YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
  518. yyrule - 1, yylno);
  519. /* Print the symbols being reduced, and their result. */
  520. for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
  521. YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
  522. YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
  523. }
  524. # define YY_REDUCE_PRINT(Rule) \
  525. do { \
  526. if (yydebug) \
  527. yy_reduce_print (Rule); \
  528. } while (0)
  529. /* Nonzero means print parse trace. It is left uninitialized so that
  530. multiple parsers can coexist. */
  531. int yydebug;
  532. #else /* !YYDEBUG */
  533. # define YYDPRINTF(Args)
  534. # define YYDSYMPRINT(Args)
  535. # define YYDSYMPRINTF(Title, Token, Value, Location)
  536. # define YY_STACK_PRINT(Bottom, Top)
  537. # define YY_REDUCE_PRINT(Rule)
  538. #endif /* !YYDEBUG */
  539. /* YYINITDEPTH -- initial size of the parser's stacks. */
  540. #ifndef YYINITDEPTH
  541. # define YYINITDEPTH 200
  542. #endif
  543. /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  544. if the built-in stack extension method is used).
  545. Do not make this value too large; the results are undefined if
  546. SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
  547. evaluated with infinite-precision integer arithmetic. */
  548. #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
  549. # undef YYMAXDEPTH
  550. #endif
  551. #ifndef YYMAXDEPTH
  552. # define YYMAXDEPTH 10000
  553. #endif
  554. #if YYERROR_VERBOSE
  555. # ifndef yystrlen
  556. # if defined (__GLIBC__) && defined (_STRING_H)
  557. # define yystrlen strlen
  558. # else
  559. /* Return the length of YYSTR. */
  560. static YYSIZE_T
  561. # if defined (__STDC__) || defined (__cplusplus)
  562. yystrlen (const char *yystr)
  563. # else
  564. yystrlen (yystr)
  565. const char *yystr;
  566. # endif
  567. {
  568. register const char *yys = yystr;
  569. while (*yys++ != '\0')
  570. continue;
  571. return yys - yystr - 1;
  572. }
  573. # endif
  574. # endif
  575. # ifndef yystpcpy
  576. # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
  577. # define yystpcpy stpcpy
  578. # else
  579. /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  580. YYDEST. */
  581. static char *
  582. # if defined (__STDC__) || defined (__cplusplus)
  583. yystpcpy (char *yydest, const char *yysrc)
  584. # else
  585. yystpcpy (yydest, yysrc)
  586. char *yydest;
  587. const char *yysrc;
  588. # endif
  589. {
  590. register char *yyd = yydest;
  591. register const char *yys = yysrc;
  592. while ((*yyd++ = *yys++) != '\0')
  593. continue;
  594. return yyd - 1;
  595. }
  596. # endif
  597. # endif
  598. #endif /* !YYERROR_VERBOSE */
  599. #if YYDEBUG
  600. /*--------------------------------.
  601. | Print this symbol on YYOUTPUT. |
  602. `--------------------------------*/
  603. #if defined (__STDC__) || defined (__cplusplus)
  604. static void
  605. yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
  606. #else
  607. static void
  608. yysymprint (yyoutput, yytype, yyvaluep)
  609. FILE *yyoutput;
  610. int yytype;
  611. YYSTYPE *yyvaluep;
  612. #endif
  613. {
  614. /* Pacify ``unused variable'' warnings. */
  615. (void) yyvaluep;
  616. if (yytype < YYNTOKENS)
  617. {
  618. YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
  619. # ifdef YYPRINT
  620. YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
  621. # endif
  622. }
  623. else
  624. YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
  625. switch (yytype)
  626. {
  627. default:
  628. break;
  629. }
  630. YYFPRINTF (yyoutput, ")");
  631. }
  632. #endif /* ! YYDEBUG */
  633. /*-----------------------------------------------.
  634. | Release the memory associated to this symbol. |
  635. `-----------------------------------------------*/
  636. #if defined (__STDC__) || defined (__cplusplus)
  637. static void
  638. yydestruct (int yytype, YYSTYPE *yyvaluep)
  639. #else
  640. static void
  641. yydestruct (yytype, yyvaluep)
  642. int yytype;
  643. YYSTYPE *yyvaluep;
  644. #endif
  645. {
  646. /* Pacify ``unused variable'' warnings. */
  647. (void) yyvaluep;
  648. switch (yytype)
  649. {
  650. default:
  651. break;
  652. }
  653. }
  654. /* Prevent warnings from -Wmissing-prototypes. */
  655. #ifdef YYPARSE_PARAM
  656. # if defined (__STDC__) || defined (__cplusplus)
  657. int yyparse (void *YYPARSE_PARAM);
  658. # else
  659. int yyparse ();
  660. # endif
  661. #else /* ! YYPARSE_PARAM */
  662. #if defined (__STDC__) || defined (__cplusplus)
  663. int yyparse (void);
  664. #else
  665. int yyparse ();
  666. #endif
  667. #endif /* ! YYPARSE_PARAM */
  668. /*----------.
  669. | yyparse. |
  670. `----------*/
  671. #ifdef YYPARSE_PARAM
  672. # if defined (__STDC__) || defined (__cplusplus)
  673. int yyparse (void *YYPARSE_PARAM)
  674. # else
  675. int yyparse (YYPARSE_PARAM)
  676. void *YYPARSE_PARAM;
  677. # endif
  678. #else /* ! YYPARSE_PARAM */
  679. #if defined (__STDC__) || defined (__cplusplus)
  680. int
  681. yyparse (void)
  682. #else
  683. int
  684. yyparse ()
  685. #endif
  686. #endif
  687. {
  688. /* The lookahead symbol. */
  689. int yychar;
  690. /* The semantic value of the lookahead symbol. */
  691. YYSTYPE yylval;
  692. /* Number of syntax errors so far. */
  693. int yynerrs;
  694. register int yystate;
  695. register int yyn;
  696. int yyresult;
  697. /* Number of tokens to shift before error messages enabled. */
  698. int yyerrstatus;
  699. /* Lookahead token as an internal (translated) token number. */
  700. int yytoken = 0;
  701. /* Three stacks and their tools:
  702. `yyss': related to states,
  703. `yyvs': related to semantic values,
  704. `yyls': related to locations.
  705. Refer to the stacks thru separate pointers, to allow yyoverflow
  706. to reallocate them elsewhere. */
  707. /* The state stack. */
  708. short int yyssa[YYINITDEPTH];
  709. short int *yyss = yyssa;
  710. register short int *yyssp;
  711. /* The semantic value stack. */
  712. YYSTYPE yyvsa[YYINITDEPTH];
  713. YYSTYPE *yyvs = yyvsa;
  714. register YYSTYPE *yyvsp;
  715. #define YYPOPSTACK (yyvsp--, yyssp--)
  716. YYSIZE_T yystacksize = YYINITDEPTH;
  717. /* The variables used to return semantic value and location from the
  718. action routines. */
  719. YYSTYPE yyval;
  720. /* When reducing, the number of symbols on the RHS of the reduced
  721. rule. */
  722. int yylen;
  723. YYDPRINTF ((stderr, "Starting parse\n"));
  724. yystate = 0;
  725. yyerrstatus = 0;
  726. yynerrs = 0;
  727. yychar = YYEMPTY; /* Cause a token to be read. */
  728. /* Initialize stack pointers.
  729. Waste one element of value and location stack
  730. so that they stay on the same level as the state stack.
  731. The wasted elements are never initialized. */
  732. yyssp = yyss;
  733. yyvsp = yyvs;
  734. goto yysetstate;
  735. /*------------------------------------------------------------.
  736. | yynewstate -- Push a new state, which is found in yystate. |
  737. `------------------------------------------------------------*/
  738. yynewstate:
  739. /* In all cases, when you get here, the value and location stacks
  740. have just been pushed. so pushing a state here evens the stacks.
  741. */
  742. yyssp++;
  743. yysetstate:
  744. *yyssp = yystate;
  745. if (yyss + yystacksize - 1 <= yyssp)
  746. {
  747. /* Get the current used size of the three stacks, in elements. */
  748. YYSIZE_T yysize = yyssp - yyss + 1;
  749. #ifdef yyoverflow
  750. {
  751. /* Give user a chance to reallocate the stack. Use copies of
  752. these so that the &'s don't force the real ones into
  753. memory. */
  754. YYSTYPE *yyvs1 = yyvs;
  755. short int *yyss1 = yyss;
  756. /* Each stack pointer address is followed by the size of the
  757. data in use in that stack, in bytes. This used to be a
  758. conditional around just the two extra args, but that might
  759. be undefined if yyoverflow is a macro. */
  760. yyoverflow ("parser stack overflow",
  761. &yyss1, yysize * sizeof (*yyssp),
  762. &yyvs1, yysize * sizeof (*yyvsp),
  763. &yystacksize);
  764. yyss = yyss1;
  765. yyvs = yyvs1;
  766. }
  767. #else /* no yyoverflow */
  768. # ifndef YYSTACK_RELOCATE
  769. goto yyoverflowlab;
  770. # else
  771. /* Extend the stack our own way. */
  772. if (YYMAXDEPTH <= yystacksize)
  773. goto yyoverflowlab;
  774. yystacksize *= 2;
  775. if (YYMAXDEPTH < yystacksize)
  776. yystacksize = YYMAXDEPTH;
  777. {
  778. short int *yyss1 = yyss;
  779. union yyalloc *yyptr =
  780. (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  781. if (! yyptr)
  782. goto yyoverflowlab;
  783. YYSTACK_RELOCATE (yyss);
  784. YYSTACK_RELOCATE (yyvs);
  785. # undef YYSTACK_RELOCATE
  786. if (yyss1 != yyssa)
  787. YYSTACK_FREE (yyss1);
  788. }
  789. # endif
  790. #endif /* no yyoverflow */
  791. yyssp = yyss + yysize - 1;
  792. yyvsp = yyvs + yysize - 1;
  793. YYDPRINTF ((stderr, "Stack size increased to %lu\n",
  794. (unsigned long int) yystacksize));
  795. if (yyss + yystacksize - 1 <= yyssp)
  796. YYABORT;
  797. }
  798. YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  799. goto yybackup;
  800. /*-----------.
  801. | yybackup. |
  802. `-----------*/
  803. yybackup:
  804. /* Do appropriate processing given the current state. */
  805. /* Read a lookahead token if we need one and don't already have one. */
  806. /* yyresume: */
  807. /* First try to decide what to do without reference to lookahead token. */
  808. yyn = yypact[yystate];
  809. if (yyn == YYPACT_NINF)
  810. goto yydefault;
  811. /* Not known => get a lookahead token if don't already have one. */
  812. /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
  813. if (yychar == YYEMPTY)
  814. {
  815. YYDPRINTF ((stderr, "Reading a token: "));
  816. yychar = YYLEX;
  817. }
  818. if (yychar <= YYEOF)
  819. {
  820. yychar = yytoken = YYEOF;
  821. YYDPRINTF ((stderr, "Now at end of input.\n"));
  822. }
  823. else
  824. {
  825. yytoken = YYTRANSLATE (yychar);
  826. YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
  827. }
  828. /* If the proper action on seeing token YYTOKEN is to reduce or to
  829. detect an error, take that action. */
  830. yyn += yytoken;
  831. if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  832. goto yydefault;
  833. yyn = yytable[yyn];
  834. if (yyn <= 0)
  835. {
  836. if (yyn == 0 || yyn == YYTABLE_NINF)
  837. goto yyerrlab;
  838. yyn = -yyn;
  839. goto yyreduce;
  840. }
  841. if (yyn == YYFINAL)
  842. YYACCEPT;
  843. /* Shift the lookahead token. */
  844. YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
  845. /* Discard the token being shifted unless it is eof. */
  846. if (yychar != YYEOF)
  847. yychar = YYEMPTY;
  848. *++yyvsp = yylval;
  849. /* Count tokens shifted since error; after three, turn off error
  850. status. */
  851. if (yyerrstatus)
  852. yyerrstatus--;
  853. yystate = yyn;
  854. goto yynewstate;
  855. /*-----------------------------------------------------------.
  856. | yydefault -- do the default action for the current state. |
  857. `-----------------------------------------------------------*/
  858. yydefault:
  859. yyn = yydefact[yystate];
  860. if (yyn == 0)
  861. goto yyerrlab;
  862. goto yyreduce;
  863. /*-----------------------------.
  864. | yyreduce -- Do a reduction. |
  865. `-----------------------------*/
  866. yyreduce:
  867. /* yyn is the number of a rule to reduce with. */
  868. yylen = yyr2[yyn];
  869. /* If YYLEN is nonzero, implement the default value of the action:
  870. `$$ = $1'.
  871. Otherwise, the following line sets YYVAL to garbage.
  872. This behavior is undocumented and Bison
  873. users should not rely upon it. Assigning to YYVAL
  874. unconditionally makes the parser a bit smaller, and it avoids a
  875. GCC warning that YYVAL may be used uninitialized. */
  876. yyval = yyvsp[1-yylen];
  877. YY_REDUCE_PRINT (yyn);
  878. switch (yyn)
  879. {
  880. case 2:
  881. {
  882. yyval.str = 0;
  883. yyGetParser->SetResult(yyvsp[0].str);
  884. }
  885. break;
  886. case 3:
  887. {
  888. yyval.str = yyvsp[0].str;
  889. }
  890. break;
  891. case 4:
  892. {
  893. yyval.str = yyGetParser->CombineUnions(yyvsp[-1].str, yyvsp[0].str);
  894. }
  895. break;
  896. case 5:
  897. {
  898. yyval.str = 0;
  899. }
  900. break;
  901. case 6:
  902. {
  903. yyval.str = yyGetParser->CombineUnions(yyvsp[-1].str, yyvsp[0].str);
  904. }
  905. break;
  906. case 7:
  907. {
  908. yyval.str = yyvsp[0].str;
  909. }
  910. break;
  911. case 8:
  912. {
  913. yyval.str = yyvsp[0].str;
  914. }
  915. break;
  916. case 9:
  917. {
  918. yyval.str = yyvsp[0].str;
  919. }
  920. break;
  921. case 10:
  922. {
  923. yyval.str = yyvsp[0].str;
  924. }
  925. break;
  926. case 11:
  927. {
  928. yyval.str = yyvsp[0].str;
  929. }
  930. break;
  931. case 12:
  932. {
  933. yyval.str = yyvsp[0].str;
  934. }
  935. break;
  936. case 13:
  937. {
  938. yyval.str = yyvsp[0].str;
  939. }
  940. break;
  941. case 14:
  942. {
  943. yyval.str = yyvsp[0].str;
  944. }
  945. break;
  946. case 15:
  947. {
  948. yyval.str = yyGetParser->ExpandSpecialVariable(yyvsp[-2].str,yyvsp[-1].str);
  949. }
  950. break;
  951. case 16:
  952. {
  953. yyval.str = yyGetParser->ExpandVariable(yyvsp[-1].str);
  954. }
  955. break;
  956. case 17:
  957. {
  958. yyval.str = yyGetParser->ExpandVariable(yyvsp[0].str);
  959. }
  960. break;
  961. case 18:
  962. {
  963. yyval.str = 0;
  964. }
  965. break;
  966. case 19:
  967. {
  968. yyval.str = yyGetParser->CombineUnions(yyvsp[-1].str, yyvsp[0].str);
  969. }
  970. break;
  971. case 20:
  972. {
  973. yyval.str = yyvsp[0].str;
  974. }
  975. break;
  976. case 21:
  977. {
  978. yyval.str = yyvsp[0].str;
  979. }
  980. break;
  981. }
  982. /* Line 1010 of yacc.c. */
  983. yyvsp -= yylen;
  984. yyssp -= yylen;
  985. YY_STACK_PRINT (yyss, yyssp);
  986. *++yyvsp = yyval;
  987. /* Now `shift' the result of the reduction. Determine what state
  988. that goes to, based on the state we popped back to and the rule
  989. number reduced by. */
  990. yyn = yyr1[yyn];
  991. yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  992. if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  993. yystate = yytable[yystate];
  994. else
  995. yystate = yydefgoto[yyn - YYNTOKENS];
  996. goto yynewstate;
  997. /*------------------------------------.
  998. | yyerrlab -- here on detecting error |
  999. `------------------------------------*/
  1000. yyerrlab:
  1001. /* If not already recovering from an error, report this error. */
  1002. if (!yyerrstatus)
  1003. {
  1004. ++yynerrs;
  1005. #if YYERROR_VERBOSE
  1006. yyn = yypact[yystate];
  1007. if (YYPACT_NINF < yyn && yyn < YYLAST)
  1008. {
  1009. YYSIZE_T yysize = 0;
  1010. int yytype = YYTRANSLATE (yychar);
  1011. const char* yyprefix;
  1012. char *yymsg;
  1013. int yyx;
  1014. /* Start YYX at -YYN if negative to avoid negative indexes in
  1015. YYCHECK. */
  1016. int yyxbegin = yyn < 0 ? -yyn : 0;
  1017. /* Stay within bounds of both yycheck and yytname. */
  1018. int yychecklim = YYLAST - yyn;
  1019. int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
  1020. int yycount = 0;
  1021. yyprefix = ", expecting ";
  1022. for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  1023. if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
  1024. {
  1025. yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
  1026. yycount += 1;
  1027. if (yycount == 5)
  1028. {
  1029. yysize = 0;
  1030. break;
  1031. }
  1032. }
  1033. yysize += (sizeof ("syntax error, unexpected ")
  1034. + yystrlen (yytname[yytype]));
  1035. yymsg = (char *) YYSTACK_ALLOC (yysize);
  1036. if (yymsg != 0)
  1037. {
  1038. char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
  1039. yyp = yystpcpy (yyp, yytname[yytype]);
  1040. if (yycount < 5)
  1041. {
  1042. yyprefix = ", expecting ";
  1043. for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  1044. if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
  1045. {
  1046. yyp = yystpcpy (yyp, yyprefix);
  1047. yyp = yystpcpy (yyp, yytname[yyx]);
  1048. yyprefix = " or ";
  1049. }
  1050. }
  1051. yyerror (yymsg);
  1052. YYSTACK_FREE (yymsg);
  1053. }
  1054. else
  1055. yyerror ("syntax error; also virtual memory exhausted");
  1056. }
  1057. else
  1058. #endif /* YYERROR_VERBOSE */
  1059. yyerror ("syntax error");
  1060. }
  1061. if (yyerrstatus == 3)
  1062. {
  1063. /* If just tried and failed to reuse lookahead token after an
  1064. error, discard it. */
  1065. if (yychar <= YYEOF)
  1066. {
  1067. /* If at end of input, pop the error token,
  1068. then the rest of the stack, then return failure. */
  1069. if (yychar == YYEOF)
  1070. for (;;)
  1071. {
  1072. YYPOPSTACK;
  1073. if (yyssp == yyss)
  1074. YYABORT;
  1075. YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
  1076. yydestruct (yystos[*yyssp], yyvsp);
  1077. }
  1078. }
  1079. else
  1080. {
  1081. YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
  1082. yydestruct (yytoken, &yylval);
  1083. yychar = YYEMPTY;
  1084. }
  1085. }
  1086. /* Else will try to reuse lookahead token after shifting the error
  1087. token. */
  1088. goto yyerrlab1;
  1089. /*---------------------------------------------------.
  1090. | yyerrorlab -- error raised explicitly by YYERROR. |
  1091. `---------------------------------------------------*/
  1092. yyerrorlab:
  1093. #if defined (__GNUC__) || defined (__HP_aCC)
  1094. /* Pacify GCC when the user code never invokes YYERROR and the label
  1095. yyerrorlab therefore never appears in user code. */
  1096. if (0)
  1097. goto yyerrorlab;
  1098. #endif
  1099. yyvsp -= yylen;
  1100. yyssp -= yylen;
  1101. yystate = *yyssp;
  1102. goto yyerrlab1;
  1103. /*-------------------------------------------------------------.
  1104. | yyerrlab1 -- common code for both syntax error and YYERROR. |
  1105. `-------------------------------------------------------------*/
  1106. yyerrlab1:
  1107. yyerrstatus = 3; /* Each real token shifted decrements this. */
  1108. for (;;)
  1109. {
  1110. yyn = yypact[yystate];
  1111. if (yyn != YYPACT_NINF)
  1112. {
  1113. yyn += YYTERROR;
  1114. if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  1115. {
  1116. yyn = yytable[yyn];
  1117. if (0 < yyn)
  1118. break;
  1119. }
  1120. }
  1121. /* Pop the current state because it cannot handle the error token. */
  1122. if (yyssp == yyss)
  1123. YYABORT;
  1124. YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
  1125. yydestruct (yystos[yystate], yyvsp);
  1126. YYPOPSTACK;
  1127. yystate = *yyssp;
  1128. YY_STACK_PRINT (yyss, yyssp);
  1129. }
  1130. if (yyn == YYFINAL)
  1131. YYACCEPT;
  1132. YYDPRINTF ((stderr, "Shifting error token, "));
  1133. *++yyvsp = yylval;
  1134. yystate = yyn;
  1135. goto yynewstate;
  1136. /*-------------------------------------.
  1137. | yyacceptlab -- YYACCEPT comes here. |
  1138. `-------------------------------------*/
  1139. yyacceptlab:
  1140. yyresult = 0;
  1141. goto yyreturn;
  1142. /*-----------------------------------.
  1143. | yyabortlab -- YYABORT comes here. |
  1144. `-----------------------------------*/
  1145. yyabortlab:
  1146. yyresult = 1;
  1147. goto yyreturn;
  1148. #ifndef yyoverflow
  1149. /*----------------------------------------------.
  1150. | yyoverflowlab -- parser overflow comes here. |
  1151. `----------------------------------------------*/
  1152. yyoverflowlab:
  1153. yyerror ("parser stack overflow");
  1154. yyresult = 2;
  1155. /* Fall through. */
  1156. #endif
  1157. yyreturn:
  1158. #ifndef yyoverflow
  1159. if (yyss != yyssa)
  1160. YYSTACK_FREE (yyss);
  1161. #endif
  1162. return yyresult;
  1163. }
  1164. /* End of grammar */
  1165. /*--------------------------------------------------------------------------*/
  1166. void cmCommandArgumentError(yyscan_t yyscanner, const char* message)
  1167. {
  1168. yyGetParser->Error(message);
  1169. }