cmCommandArgumentParser.cxx 46 KB

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