1
0

cmCommandArgumentParser.cxx 45 KB

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