cmCommandArgumentParser.cxx 45 KB

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