cmCommandArgumentParser.cxx 51 KB

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