cmCommandArgumentParser.cxx 51 KB

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