cmCommandArgumentParser.cxx 52 KB

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