cmCommandArgumentParser.cxx 57 KB

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