cmCommandArgumentParser.cxx 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734
  1. /* A Bison parser, made by GNU Bison 3.3.2. */
  2. /* Bison implementation for Yacc-like parsers in C
  3. Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 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. /* All symbols defined below should begin with yy or YY, to avoid
  29. infringing on user name space. This should be done even for local
  30. variables, as they might otherwise be expanded by user macros.
  31. There are some unavoidable exceptions within include files to
  32. define necessary library symbols; they are noted "INFRINGES ON
  33. USER NAME SPACE" below. */
  34. /* Undocumented macros, especially those whose name start with YY_,
  35. are private implementation details. Do not rely on them. */
  36. /* Identify Bison output. */
  37. #define YYBISON 1
  38. /* Bison version. */
  39. #define YYBISON_VERSION "3.3.2"
  40. /* Skeleton name. */
  41. #define YYSKELETON_NAME "yacc.c"
  42. /* Pure parsers. */
  43. #define YYPURE 1
  44. /* Push parsers. */
  45. #define YYPUSH 0
  46. /* Pull parsers. */
  47. #define YYPULL 1
  48. /* Substitute the variable and function names. */
  49. #define yyparse cmCommandArgument_yyparse
  50. #define yylex cmCommandArgument_yylex
  51. #define yyerror cmCommandArgument_yyerror
  52. #define yydebug cmCommandArgument_yydebug
  53. #define yynerrs cmCommandArgument_yynerrs
  54. /* First part of user prologue. */
  55. #line 1 "cmCommandArgumentParser.y" /* yacc.c:337 */
  56. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  57. file Copyright.txt or https://cmake.org/licensing for details. */
  58. /*
  59. This file must be translated to C and modified to build everywhere.
  60. Run bison like this:
  61. bison --yacc --name-prefix=cmCommandArgument_yy --defines=cmCommandArgumentParserTokens.h -ocmCommandArgumentParser.cxx cmCommandArgumentParser.y
  62. Modify cmCommandArgumentParser.cxx:
  63. - "#if 0" out yyerrorlab block in range ["goto yyerrlab1", "yyerrlab1:"]
  64. */
  65. #include "cmConfigure.h" // IWYU pragma: keep
  66. #include <string.h>
  67. #define yyGetParser (cmCommandArgument_yyget_extra(yyscanner))
  68. /* Make sure malloc and free are available on QNX. */
  69. #ifdef __QNX__
  70. # include <malloc.h>
  71. #endif
  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. #include "cmCommandArgumentParserTokens.h" /* Need YYSTYPE for YY_DECL. */
  82. /* Forward declare the lexer entry point. */
  83. YY_DECL;
  84. /* Helper function to forward error callback from parser. */
  85. static void cmCommandArgument_yyerror(yyscan_t yyscanner, const char* message);
  86. /* Configure the parser to support large input. */
  87. #define YYMAXDEPTH 100000
  88. #define YYINITDEPTH 10000
  89. /* Disable some warnings in the generated code. */
  90. #ifdef _MSC_VER
  91. # pragma warning (disable: 4102) /* Unused goto label. */
  92. # pragma warning (disable: 4065) /* Switch statement contains default but no
  93. case. */
  94. # pragma warning (disable: 4244) /* loss of precision */
  95. # pragma warning (disable: 4702) /* unreachable code */
  96. #endif
  97. #if defined(__GNUC__) && __GNUC__ >= 8
  98. # pragma GCC diagnostic ignored "-Wconversion"
  99. #endif
  100. #line 138 "cmCommandArgumentParser.cxx" /* yacc.c:337 */
  101. # ifndef YY_NULLPTR
  102. # if defined __cplusplus
  103. # if 201103L <= __cplusplus
  104. # define YY_NULLPTR nullptr
  105. # else
  106. # define YY_NULLPTR 0
  107. # endif
  108. # else
  109. # define YY_NULLPTR ((void*)0)
  110. # endif
  111. # endif
  112. /* Enabling verbose error messages. */
  113. #ifdef YYERROR_VERBOSE
  114. # undef YYERROR_VERBOSE
  115. # define YYERROR_VERBOSE 1
  116. #else
  117. # define YYERROR_VERBOSE 1
  118. #endif
  119. /* In a future release of Bison, this section will be replaced
  120. by #include "cmCommandArgumentParserTokens.h". */
  121. #ifndef YY_CMCOMMANDARGUMENT_YY_CMCOMMANDARGUMENTPARSERTOKENS_H_INCLUDED
  122. # define YY_CMCOMMANDARGUMENT_YY_CMCOMMANDARGUMENTPARSERTOKENS_H_INCLUDED
  123. /* Debug traces. */
  124. #ifndef YYDEBUG
  125. # define YYDEBUG 0
  126. #endif
  127. #if YYDEBUG
  128. extern int cmCommandArgument_yydebug;
  129. #endif
  130. /* Token type. */
  131. #ifndef YYTOKENTYPE
  132. # define YYTOKENTYPE
  133. enum yytokentype
  134. {
  135. cal_ENVCURLY = 258,
  136. cal_NCURLY = 259,
  137. cal_DCURLY = 260,
  138. cal_DOLLAR = 261,
  139. cal_LCURLY = 262,
  140. cal_RCURLY = 263,
  141. cal_NAME = 264,
  142. cal_BSLASH = 265,
  143. cal_SYMBOL = 266,
  144. cal_AT = 267,
  145. cal_ERROR = 268,
  146. cal_ATNAME = 269
  147. };
  148. #endif
  149. /* Tokens. */
  150. #define cal_ENVCURLY 258
  151. #define cal_NCURLY 259
  152. #define cal_DCURLY 260
  153. #define cal_DOLLAR 261
  154. #define cal_LCURLY 262
  155. #define cal_RCURLY 263
  156. #define cal_NAME 264
  157. #define cal_BSLASH 265
  158. #define cal_SYMBOL 266
  159. #define cal_AT 267
  160. #define cal_ERROR 268
  161. #define cal_ATNAME 269
  162. /* Value type. */
  163. int cmCommandArgument_yyparse (yyscan_t yyscanner);
  164. #endif /* !YY_CMCOMMANDARGUMENT_YY_CMCOMMANDARGUMENTPARSERTOKENS_H_INCLUDED */
  165. #ifdef short
  166. # undef short
  167. #endif
  168. #ifdef YYTYPE_UINT8
  169. typedef YYTYPE_UINT8 yytype_uint8;
  170. #else
  171. typedef unsigned char yytype_uint8;
  172. #endif
  173. #ifdef YYTYPE_INT8
  174. typedef YYTYPE_INT8 yytype_int8;
  175. #else
  176. typedef signed char yytype_int8;
  177. #endif
  178. #ifdef YYTYPE_UINT16
  179. typedef YYTYPE_UINT16 yytype_uint16;
  180. #else
  181. typedef unsigned short yytype_uint16;
  182. #endif
  183. #ifdef YYTYPE_INT16
  184. typedef YYTYPE_INT16 yytype_int16;
  185. #else
  186. typedef short yytype_int16;
  187. #endif
  188. #ifndef YYSIZE_T
  189. # ifdef __SIZE_TYPE__
  190. # define YYSIZE_T __SIZE_TYPE__
  191. # elif defined size_t
  192. # define YYSIZE_T size_t
  193. # elif ! defined YYSIZE_T
  194. # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  195. # define YYSIZE_T size_t
  196. # else
  197. # define YYSIZE_T unsigned
  198. # endif
  199. #endif
  200. #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
  201. #ifndef YY_
  202. # if defined YYENABLE_NLS && YYENABLE_NLS
  203. # if ENABLE_NLS
  204. # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
  205. # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
  206. # endif
  207. # endif
  208. # ifndef YY_
  209. # define YY_(Msgid) Msgid
  210. # endif
  211. #endif
  212. #ifndef YY_ATTRIBUTE
  213. # if (defined __GNUC__ \
  214. && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
  215. || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
  216. # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
  217. # else
  218. # define YY_ATTRIBUTE(Spec) /* empty */
  219. # endif
  220. #endif
  221. #ifndef YY_ATTRIBUTE_PURE
  222. # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
  223. #endif
  224. #ifndef YY_ATTRIBUTE_UNUSED
  225. # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
  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__ && ! defined __ICC && 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. #define YYUNDEFTOK 2
  379. #define YYMAXUTOK 269
  380. /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
  381. as returned by yylex, with out-of-bounds checking. */
  382. #define YYTRANSLATE(YYX) \
  383. ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  384. /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
  385. as returned by yylex. */
  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, 99, 99, 105, 108, 113, 116, 121, 124, 129,
  421. 132, 135, 138, 141, 144, 149, 152, 155, 158, 163,
  422. 166, 171, 174, 179, 182
  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 YYO. |
  577. `-----------------------------------*/
  578. static void
  579. yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, yyscan_t yyscanner)
  580. {
  581. FILE *yyoutput = yyo;
  582. YYUSE (yyoutput);
  583. YYUSE (yyscanner);
  584. if (!yyvaluep)
  585. return;
  586. # ifdef YYPRINT
  587. if (yytype < YYNTOKENS)
  588. YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
  589. # endif
  590. YYUSE (yytype);
  591. }
  592. /*---------------------------.
  593. | Print this symbol on YYO. |
  594. `---------------------------*/
  595. static void
  596. yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, yyscan_t yyscanner)
  597. {
  598. YYFPRINTF (yyo, "%s %s (",
  599. yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
  600. yy_symbol_value_print (yyo, yytype, yyvaluep, yyscanner);
  601. YYFPRINTF (yyo, ")");
  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 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. else
  729. goto append;
  730. append:
  731. default:
  732. if (yyres)
  733. yyres[yyn] = *yyp;
  734. yyn++;
  735. break;
  736. case '"':
  737. if (yyres)
  738. yyres[yyn] = '\0';
  739. return yyn;
  740. }
  741. do_not_strip_quotes: ;
  742. }
  743. if (! yyres)
  744. return yystrlen (yystr);
  745. return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
  746. }
  747. # endif
  748. /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
  749. about the unexpected token YYTOKEN for the state stack whose top is
  750. YYSSP.
  751. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
  752. not large enough to hold the message. In that case, also set
  753. *YYMSG_ALLOC to the required number of bytes. Return 2 if the
  754. required number of bytes is too large to store. */
  755. static int
  756. yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
  757. yytype_int16 *yyssp, int yytoken)
  758. {
  759. YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
  760. YYSIZE_T yysize = yysize0;
  761. enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  762. /* Internationalized format string. */
  763. const char *yyformat = YY_NULLPTR;
  764. /* Arguments of yyformat. */
  765. char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  766. /* Number of reported tokens (one for the "unexpected", one per
  767. "expected"). */
  768. int yycount = 0;
  769. /* There are many possibilities here to consider:
  770. - If this state is a consistent state with a default action, then
  771. the only way this function was invoked is if the default action
  772. is an error action. In that case, don't check for expected
  773. tokens because there are none.
  774. - The only way there can be no lookahead present (in yychar) is if
  775. this state is a consistent state with a default action. Thus,
  776. detecting the absence of a lookahead is sufficient to determine
  777. that there is no unexpected or expected token to report. In that
  778. case, just report a simple "syntax error".
  779. - Don't assume there isn't a lookahead just because this state is a
  780. consistent state with a default action. There might have been a
  781. previous inconsistent state, consistent state with a non-default
  782. action, or user semantic action that manipulated yychar.
  783. - Of course, the expected token list depends on states to have
  784. correct lookahead information, and it depends on the parser not
  785. to perform extra reductions after fetching a lookahead from the
  786. scanner and before detecting a syntax error. Thus, state merging
  787. (from LALR or IELR) and default reductions corrupt the expected
  788. token list. However, the list is correct for canonical LR with
  789. one exception: it will still contain any token that will not be
  790. accepted due to an error action in a later state.
  791. */
  792. if (yytoken != YYEMPTY)
  793. {
  794. int yyn = yypact[*yyssp];
  795. yyarg[yycount++] = yytname[yytoken];
  796. if (!yypact_value_is_default (yyn))
  797. {
  798. /* Start YYX at -YYN if negative to avoid negative indexes in
  799. YYCHECK. In other words, skip the first -YYN actions for
  800. this state because they are default actions. */
  801. int yyxbegin = yyn < 0 ? -yyn : 0;
  802. /* Stay within bounds of both yycheck and yytname. */
  803. int yychecklim = YYLAST - yyn + 1;
  804. int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
  805. int yyx;
  806. for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  807. if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
  808. && !yytable_value_is_error (yytable[yyx + yyn]))
  809. {
  810. if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
  811. {
  812. yycount = 1;
  813. yysize = yysize0;
  814. break;
  815. }
  816. yyarg[yycount++] = yytname[yyx];
  817. {
  818. YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
  819. if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
  820. yysize = yysize1;
  821. else
  822. return 2;
  823. }
  824. }
  825. }
  826. }
  827. switch (yycount)
  828. {
  829. # define YYCASE_(N, S) \
  830. case N: \
  831. yyformat = S; \
  832. break
  833. default: /* Avoid compiler warnings. */
  834. YYCASE_(0, YY_("syntax error"));
  835. YYCASE_(1, YY_("syntax error, unexpected %s"));
  836. YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
  837. YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
  838. YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
  839. YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
  840. # undef YYCASE_
  841. }
  842. {
  843. YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
  844. if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
  845. yysize = yysize1;
  846. else
  847. return 2;
  848. }
  849. if (*yymsg_alloc < yysize)
  850. {
  851. *yymsg_alloc = 2 * yysize;
  852. if (! (yysize <= *yymsg_alloc
  853. && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
  854. *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
  855. return 1;
  856. }
  857. /* Avoid sprintf, as that infringes on the user's name space.
  858. Don't have undefined behavior even if the translation
  859. produced a string with the wrong number of "%s"s. */
  860. {
  861. char *yyp = *yymsg;
  862. int yyi = 0;
  863. while ((*yyp = *yyformat) != '\0')
  864. if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
  865. {
  866. yyp += yytnamerr (yyp, yyarg[yyi++]);
  867. yyformat += 2;
  868. }
  869. else
  870. {
  871. yyp++;
  872. yyformat++;
  873. }
  874. }
  875. return 0;
  876. }
  877. #endif /* YYERROR_VERBOSE */
  878. /*-----------------------------------------------.
  879. | Release the memory associated to this symbol. |
  880. `-----------------------------------------------*/
  881. static void
  882. yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, yyscan_t yyscanner)
  883. {
  884. YYUSE (yyvaluep);
  885. YYUSE (yyscanner);
  886. if (!yymsg)
  887. yymsg = "Deleting";
  888. YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  889. YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  890. YYUSE (yytype);
  891. YY_IGNORE_MAYBE_UNINITIALIZED_END
  892. }
  893. /*----------.
  894. | yyparse. |
  895. `----------*/
  896. int
  897. yyparse (yyscan_t yyscanner)
  898. {
  899. /* The lookahead symbol. */
  900. int yychar;
  901. /* The semantic value of the lookahead symbol. */
  902. /* Default value used for initialization, for pacifying older GCCs
  903. or non-GCC compilers. */
  904. YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
  905. YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
  906. /* Number of syntax errors so far. */
  907. int yynerrs;
  908. int yystate;
  909. /* Number of tokens to shift before error messages enabled. */
  910. int yyerrstatus;
  911. /* The stacks and their tools:
  912. 'yyss': related to states.
  913. 'yyvs': related to semantic values.
  914. Refer to the stacks through separate pointers, to allow yyoverflow
  915. to reallocate them elsewhere. */
  916. /* The state stack. */
  917. yytype_int16 yyssa[YYINITDEPTH];
  918. yytype_int16 *yyss;
  919. yytype_int16 *yyssp;
  920. /* The semantic value stack. */
  921. YYSTYPE yyvsa[YYINITDEPTH];
  922. YYSTYPE *yyvs;
  923. YYSTYPE *yyvsp;
  924. YYSIZE_T yystacksize;
  925. int yyn;
  926. int yyresult;
  927. /* Lookahead token as an internal (translated) token number. */
  928. int yytoken = 0;
  929. /* The variables used to return semantic value and location from the
  930. action routines. */
  931. YYSTYPE yyval;
  932. #if YYERROR_VERBOSE
  933. /* Buffer for error messages, and its allocated size. */
  934. char yymsgbuf[128];
  935. char *yymsg = yymsgbuf;
  936. YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
  937. #endif
  938. #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
  939. /* The number of symbols on the RHS of the reduced rule.
  940. Keep to zero when no symbol should be popped. */
  941. int yylen = 0;
  942. yyssp = yyss = yyssa;
  943. yyvsp = yyvs = yyvsa;
  944. yystacksize = YYINITDEPTH;
  945. YYDPRINTF ((stderr, "Starting parse\n"));
  946. yystate = 0;
  947. yyerrstatus = 0;
  948. yynerrs = 0;
  949. yychar = YYEMPTY; /* Cause a token to be read. */
  950. goto yysetstate;
  951. /*------------------------------------------------------------.
  952. | yynewstate -- push a new state, which is found in yystate. |
  953. `------------------------------------------------------------*/
  954. yynewstate:
  955. /* In all cases, when you get here, the value and location stacks
  956. have just been pushed. So pushing a state here evens the stacks. */
  957. yyssp++;
  958. /*--------------------------------------------------------------------.
  959. | yynewstate -- set current state (the top of the stack) to yystate. |
  960. `--------------------------------------------------------------------*/
  961. yysetstate:
  962. *yyssp = (yytype_int16) yystate;
  963. if (yyss + yystacksize - 1 <= yyssp)
  964. #if !defined yyoverflow && !defined YYSTACK_RELOCATE
  965. goto yyexhaustedlab;
  966. #else
  967. {
  968. /* Get the current used size of the three stacks, in elements. */
  969. YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
  970. # if defined yyoverflow
  971. {
  972. /* Give user a chance to reallocate the stack. Use copies of
  973. these so that the &'s don't force the real ones into
  974. memory. */
  975. YYSTYPE *yyvs1 = yyvs;
  976. yytype_int16 *yyss1 = yyss;
  977. /* Each stack pointer address is followed by the size of the
  978. data in use in that stack, in bytes. This used to be a
  979. conditional around just the two extra args, but that might
  980. be undefined if yyoverflow is a macro. */
  981. yyoverflow (YY_("memory exhausted"),
  982. &yyss1, yysize * sizeof (*yyssp),
  983. &yyvs1, yysize * sizeof (*yyvsp),
  984. &yystacksize);
  985. yyss = yyss1;
  986. yyvs = yyvs1;
  987. }
  988. # else /* defined YYSTACK_RELOCATE */
  989. /* Extend the stack our own way. */
  990. if (YYMAXDEPTH <= yystacksize)
  991. goto yyexhaustedlab;
  992. yystacksize *= 2;
  993. if (YYMAXDEPTH < yystacksize)
  994. yystacksize = YYMAXDEPTH;
  995. {
  996. yytype_int16 *yyss1 = yyss;
  997. union yyalloc *yyptr =
  998. (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  999. if (! yyptr)
  1000. goto yyexhaustedlab;
  1001. YYSTACK_RELOCATE (yyss_alloc, yyss);
  1002. YYSTACK_RELOCATE (yyvs_alloc, yyvs);
  1003. # undef YYSTACK_RELOCATE
  1004. if (yyss1 != yyssa)
  1005. YYSTACK_FREE (yyss1);
  1006. }
  1007. # endif
  1008. yyssp = yyss + yysize - 1;
  1009. yyvsp = yyvs + yysize - 1;
  1010. YYDPRINTF ((stderr, "Stack size increased to %lu\n",
  1011. (unsigned long) yystacksize));
  1012. if (yyss + yystacksize - 1 <= yyssp)
  1013. YYABORT;
  1014. }
  1015. #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
  1016. YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  1017. if (yystate == YYFINAL)
  1018. YYACCEPT;
  1019. goto yybackup;
  1020. /*-----------.
  1021. | yybackup. |
  1022. `-----------*/
  1023. yybackup:
  1024. /* Do appropriate processing given the current state. Read a
  1025. lookahead token if we need one and don't already have one. */
  1026. /* First try to decide what to do without reference to lookahead token. */
  1027. yyn = yypact[yystate];
  1028. if (yypact_value_is_default (yyn))
  1029. goto yydefault;
  1030. /* Not known => get a lookahead token if don't already have one. */
  1031. /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
  1032. if (yychar == YYEMPTY)
  1033. {
  1034. YYDPRINTF ((stderr, "Reading a token: "));
  1035. yychar = yylex (&yylval, yyscanner);
  1036. }
  1037. if (yychar <= YYEOF)
  1038. {
  1039. yychar = yytoken = YYEOF;
  1040. YYDPRINTF ((stderr, "Now at end of input.\n"));
  1041. }
  1042. else
  1043. {
  1044. yytoken = YYTRANSLATE (yychar);
  1045. YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  1046. }
  1047. /* If the proper action on seeing token YYTOKEN is to reduce or to
  1048. detect an error, take that action. */
  1049. yyn += yytoken;
  1050. if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  1051. goto yydefault;
  1052. yyn = yytable[yyn];
  1053. if (yyn <= 0)
  1054. {
  1055. if (yytable_value_is_error (yyn))
  1056. goto yyerrlab;
  1057. yyn = -yyn;
  1058. goto yyreduce;
  1059. }
  1060. /* Count tokens shifted since error; after three, turn off error
  1061. status. */
  1062. if (yyerrstatus)
  1063. yyerrstatus--;
  1064. /* Shift the lookahead token. */
  1065. YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  1066. /* Discard the shifted token. */
  1067. yychar = YYEMPTY;
  1068. yystate = yyn;
  1069. YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1070. *++yyvsp = yylval;
  1071. YY_IGNORE_MAYBE_UNINITIALIZED_END
  1072. goto yynewstate;
  1073. /*-----------------------------------------------------------.
  1074. | yydefault -- do the default action for the current state. |
  1075. `-----------------------------------------------------------*/
  1076. yydefault:
  1077. yyn = yydefact[yystate];
  1078. if (yyn == 0)
  1079. goto yyerrlab;
  1080. goto yyreduce;
  1081. /*-----------------------------.
  1082. | yyreduce -- do a reduction. |
  1083. `-----------------------------*/
  1084. yyreduce:
  1085. /* yyn is the number of a rule to reduce with. */
  1086. yylen = yyr2[yyn];
  1087. /* If YYLEN is nonzero, implement the default value of the action:
  1088. '$$ = $1'.
  1089. Otherwise, the following line sets YYVAL to garbage.
  1090. This behavior is undocumented and Bison
  1091. users should not rely upon it. Assigning to YYVAL
  1092. unconditionally makes the parser a bit smaller, and it avoids a
  1093. GCC warning that YYVAL may be used uninitialized. */
  1094. yyval = yyvsp[1-yylen];
  1095. YY_REDUCE_PRINT (yyn);
  1096. switch (yyn)
  1097. {
  1098. case 2:
  1099. #line 99 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1100. {
  1101. (yyval.str) = 0;
  1102. yyGetParser->SetResult((yyvsp[0].str));
  1103. }
  1104. #line 1314 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1105. break;
  1106. case 3:
  1107. #line 105 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1108. {
  1109. (yyval.str) = (yyvsp[0].str);
  1110. }
  1111. #line 1322 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1112. break;
  1113. case 4:
  1114. #line 108 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1115. {
  1116. (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str));
  1117. }
  1118. #line 1330 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1119. break;
  1120. case 5:
  1121. #line 113 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1122. {
  1123. (yyval.str) = 0;
  1124. }
  1125. #line 1338 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1126. break;
  1127. case 6:
  1128. #line 116 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1129. {
  1130. (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str));
  1131. }
  1132. #line 1346 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1133. break;
  1134. case 7:
  1135. #line 121 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1136. {
  1137. (yyval.str) = (yyvsp[0].str);
  1138. }
  1139. #line 1354 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1140. break;
  1141. case 8:
  1142. #line 124 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1143. {
  1144. (yyval.str) = (yyvsp[0].str);
  1145. }
  1146. #line 1362 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1147. break;
  1148. case 9:
  1149. #line 129 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1150. {
  1151. (yyval.str) = (yyvsp[0].str);
  1152. }
  1153. #line 1370 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1154. break;
  1155. case 10:
  1156. #line 132 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1157. {
  1158. (yyval.str) = (yyvsp[0].str);
  1159. }
  1160. #line 1378 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1161. break;
  1162. case 11:
  1163. #line 135 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1164. {
  1165. (yyval.str) = (yyvsp[0].str);
  1166. }
  1167. #line 1386 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1168. break;
  1169. case 12:
  1170. #line 138 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1171. {
  1172. (yyval.str) = (yyvsp[0].str);
  1173. }
  1174. #line 1394 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1175. break;
  1176. case 13:
  1177. #line 141 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1178. {
  1179. (yyval.str) = (yyvsp[0].str);
  1180. }
  1181. #line 1402 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1182. break;
  1183. case 14:
  1184. #line 144 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1185. {
  1186. (yyval.str) = (yyvsp[0].str);
  1187. }
  1188. #line 1410 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1189. break;
  1190. case 15:
  1191. #line 149 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1192. {
  1193. (yyval.str) = yyGetParser->ExpandSpecialVariable((yyvsp[-2].str), (yyvsp[-1].str));
  1194. }
  1195. #line 1418 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1196. break;
  1197. case 16:
  1198. #line 152 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1199. {
  1200. (yyval.str) = yyGetParser->ExpandSpecialVariable((yyvsp[-2].str), (yyvsp[-1].str));
  1201. }
  1202. #line 1426 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1203. break;
  1204. case 17:
  1205. #line 155 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1206. {
  1207. (yyval.str) = yyGetParser->ExpandVariable((yyvsp[-1].str));
  1208. }
  1209. #line 1434 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1210. break;
  1211. case 18:
  1212. #line 158 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1213. {
  1214. (yyval.str) = yyGetParser->ExpandVariableForAt((yyvsp[0].str));
  1215. }
  1216. #line 1442 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1217. break;
  1218. case 19:
  1219. #line 163 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1220. {
  1221. (yyval.str) = (yyvsp[0].str);
  1222. }
  1223. #line 1450 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1224. break;
  1225. case 20:
  1226. #line 166 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1227. {
  1228. (yyval.str) = (yyvsp[-1].str);
  1229. }
  1230. #line 1458 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1231. break;
  1232. case 21:
  1233. #line 171 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1234. {
  1235. (yyval.str) = 0;
  1236. }
  1237. #line 1466 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1238. break;
  1239. case 22:
  1240. #line 174 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1241. {
  1242. (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str));
  1243. }
  1244. #line 1474 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1245. break;
  1246. case 23:
  1247. #line 179 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1248. {
  1249. (yyval.str) = (yyvsp[0].str);
  1250. }
  1251. #line 1482 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1252. break;
  1253. case 24:
  1254. #line 182 "cmCommandArgumentParser.y" /* yacc.c:1652 */
  1255. {
  1256. (yyval.str) = (yyvsp[0].str);
  1257. }
  1258. #line 1490 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1259. break;
  1260. #line 1494 "cmCommandArgumentParser.cxx" /* yacc.c:1652 */
  1261. default: break;
  1262. }
  1263. /* User semantic actions sometimes alter yychar, and that requires
  1264. that yytoken be updated with the new translation. We take the
  1265. approach of translating immediately before every use of yytoken.
  1266. One alternative is translating here after every semantic action,
  1267. but that translation would be missed if the semantic action invokes
  1268. YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
  1269. if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
  1270. incorrect destructor might then be invoked immediately. In the
  1271. case of YYERROR or YYBACKUP, subsequent parser actions might lead
  1272. to an incorrect destructor call or verbose syntax error message
  1273. before the lookahead is translated. */
  1274. YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  1275. YYPOPSTACK (yylen);
  1276. yylen = 0;
  1277. YY_STACK_PRINT (yyss, yyssp);
  1278. *++yyvsp = yyval;
  1279. /* Now 'shift' the result of the reduction. Determine what state
  1280. that goes to, based on the state we popped back to and the rule
  1281. number reduced by. */
  1282. {
  1283. const int yylhs = yyr1[yyn] - YYNTOKENS;
  1284. const int yyi = yypgoto[yylhs] + *yyssp;
  1285. yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
  1286. ? yytable[yyi]
  1287. : yydefgoto[yylhs]);
  1288. }
  1289. goto yynewstate;
  1290. /*--------------------------------------.
  1291. | yyerrlab -- here on detecting error. |
  1292. `--------------------------------------*/
  1293. yyerrlab:
  1294. /* Make sure we have latest lookahead translation. See comments at
  1295. user semantic actions for why this is necessary. */
  1296. yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
  1297. /* If not already recovering from an error, report this error. */
  1298. if (!yyerrstatus)
  1299. {
  1300. ++yynerrs;
  1301. #if ! YYERROR_VERBOSE
  1302. yyerror (yyscanner, YY_("syntax error"));
  1303. #else
  1304. # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
  1305. yyssp, yytoken)
  1306. {
  1307. char const *yymsgp = YY_("syntax error");
  1308. int yysyntax_error_status;
  1309. yysyntax_error_status = YYSYNTAX_ERROR;
  1310. if (yysyntax_error_status == 0)
  1311. yymsgp = yymsg;
  1312. else if (yysyntax_error_status == 1)
  1313. {
  1314. if (yymsg != yymsgbuf)
  1315. YYSTACK_FREE (yymsg);
  1316. yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
  1317. if (!yymsg)
  1318. {
  1319. yymsg = yymsgbuf;
  1320. yymsg_alloc = sizeof yymsgbuf;
  1321. yysyntax_error_status = 2;
  1322. }
  1323. else
  1324. {
  1325. yysyntax_error_status = YYSYNTAX_ERROR;
  1326. yymsgp = yymsg;
  1327. }
  1328. }
  1329. yyerror (yyscanner, yymsgp);
  1330. if (yysyntax_error_status == 2)
  1331. goto yyexhaustedlab;
  1332. }
  1333. # undef YYSYNTAX_ERROR
  1334. #endif
  1335. }
  1336. if (yyerrstatus == 3)
  1337. {
  1338. /* If just tried and failed to reuse lookahead token after an
  1339. error, discard it. */
  1340. if (yychar <= YYEOF)
  1341. {
  1342. /* Return failure if at end of input. */
  1343. if (yychar == YYEOF)
  1344. YYABORT;
  1345. }
  1346. else
  1347. {
  1348. yydestruct ("Error: discarding",
  1349. yytoken, &yylval, yyscanner);
  1350. yychar = YYEMPTY;
  1351. }
  1352. }
  1353. #if 0
  1354. /* Else will try to reuse lookahead token after shifting the error
  1355. token. */
  1356. goto yyerrlab1;
  1357. /*---------------------------------------------------.
  1358. | yyerrorlab -- error raised explicitly by YYERROR. |
  1359. `---------------------------------------------------*/
  1360. yyerrorlab:
  1361. /* Pacify compilers when the user code never invokes YYERROR and the
  1362. label yyerrorlab therefore never appears in user code. */
  1363. if (0)
  1364. YYERROR;
  1365. /* Do not reclaim the symbols of the rule whose action triggered
  1366. this YYERROR. */
  1367. YYPOPSTACK (yylen);
  1368. yylen = 0;
  1369. YY_STACK_PRINT (yyss, yyssp);
  1370. yystate = *yyssp;
  1371. goto yyerrlab1;
  1372. /*-------------------------------------------------------------.
  1373. | yyerrlab1 -- common code for both syntax error and YYERROR. |
  1374. `-------------------------------------------------------------*/
  1375. yyerrlab1:
  1376. #endif
  1377. yyerrstatus = 3; /* Each real token shifted decrements this. */
  1378. for (;;)
  1379. {
  1380. yyn = yypact[yystate];
  1381. if (!yypact_value_is_default (yyn))
  1382. {
  1383. yyn += YYTERROR;
  1384. if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  1385. {
  1386. yyn = yytable[yyn];
  1387. if (0 < yyn)
  1388. break;
  1389. }
  1390. }
  1391. /* Pop the current state because it cannot handle the error token. */
  1392. if (yyssp == yyss)
  1393. YYABORT;
  1394. yydestruct ("Error: popping",
  1395. yystos[yystate], yyvsp, yyscanner);
  1396. YYPOPSTACK (1);
  1397. yystate = *yyssp;
  1398. YY_STACK_PRINT (yyss, yyssp);
  1399. }
  1400. YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1401. *++yyvsp = yylval;
  1402. YY_IGNORE_MAYBE_UNINITIALIZED_END
  1403. /* Shift the error token. */
  1404. YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
  1405. yystate = yyn;
  1406. goto yynewstate;
  1407. /*-------------------------------------.
  1408. | yyacceptlab -- YYACCEPT comes here. |
  1409. `-------------------------------------*/
  1410. yyacceptlab:
  1411. yyresult = 0;
  1412. goto yyreturn;
  1413. /*-----------------------------------.
  1414. | yyabortlab -- YYABORT comes here. |
  1415. `-----------------------------------*/
  1416. yyabortlab:
  1417. yyresult = 1;
  1418. goto yyreturn;
  1419. #if !defined yyoverflow || YYERROR_VERBOSE
  1420. /*-------------------------------------------------.
  1421. | yyexhaustedlab -- memory exhaustion comes here. |
  1422. `-------------------------------------------------*/
  1423. yyexhaustedlab:
  1424. yyerror (yyscanner, YY_("memory exhausted"));
  1425. yyresult = 2;
  1426. /* Fall through. */
  1427. #endif
  1428. /*-----------------------------------------------------.
  1429. | yyreturn -- parsing is finished, return the result. |
  1430. `-----------------------------------------------------*/
  1431. yyreturn:
  1432. if (yychar != YYEMPTY)
  1433. {
  1434. /* Make sure we have latest lookahead translation. See comments at
  1435. user semantic actions for why this is necessary. */
  1436. yytoken = YYTRANSLATE (yychar);
  1437. yydestruct ("Cleanup: discarding lookahead",
  1438. yytoken, &yylval, yyscanner);
  1439. }
  1440. /* Do not reclaim the symbols of the rule whose action triggered
  1441. this YYABORT or YYACCEPT. */
  1442. YYPOPSTACK (yylen);
  1443. YY_STACK_PRINT (yyss, yyssp);
  1444. while (yyssp != yyss)
  1445. {
  1446. yydestruct ("Cleanup: popping",
  1447. yystos[*yyssp], yyvsp, yyscanner);
  1448. YYPOPSTACK (1);
  1449. }
  1450. #ifndef yyoverflow
  1451. if (yyss != yyssa)
  1452. YYSTACK_FREE (yyss);
  1453. #endif
  1454. #if YYERROR_VERBOSE
  1455. if (yymsg != yymsgbuf)
  1456. YYSTACK_FREE (yymsg);
  1457. #endif
  1458. return yyresult;
  1459. }
  1460. #line 187 "cmCommandArgumentParser.y" /* yacc.c:1918 */
  1461. /* End of grammar */
  1462. /*--------------------------------------------------------------------------*/
  1463. void cmCommandArgument_yyerror(yyscan_t yyscanner, const char* message)
  1464. {
  1465. yyGetParser->Error(message);
  1466. }