cmCommandArgumentParser.cxx 52 KB

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