Clarify documentation for if.
[cmake.git] / Source / cmCommandArgumentParser.cxx
blob992dfd6bfe6a1360672eb628a6f91419569071c7
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCommandArgumentParser.cxx,v $
5 Language: C++
6 Date: $Date: 2008-12-18 14:58:01 $
7 Version: $Revision: 1.15 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 /* A Bison parser, made by GNU Bison 2.3. */
19 /* Skeleton implementation for Bison's Yacc-like parsers in C
21 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
22 Free Software Foundation, Inc.
24 This program is free software; you can redistribute it and/or modify
25 it under the terms of the GNU General Public License as published by
26 the Free Software Foundation; either version 2, or (at your option)
27 any later version.
29 This program is distributed in the hope that it will be useful,
30 but WITHOUT ANY WARRANTY; without even the implied warranty of
31 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 GNU General Public License for more details.
34 You should have received a copy of the GNU General Public License
35 along with this program; if not, write to the Free Software
36 Foundation, Inc., 51 Franklin Street, Fifth Floor,
37 Boston, MA 02110-1301, USA. */
39 /* As a special exception, you may create a larger work that contains
40 part or all of the Bison parser skeleton and distribute that work
41 under terms of your choice, so long as that work isn't itself a
42 parser generator using the skeleton or a modified version thereof
43 as a parser skeleton. Alternatively, if you modify or redistribute
44 the parser skeleton itself, you may (at your option) remove this
45 special exception, which will cause the skeleton and the resulting
46 Bison output files to be licensed under the GNU General Public
47 License without this special exception.
49 This special exception was added by the Free Software Foundation in
50 version 2.2 of Bison. */
52 /* C LALR(1) parser skeleton written by Richard Stallman, by
53 simplifying the original so-called "semantic" parser. */
55 /* All symbols defined below should begin with yy or YY, to avoid
56 infringing on user name space. This should be done even for local
57 variables, as they might otherwise be expanded by user macros.
58 There are some unavoidable exceptions within include files to
59 define necessary library symbols; they are noted "INFRINGES ON
60 USER NAME SPACE" below. */
62 /* Identify Bison output. */
63 #define YYBISON 1
65 /* Bison version. */
66 #define YYBISON_VERSION "2.3"
68 /* Skeleton name. */
69 #define YYSKELETON_NAME "yacc.c"
71 /* Pure parsers. */
72 #define YYPURE 1
74 /* Using locations. */
75 #define YYLSP_NEEDED 0
77 /* Substitute the variable and function names. */
78 #define yyparse cmCommandArgument_yyparse
79 #define yylex cmCommandArgument_yylex
80 #define yyerror cmCommandArgument_yyerror
81 #define yylval cmCommandArgument_yylval
82 #define yychar cmCommandArgument_yychar
83 #define yydebug cmCommandArgument_yydebug
84 #define yynerrs cmCommandArgument_yynerrs
87 /* Tokens. */
88 #ifndef YYTOKENTYPE
89 # define YYTOKENTYPE
90 /* Put the tokens into the symbol table, so that GDB and other debuggers
91 know about them. */
92 enum yytokentype {
93 cal_ENVCURLY = 258,
94 cal_NCURLY = 259,
95 cal_DCURLY = 260,
96 cal_DOLLAR = 261,
97 cal_LCURLY = 262,
98 cal_RCURLY = 263,
99 cal_NAME = 264,
100 cal_BSLASH = 265,
101 cal_SYMBOL = 266,
102 cal_AT = 267,
103 cal_ERROR = 268,
104 cal_ATNAME = 269
106 #endif
107 /* Tokens. */
108 #define cal_ENVCURLY 258
109 #define cal_NCURLY 259
110 #define cal_DCURLY 260
111 #define cal_DOLLAR 261
112 #define cal_LCURLY 262
113 #define cal_RCURLY 263
114 #define cal_NAME 264
115 #define cal_BSLASH 265
116 #define cal_SYMBOL 266
117 #define cal_AT 267
118 #define cal_ERROR 268
119 #define cal_ATNAME 269
124 /* Copy the first part of user declarations. */
125 #line 1 "cmCommandArgumentParser.y"
127 /*=========================================================================
129 Program: CMake - Cross-Platform Makefile Generator
130 Module: $RCSfile: cmCommandArgumentParser.cxx,v $
131 Language: C++
132 Date: $Date: 2008-12-18 14:58:01 $
133 Version: $Revision: 1.15 $
135 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
136 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
138 This software is distributed WITHOUT ANY WARRANTY; without even
139 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
140 PURPOSE. See the above copyright notices for more information.
142 =========================================================================*/
145 This file must be translated to C and modified to build everywhere.
147 Run bison like this:
149 bison --yacc --name-prefix=cmCommandArgument_yy --defines=cmCommandArgumentParserTokens.h -ocmCommandArgumentParser.cxx cmCommandArgumentParser.y
151 Modify cmCommandArgumentParser.cxx:
152 - remove TABs
153 - put header block at top of file
157 #include "cmStandardIncludes.h"
159 /* Configure the parser to use a lexer object. */
160 #define YYPARSE_PARAM yyscanner
161 #define YYLEX_PARAM yyscanner
162 #define YYERROR_VERBOSE 1
163 #define cmCommandArgument_yyerror(x) \
164 cmCommandArgumentError(yyscanner, x)
165 #define yyGetParser (cmCommandArgument_yyget_extra(yyscanner))
167 /* Make sure malloc and free are available on QNX. */
168 #ifdef __QNX__
169 # include <malloc.h>
170 #endif
172 /* Make sure the parser uses standard memory allocation. The default
173 generated parser malloc/free declarations do not work on all
174 platforms. */
175 #include <stdlib.h>
176 #define YYMALLOC malloc
177 #define YYFREE free
179 /*-------------------------------------------------------------------------*/
180 #include "cmCommandArgumentParserHelper.h" /* Interface to parser object. */
181 #include "cmCommandArgumentLexer.h" /* Interface to lexer object. */
182 #include "cmCommandArgumentParserTokens.h" /* Need YYSTYPE for YY_DECL. */
184 /* Forward declare the lexer entry point. */
185 YY_DECL;
187 /* Internal utility functions. */
188 static void cmCommandArgumentError(yyscan_t yyscanner, const char* message);
190 #define YYDEBUG 1
191 /* Configure the parser to support large input. */
192 #define YYMAXDEPTH 100000
193 #define YYINITDEPTH 10000
195 /* Disable some warnings in the generated code. */
196 #ifdef __BORLANDC__
197 # pragma warn -8004 /* Variable assigned a value that is not used. */
198 # pragma warn -8008 /* condition always returns true */
199 # pragma warn -8060 /* possibly incorrect assignment */
200 # pragma warn -8066 /* unreachable code */
201 #endif
202 #ifdef _MSC_VER
203 # pragma warning (disable: 4102) /* Unused goto label. */
204 # pragma warning (disable: 4065) /* Switch statement contains default but no
205 case. */
206 # pragma warning (disable: 4244) /* loss of precision */
207 # pragma warning (disable: 4702) /* unreachable code */
208 #endif
211 /* Enabling traces. */
212 #ifndef YYDEBUG
213 # define YYDEBUG 0
214 #endif
216 /* Enabling verbose error messages. */
217 #ifdef YYERROR_VERBOSE
218 # undef YYERROR_VERBOSE
219 # define YYERROR_VERBOSE 1
220 #else
221 # define YYERROR_VERBOSE 0
222 #endif
224 /* Enabling the token table. */
225 #ifndef YYTOKEN_TABLE
226 # define YYTOKEN_TABLE 0
227 #endif
229 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
230 typedef int YYSTYPE;
231 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
232 # define YYSTYPE_IS_DECLARED 1
233 # define YYSTYPE_IS_TRIVIAL 1
234 #endif
238 /* Copy the second part of user declarations. */
241 /* Line 216 of yacc.c. */
242 #line 227 "cmCommandArgumentParser.cxx"
244 #ifdef short
245 # undef short
246 #endif
248 #ifdef YYTYPE_UINT8
249 typedef YYTYPE_UINT8 yytype_uint8;
250 #else
251 typedef unsigned char yytype_uint8;
252 #endif
254 #ifdef YYTYPE_INT8
255 typedef YYTYPE_INT8 yytype_int8;
256 #elif (defined __STDC__ || defined __C99__FUNC__ \
257 || defined __cplusplus || defined _MSC_VER)
258 typedef signed char yytype_int8;
259 #else
260 typedef short int yytype_int8;
261 #endif
263 #ifdef YYTYPE_UINT16
264 typedef YYTYPE_UINT16 yytype_uint16;
265 #else
266 typedef unsigned short int yytype_uint16;
267 #endif
269 #ifdef YYTYPE_INT16
270 typedef YYTYPE_INT16 yytype_int16;
271 #else
272 typedef short int yytype_int16;
273 #endif
275 #ifndef YYSIZE_T
276 # ifdef __SIZE_TYPE__
277 # define YYSIZE_T __SIZE_TYPE__
278 # elif defined size_t
279 # define YYSIZE_T size_t
280 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
281 || defined __cplusplus || defined _MSC_VER)
282 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
283 # define YYSIZE_T size_t
284 # else
285 # define YYSIZE_T unsigned int
286 # endif
287 #endif
289 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
291 #ifndef YY_
292 # if YYENABLE_NLS
293 # if ENABLE_NLS
294 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
295 # define YY_(msgid) dgettext ("bison-runtime", msgid)
296 # endif
297 # endif
298 # ifndef YY_
299 # define YY_(msgid) msgid
300 # endif
301 #endif
303 /* Suppress unused-variable warnings by "using" E. */
304 #if ! defined lint || defined __GNUC__
305 # define YYUSE(e) ((void) (e))
306 #else
307 # define YYUSE(e) /* empty */
308 #endif
310 /* Identity function, used to suppress warnings about constant conditions. */
311 #ifndef lint
312 # define YYID(n) (n)
313 #else
314 #if (defined __STDC__ || defined __C99__FUNC__ \
315 || defined __cplusplus || defined _MSC_VER)
316 static int
317 YYID (int i)
318 #else
319 static int
320 YYID (i)
321 int i;
322 #endif
324 return i;
326 #endif
328 #if ! defined yyoverflow || YYERROR_VERBOSE
330 /* The parser invokes alloca or malloc; define the necessary symbols. */
332 # ifdef YYSTACK_USE_ALLOCA
333 # if YYSTACK_USE_ALLOCA
334 # ifdef __GNUC__
335 # define YYSTACK_ALLOC __builtin_alloca
336 # elif defined __BUILTIN_VA_ARG_INCR
337 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
338 # elif defined _AIX
339 # define YYSTACK_ALLOC __alloca
340 # elif defined _MSC_VER
341 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
342 # define alloca _alloca
343 # else
344 # define YYSTACK_ALLOC alloca
345 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
346 || defined __cplusplus || defined _MSC_VER)
347 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
348 # ifndef _STDLIB_H
349 # define _STDLIB_H 1
350 # endif
351 # endif
352 # endif
353 # endif
354 # endif
356 # ifdef YYSTACK_ALLOC
357 /* Pacify GCC's `empty if-body' warning. */
358 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
359 # ifndef YYSTACK_ALLOC_MAXIMUM
360 /* The OS might guarantee only one guard page at the bottom of the stack,
361 and a page size can be as small as 4096 bytes. So we cannot safely
362 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
363 to allow for a few compiler-allocated temporary stack slots. */
364 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
365 # endif
366 # else
367 # define YYSTACK_ALLOC YYMALLOC
368 # define YYSTACK_FREE YYFREE
369 # ifndef YYSTACK_ALLOC_MAXIMUM
370 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
371 # endif
372 # if (defined __cplusplus && ! defined _STDLIB_H \
373 && ! ((defined YYMALLOC || defined malloc) \
374 && (defined YYFREE || defined free)))
375 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
376 # ifndef _STDLIB_H
377 # define _STDLIB_H 1
378 # endif
379 # endif
380 # ifndef YYMALLOC
381 # define YYMALLOC malloc
382 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
383 || defined __cplusplus || defined _MSC_VER)
384 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
385 # endif
386 # endif
387 # ifndef YYFREE
388 # define YYFREE free
389 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
390 || defined __cplusplus || defined _MSC_VER)
391 void free (void *); /* INFRINGES ON USER NAME SPACE */
392 # endif
393 # endif
394 # endif
395 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
398 #if (! defined yyoverflow \
399 && (! defined __cplusplus \
400 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
402 /* A type that is properly aligned for any stack member. */
403 union yyalloc
405 yytype_int16 yyss;
406 YYSTYPE yyvs;
409 /* The size of the maximum gap between one aligned stack and the next. */
410 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
412 /* The size of an array large to enough to hold all stacks, each with
413 N elements. */
414 # define YYSTACK_BYTES(N) \
415 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
416 + YYSTACK_GAP_MAXIMUM)
418 /* Copy COUNT objects from FROM to TO. The source and destination do
419 not overlap. */
420 # ifndef YYCOPY
421 # if defined __GNUC__ && 1 < __GNUC__
422 # define YYCOPY(To, From, Count) \
423 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
424 # else
425 # define YYCOPY(To, From, Count) \
426 do \
428 YYSIZE_T yyi; \
429 for (yyi = 0; yyi < (Count); yyi++) \
430 (To)[yyi] = (From)[yyi]; \
432 while (YYID (0))
433 # endif
434 # endif
436 /* Relocate STACK from its old location to the new one. The
437 local variables YYSIZE and YYSTACKSIZE give the old and new number of
438 elements in the stack, and YYPTR gives the new location of the
439 stack. Advance YYPTR to a properly aligned location for the next
440 stack. */
441 # define YYSTACK_RELOCATE(Stack) \
442 do \
444 YYSIZE_T yynewbytes; \
445 YYCOPY (&yyptr->Stack, Stack, yysize); \
446 Stack = &yyptr->Stack; \
447 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
448 yyptr += yynewbytes / sizeof (*yyptr); \
450 while (YYID (0))
452 #endif
454 /* YYFINAL -- State number of the termination state. */
455 #define YYFINAL 25
456 /* YYLAST -- Last index in YYTABLE. */
457 #define YYLAST 40
459 /* YYNTOKENS -- Number of terminals. */
460 #define YYNTOKENS 15
461 /* YYNNTS -- Number of nonterminals. */
462 #define YYNNTS 10
463 /* YYNRULES -- Number of rules. */
464 #define YYNRULES 24
465 /* YYNRULES -- Number of states. */
466 #define YYNSTATES 33
468 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
469 #define YYUNDEFTOK 2
470 #define YYMAXUTOK 269
472 #define YYTRANSLATE(YYX) \
473 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
475 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
476 static const yytype_uint8 yytranslate[] =
478 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
481 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
482 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
483 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
486 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
487 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
488 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
489 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
490 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
491 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
492 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
493 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
494 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
495 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
497 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
498 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
499 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
500 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
501 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
502 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
503 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
504 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
507 #if YYDEBUG
508 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
509 YYRHS. */
510 static const yytype_uint8 yyprhs[] =
512 0, 0, 3, 5, 7, 10, 11, 14, 16, 18,
513 20, 22, 24, 26, 28, 30, 34, 38, 42, 44,
514 46, 49, 50, 53, 55
517 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
518 static const yytype_int8 yyrhs[] =
520 16, 0, -1, 17, -1, 18, -1, 18, 10, -1,
521 -1, 19, 18, -1, 20, -1, 21, -1, 9, -1,
522 12, -1, 6, -1, 7, -1, 8, -1, 11, -1,
523 3, 22, 8, -1, 4, 23, 8, -1, 5, 23,
524 8, -1, 14, -1, 23, -1, 11, 22, -1, -1,
525 24, 23, -1, 9, -1, 21, -1
528 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
529 static const yytype_uint8 yyrline[] =
531 0, 116, 116, 123, 128, 134, 138, 144, 149, 155,
532 160, 165, 170, 175, 180, 186, 192, 198, 204, 210,
533 215, 221, 225, 231, 236
535 #endif
537 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
538 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
539 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
540 static const char *const yytname[] =
542 "$end", "error", "$undefined", "cal_ENVCURLY", "cal_NCURLY",
543 "cal_DCURLY", "\"$\"", "\"{\"", "\"}\"", "cal_NAME", "\"\\\\\"",
544 "cal_SYMBOL", "\"@\"", "cal_ERROR", "cal_ATNAME", "$accept", "Start",
545 "GoalWithOptionalBackSlash", "Goal", "String", "OuterText", "Variable",
546 "EnvVarName", "MultipleIds", "ID", 0
548 #endif
550 # ifdef YYPRINT
551 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
552 token YYLEX-NUM. */
553 static const yytype_uint16 yytoknum[] =
555 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
556 265, 266, 267, 268, 269
558 # endif
560 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
561 static const yytype_uint8 yyr1[] =
563 0, 15, 16, 17, 17, 18, 18, 19, 19, 20,
564 20, 20, 20, 20, 20, 21, 21, 21, 21, 22,
565 22, 23, 23, 24, 24
568 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
569 static const yytype_uint8 yyr2[] =
571 0, 2, 1, 1, 2, 0, 2, 1, 1, 1,
572 1, 1, 1, 1, 1, 3, 3, 3, 1, 1,
573 2, 0, 2, 1, 1
576 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
577 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
578 means the default is an error. */
579 static const yytype_uint8 yydefact[] =
581 5, 21, 21, 21, 11, 12, 13, 9, 14, 10,
582 18, 0, 2, 3, 5, 7, 8, 23, 21, 24,
583 0, 19, 21, 0, 0, 1, 4, 6, 20, 15,
584 22, 16, 17
587 /* YYDEFGOTO[NTERM-NUM]. */
588 static const yytype_int8 yydefgoto[] =
590 -1, 11, 12, 13, 14, 15, 19, 20, 21, 22
593 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
594 STATE-NUM. */
595 #define YYPACT_NINF -3
596 static const yytype_int8 yypact[] =
598 0, 14, 26, 26, -3, -3, -3, -3, -3, -3,
599 -3, 10, -3, 3, 0, -3, -3, -3, 14, -3,
600 7, -3, 26, 13, 16, -3, -3, -3, -3, -3,
601 -3, -3, -3
604 /* YYPGOTO[NTERM-NUM]. */
605 static const yytype_int8 yypgoto[] =
607 -3, -3, -3, 8, -3, -3, 2, 9, -2, -3
610 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
611 positive, shift that token. If negative, reduce the rule which
612 number is the opposite. If zero, do what YYDEFACT says.
613 If YYTABLE_NINF, syntax error. */
614 #define YYTABLE_NINF -1
615 static const yytype_uint8 yytable[] =
617 23, 24, 16, 1, 2, 3, 4, 5, 6, 7,
618 25, 8, 9, 26, 10, 29, 16, 1, 2, 3,
619 30, 31, 27, 17, 32, 18, 0, 28, 10, 1,
620 2, 3, 0, 0, 0, 17, 0, 0, 0, 0,
624 static const yytype_int8 yycheck[] =
626 2, 3, 0, 3, 4, 5, 6, 7, 8, 9,
627 0, 11, 12, 10, 14, 8, 14, 3, 4, 5,
628 22, 8, 14, 9, 8, 11, -1, 18, 14, 3,
629 4, 5, -1, -1, -1, 9, -1, -1, -1, -1,
633 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
634 symbol of state STATE-NUM. */
635 static const yytype_uint8 yystos[] =
637 0, 3, 4, 5, 6, 7, 8, 9, 11, 12,
638 14, 16, 17, 18, 19, 20, 21, 9, 11, 21,
639 22, 23, 24, 23, 23, 0, 10, 18, 22, 8,
640 23, 8, 8
643 #define yyerrok (yyerrstatus = 0)
644 #define yyclearin (yychar = YYEMPTY)
645 #define YYEMPTY (-2)
646 #define YYEOF 0
648 #define YYACCEPT goto yyacceptlab
649 #define YYABORT goto yyabortlab
650 #define YYERROR goto yyerrorlab
653 /* Like YYERROR except do call yyerror. This remains here temporarily
654 to ease the transition to the new meaning of YYERROR, for GCC.
655 Once GCC version 2 has supplanted version 1, this can go. */
657 #define YYFAIL goto yyerrlab
659 #define YYRECOVERING() (!!yyerrstatus)
661 #define YYBACKUP(Token, Value) \
662 do \
663 if (yychar == YYEMPTY && yylen == 1) \
665 yychar = (Token); \
666 yylval = (Value); \
667 yytoken = YYTRANSLATE (yychar); \
668 YYPOPSTACK (1); \
669 goto yybackup; \
671 else \
673 yyerror (YY_("syntax error: cannot back up")); \
674 YYERROR; \
676 while (YYID (0))
679 #define YYTERROR 1
680 #define YYERRCODE 256
683 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
684 If N is 0, then set CURRENT to the empty location which ends
685 the previous symbol: RHS[0] (always defined). */
687 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
688 #ifndef YYLLOC_DEFAULT
689 # define YYLLOC_DEFAULT(Current, Rhs, N) \
690 do \
691 if (YYID (N)) \
693 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
694 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
695 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
696 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
698 else \
700 (Current).first_line = (Current).last_line = \
701 YYRHSLOC (Rhs, 0).last_line; \
702 (Current).first_column = (Current).last_column = \
703 YYRHSLOC (Rhs, 0).last_column; \
705 while (YYID (0))
706 #endif
709 /* YY_LOCATION_PRINT -- Print the location on the stream.
710 This macro was not mandated originally: define only if we know
711 we won't break user code: when these are the locations we know. */
713 #ifndef YY_LOCATION_PRINT
714 # if YYLTYPE_IS_TRIVIAL
715 # define YY_LOCATION_PRINT(File, Loc) \
716 fprintf (File, "%d.%d-%d.%d", \
717 (Loc).first_line, (Loc).first_column, \
718 (Loc).last_line, (Loc).last_column)
719 # else
720 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
721 # endif
722 #endif
725 /* YYLEX -- calling `yylex' with the right arguments. */
727 #ifdef YYLEX_PARAM
728 # define YYLEX yylex (&yylval, YYLEX_PARAM)
729 #else
730 # define YYLEX yylex (&yylval)
731 #endif
733 /* Enable debugging if requested. */
734 #if YYDEBUG
736 # ifndef YYFPRINTF
737 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
738 # define YYFPRINTF fprintf
739 # endif
741 # define YYDPRINTF(Args) \
742 do { \
743 if (yydebug) \
744 YYFPRINTF Args; \
745 } while (YYID (0))
747 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
748 do { \
749 if (yydebug) \
751 YYFPRINTF (stderr, "%s ", Title); \
752 yy_symbol_print (stderr, \
753 Type, Value); \
754 YYFPRINTF (stderr, "\n"); \
756 } while (YYID (0))
759 /*--------------------------------.
760 | Print this symbol on YYOUTPUT. |
761 `--------------------------------*/
763 /*ARGSUSED*/
764 #if (defined __STDC__ || defined __C99__FUNC__ \
765 || defined __cplusplus || defined _MSC_VER)
766 static void
767 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
768 #else
769 static void
770 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
771 FILE *yyoutput;
772 int yytype;
773 YYSTYPE const * const yyvaluep;
774 #endif
776 if (!yyvaluep)
777 return;
778 # ifdef YYPRINT
779 if (yytype < YYNTOKENS)
780 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
781 # else
782 YYUSE (yyoutput);
783 # endif
784 switch (yytype)
786 default:
787 break;
792 /*--------------------------------.
793 | Print this symbol on YYOUTPUT. |
794 `--------------------------------*/
796 #if (defined __STDC__ || defined __C99__FUNC__ \
797 || defined __cplusplus || defined _MSC_VER)
798 static void
799 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
800 #else
801 static void
802 yy_symbol_print (yyoutput, yytype, yyvaluep)
803 FILE *yyoutput;
804 int yytype;
805 YYSTYPE const * const yyvaluep;
806 #endif
808 if (yytype < YYNTOKENS)
809 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
810 else
811 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
813 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
814 YYFPRINTF (yyoutput, ")");
817 /*------------------------------------------------------------------.
818 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
819 | TOP (included). |
820 `------------------------------------------------------------------*/
822 #if (defined __STDC__ || defined __C99__FUNC__ \
823 || defined __cplusplus || defined _MSC_VER)
824 static void
825 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
826 #else
827 static void
828 yy_stack_print (bottom, top)
829 yytype_int16 *bottom;
830 yytype_int16 *top;
831 #endif
833 YYFPRINTF (stderr, "Stack now");
834 for (; bottom <= top; ++bottom)
835 YYFPRINTF (stderr, " %d", *bottom);
836 YYFPRINTF (stderr, "\n");
839 # define YY_STACK_PRINT(Bottom, Top) \
840 do { \
841 if (yydebug) \
842 yy_stack_print ((Bottom), (Top)); \
843 } while (YYID (0))
846 /*------------------------------------------------.
847 | Report that the YYRULE is going to be reduced. |
848 `------------------------------------------------*/
850 #if (defined __STDC__ || defined __C99__FUNC__ \
851 || defined __cplusplus || defined _MSC_VER)
852 static void
853 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
854 #else
855 static void
856 yy_reduce_print (yyvsp, yyrule)
857 YYSTYPE *yyvsp;
858 int yyrule;
859 #endif
861 int yynrhs = yyr2[yyrule];
862 int yyi;
863 unsigned long int yylno = yyrline[yyrule];
864 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
865 yyrule - 1, yylno);
866 /* The symbols being reduced. */
867 for (yyi = 0; yyi < yynrhs; yyi++)
869 fprintf (stderr, " $%d = ", yyi + 1);
870 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
871 &(yyvsp[(yyi + 1) - (yynrhs)])
873 fprintf (stderr, "\n");
877 # define YY_REDUCE_PRINT(Rule) \
878 do { \
879 if (yydebug) \
880 yy_reduce_print (yyvsp, Rule); \
881 } while (YYID (0))
883 /* Nonzero means print parse trace. It is left uninitialized so that
884 multiple parsers can coexist. */
885 int yydebug;
886 #else /* !YYDEBUG */
887 # define YYDPRINTF(Args)
888 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
889 # define YY_STACK_PRINT(Bottom, Top)
890 # define YY_REDUCE_PRINT(Rule)
891 #endif /* !YYDEBUG */
894 /* YYINITDEPTH -- initial size of the parser's stacks. */
895 #ifndef YYINITDEPTH
896 # define YYINITDEPTH 200
897 #endif
899 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
900 if the built-in stack extension method is used).
902 Do not make this value too large; the results are undefined if
903 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
904 evaluated with infinite-precision integer arithmetic. */
906 #ifndef YYMAXDEPTH
907 # define YYMAXDEPTH 10000
908 #endif
912 #if YYERROR_VERBOSE
914 # ifndef yystrlen
915 # if defined __GLIBC__ && defined _STRING_H
916 # define yystrlen strlen
917 # else
918 /* Return the length of YYSTR. */
919 #if (defined __STDC__ || defined __C99__FUNC__ \
920 || defined __cplusplus || defined _MSC_VER)
921 static YYSIZE_T
922 yystrlen (const char *yystr)
923 #else
924 static YYSIZE_T
925 yystrlen (yystr)
926 const char *yystr;
927 #endif
929 YYSIZE_T yylen;
930 for (yylen = 0; yystr[yylen]; yylen++)
931 continue;
932 return yylen;
934 # endif
935 # endif
937 # ifndef yystpcpy
938 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
939 # define yystpcpy stpcpy
940 # else
941 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
942 YYDEST. */
943 #if (defined __STDC__ || defined __C99__FUNC__ \
944 || defined __cplusplus || defined _MSC_VER)
945 static char *
946 yystpcpy (char *yydest, const char *yysrc)
947 #else
948 static char *
949 yystpcpy (yydest, yysrc)
950 char *yydest;
951 const char *yysrc;
952 #endif
954 char *yyd = yydest;
955 const char *yys = yysrc;
957 while ((*yyd++ = *yys++) != '\0')
958 continue;
960 return yyd - 1;
962 # endif
963 # endif
965 # ifndef yytnamerr
966 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
967 quotes and backslashes, so that it's suitable for yyerror. The
968 heuristic is that double-quoting is unnecessary unless the string
969 contains an apostrophe, a comma, or backslash (other than
970 backslash-backslash). YYSTR is taken from yytname. If YYRES is
971 null, do not copy; instead, return the length of what the result
972 would have been. */
973 static YYSIZE_T
974 yytnamerr (char *yyres, const char *yystr)
976 if (*yystr == '"')
978 YYSIZE_T yyn = 0;
979 char const *yyp = yystr;
981 for (;;)
982 switch (*++yyp)
984 case '\'':
985 case ',':
986 goto do_not_strip_quotes;
988 case '\\':
989 if (*++yyp != '\\')
990 goto do_not_strip_quotes;
991 /* Fall through. */
992 default:
993 if (yyres)
994 yyres[yyn] = *yyp;
995 yyn++;
996 break;
998 case '"':
999 if (yyres)
1000 yyres[yyn] = '\0';
1001 return yyn;
1003 do_not_strip_quotes: ;
1006 if (! yyres)
1007 return yystrlen (yystr);
1009 return yystpcpy (yyres, yystr) - yyres;
1011 # endif
1013 /* Copy into YYRESULT an error message about the unexpected token
1014 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1015 including the terminating null byte. If YYRESULT is null, do not
1016 copy anything; just return the number of bytes that would be
1017 copied. As a special case, return 0 if an ordinary "syntax error"
1018 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1019 size calculation. */
1020 static YYSIZE_T
1021 yysyntax_error (char *yyresult, int yystate, int yychar)
1023 int yyn = yypact[yystate];
1025 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1026 return 0;
1027 else
1029 int yytype = YYTRANSLATE (yychar);
1030 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1031 YYSIZE_T yysize = yysize0;
1032 YYSIZE_T yysize1;
1033 int yysize_overflow = 0;
1034 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1035 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1036 int yyx;
1038 # if 0
1039 /* This is so xgettext sees the translatable formats that are
1040 constructed on the fly. */
1041 YY_("syntax error, unexpected %s");
1042 YY_("syntax error, unexpected %s, expecting %s");
1043 YY_("syntax error, unexpected %s, expecting %s or %s");
1044 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1045 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1046 # endif
1047 char *yyfmt;
1048 char const *yyf;
1049 static char const yyunexpected[] = "syntax error, unexpected %s";
1050 static char const yyexpecting[] = ", expecting %s";
1051 static char const yyor[] = " or %s";
1052 char yyformat[sizeof yyunexpected
1053 + sizeof yyexpecting - 1
1054 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1055 * (sizeof yyor - 1))];
1056 char const *yyprefix = yyexpecting;
1058 /* Start YYX at -YYN if negative to avoid negative indexes in
1059 YYCHECK. */
1060 int yyxbegin = yyn < 0 ? -yyn : 0;
1062 /* Stay within bounds of both yycheck and yytname. */
1063 int yychecklim = YYLAST - yyn + 1;
1064 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1065 int yycount = 1;
1067 yyarg[0] = yytname[yytype];
1068 yyfmt = yystpcpy (yyformat, yyunexpected);
1070 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1071 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1073 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1075 yycount = 1;
1076 yysize = yysize0;
1077 yyformat[sizeof yyunexpected - 1] = '\0';
1078 break;
1080 yyarg[yycount++] = yytname[yyx];
1081 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1082 yysize_overflow |= (yysize1 < yysize);
1083 yysize = yysize1;
1084 yyfmt = yystpcpy (yyfmt, yyprefix);
1085 yyprefix = yyor;
1088 yyf = YY_(yyformat);
1089 yysize1 = yysize + yystrlen (yyf);
1090 yysize_overflow |= (yysize1 < yysize);
1091 yysize = yysize1;
1093 if (yysize_overflow)
1094 return YYSIZE_MAXIMUM;
1096 if (yyresult)
1098 /* Avoid sprintf, as that infringes on the user's name space.
1099 Don't have undefined behavior even if the translation
1100 produced a string with the wrong number of "%s"s. */
1101 char *yyp = yyresult;
1102 int yyi = 0;
1103 while ((*yyp = *yyf) != '\0')
1105 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1107 yyp += yytnamerr (yyp, yyarg[yyi++]);
1108 yyf += 2;
1110 else
1112 yyp++;
1113 yyf++;
1117 return yysize;
1120 #endif /* YYERROR_VERBOSE */
1123 /*-----------------------------------------------.
1124 | Release the memory associated to this symbol. |
1125 `-----------------------------------------------*/
1127 /*ARGSUSED*/
1128 #if (defined __STDC__ || defined __C99__FUNC__ \
1129 || defined __cplusplus || defined _MSC_VER)
1130 static void
1131 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1132 #else
1133 static void
1134 yydestruct (yymsg, yytype, yyvaluep)
1135 const char *yymsg;
1136 int yytype;
1137 YYSTYPE *yyvaluep;
1138 #endif
1140 YYUSE (yyvaluep);
1142 if (!yymsg)
1143 yymsg = "Deleting";
1144 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1146 switch (yytype)
1149 default:
1150 break;
1155 /* Prevent warnings from -Wmissing-prototypes. */
1157 #ifdef YYPARSE_PARAM
1158 #if defined __STDC__ || defined __cplusplus
1159 int yyparse (void *YYPARSE_PARAM);
1160 #else
1161 int yyparse ();
1162 #endif
1163 #else /* ! YYPARSE_PARAM */
1164 #if defined __STDC__ || defined __cplusplus
1165 int yyparse (void);
1166 #else
1167 int yyparse ();
1168 #endif
1169 #endif /* ! YYPARSE_PARAM */
1176 /*----------.
1177 | yyparse. |
1178 `----------*/
1180 #ifdef YYPARSE_PARAM
1181 #if (defined __STDC__ || defined __C99__FUNC__ \
1182 || defined __cplusplus || defined _MSC_VER)
1184 yyparse (void *YYPARSE_PARAM)
1185 #else
1187 yyparse (YYPARSE_PARAM)
1188 void *YYPARSE_PARAM;
1189 #endif
1190 #else /* ! YYPARSE_PARAM */
1191 #if (defined __STDC__ || defined __C99__FUNC__ \
1192 || defined __cplusplus || defined _MSC_VER)
1194 yyparse (void)
1195 #else
1197 yyparse ()
1199 #endif
1200 #endif
1202 /* The look-ahead symbol. */
1203 int yychar;
1205 /* The semantic value of the look-ahead symbol. */
1206 YYSTYPE yylval;
1208 /* Number of syntax errors so far. */
1209 int yynerrs;
1211 int yystate;
1212 int yyn;
1213 int yyresult;
1214 /* Number of tokens to shift before error messages enabled. */
1215 int yyerrstatus;
1216 /* Look-ahead token as an internal (translated) token number. */
1217 int yytoken = 0;
1218 #if YYERROR_VERBOSE
1219 /* Buffer for error messages, and its allocated size. */
1220 char yymsgbuf[128];
1221 char *yymsg = yymsgbuf;
1222 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1223 #endif
1225 /* Three stacks and their tools:
1226 `yyss': related to states,
1227 `yyvs': related to semantic values,
1228 `yyls': related to locations.
1230 Refer to the stacks thru separate pointers, to allow yyoverflow
1231 to reallocate them elsewhere. */
1233 /* The state stack. */
1234 yytype_int16 yyssa[YYINITDEPTH];
1235 yytype_int16 *yyss = yyssa;
1236 yytype_int16 *yyssp;
1238 /* The semantic value stack. */
1239 YYSTYPE yyvsa[YYINITDEPTH];
1240 YYSTYPE *yyvs = yyvsa;
1241 YYSTYPE *yyvsp;
1245 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1247 YYSIZE_T yystacksize = YYINITDEPTH;
1249 /* The variables used to return semantic value and location from the
1250 action routines. */
1251 YYSTYPE yyval;
1254 /* The number of symbols on the RHS of the reduced rule.
1255 Keep to zero when no symbol should be popped. */
1256 int yylen = 0;
1258 YYDPRINTF ((stderr, "Starting parse\n"));
1260 yystate = 0;
1261 yyerrstatus = 0;
1262 yynerrs = 0;
1263 yychar = YYEMPTY; /* Cause a token to be read. */
1265 /* Initialize stack pointers.
1266 Waste one element of value and location stack
1267 so that they stay on the same level as the state stack.
1268 The wasted elements are never initialized. */
1270 yyssp = yyss;
1271 yyvsp = yyvs;
1273 goto yysetstate;
1275 /*------------------------------------------------------------.
1276 | yynewstate -- Push a new state, which is found in yystate. |
1277 `------------------------------------------------------------*/
1278 yynewstate:
1279 /* In all cases, when you get here, the value and location stacks
1280 have just been pushed. So pushing a state here evens the stacks. */
1281 yyssp++;
1283 yysetstate:
1284 *yyssp = yystate;
1286 if (yyss + yystacksize - 1 <= yyssp)
1288 /* Get the current used size of the three stacks, in elements. */
1289 YYSIZE_T yysize = yyssp - yyss + 1;
1291 #ifdef yyoverflow
1293 /* Give user a chance to reallocate the stack. Use copies of
1294 these so that the &'s don't force the real ones into
1295 memory. */
1296 YYSTYPE *yyvs1 = yyvs;
1297 yytype_int16 *yyss1 = yyss;
1300 /* Each stack pointer address is followed by the size of the
1301 data in use in that stack, in bytes. This used to be a
1302 conditional around just the two extra args, but that might
1303 be undefined if yyoverflow is a macro. */
1304 yyoverflow (YY_("memory exhausted"),
1305 &yyss1, yysize * sizeof (*yyssp),
1306 &yyvs1, yysize * sizeof (*yyvsp),
1308 &yystacksize);
1310 yyss = yyss1;
1311 yyvs = yyvs1;
1313 #else /* no yyoverflow */
1314 # ifndef YYSTACK_RELOCATE
1315 goto yyexhaustedlab;
1316 # else
1317 /* Extend the stack our own way. */
1318 if (YYMAXDEPTH <= yystacksize)
1319 goto yyexhaustedlab;
1320 yystacksize *= 2;
1321 if (YYMAXDEPTH < yystacksize)
1322 yystacksize = YYMAXDEPTH;
1325 yytype_int16 *yyss1 = yyss;
1326 union yyalloc *yyptr =
1327 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1328 if (! yyptr)
1329 goto yyexhaustedlab;
1330 YYSTACK_RELOCATE (yyss);
1331 YYSTACK_RELOCATE (yyvs);
1333 # undef YYSTACK_RELOCATE
1334 if (yyss1 != yyssa)
1335 YYSTACK_FREE (yyss1);
1337 # endif
1338 #endif /* no yyoverflow */
1340 yyssp = yyss + yysize - 1;
1341 yyvsp = yyvs + yysize - 1;
1344 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1345 (unsigned long int) yystacksize));
1347 if (yyss + yystacksize - 1 <= yyssp)
1348 YYABORT;
1351 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1353 goto yybackup;
1355 /*-----------.
1356 | yybackup. |
1357 `-----------*/
1358 yybackup:
1360 /* Do appropriate processing given the current state. Read a
1361 look-ahead token if we need one and don't already have one. */
1363 /* First try to decide what to do without reference to look-ahead token. */
1364 yyn = yypact[yystate];
1365 if (yyn == YYPACT_NINF)
1366 goto yydefault;
1368 /* Not known => get a look-ahead token if don't already have one. */
1370 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1371 if (yychar == YYEMPTY)
1373 YYDPRINTF ((stderr, "Reading a token: "));
1374 yychar = YYLEX;
1377 if (yychar <= YYEOF)
1379 yychar = yytoken = YYEOF;
1380 YYDPRINTF ((stderr, "Now at end of input.\n"));
1382 else
1384 yytoken = YYTRANSLATE (yychar);
1385 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1388 /* If the proper action on seeing token YYTOKEN is to reduce or to
1389 detect an error, take that action. */
1390 yyn += yytoken;
1391 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1392 goto yydefault;
1393 yyn = yytable[yyn];
1394 if (yyn <= 0)
1396 if (yyn == 0 || yyn == YYTABLE_NINF)
1397 goto yyerrlab;
1398 yyn = -yyn;
1399 goto yyreduce;
1402 if (yyn == YYFINAL)
1403 YYACCEPT;
1405 /* Count tokens shifted since error; after three, turn off error
1406 status. */
1407 if (yyerrstatus)
1408 yyerrstatus--;
1410 /* Shift the look-ahead token. */
1411 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1413 /* Discard the shifted token unless it is eof. */
1414 if (yychar != YYEOF)
1415 yychar = YYEMPTY;
1417 yystate = yyn;
1418 *++yyvsp = yylval;
1420 goto yynewstate;
1423 /*-----------------------------------------------------------.
1424 | yydefault -- do the default action for the current state. |
1425 `-----------------------------------------------------------*/
1426 yydefault:
1427 yyn = yydefact[yystate];
1428 if (yyn == 0)
1429 goto yyerrlab;
1430 goto yyreduce;
1433 /*-----------------------------.
1434 | yyreduce -- Do a reduction. |
1435 `-----------------------------*/
1436 yyreduce:
1437 /* yyn is the number of a rule to reduce with. */
1438 yylen = yyr2[yyn];
1440 /* If YYLEN is nonzero, implement the default value of the action:
1441 `$$ = $1'.
1443 Otherwise, the following line sets YYVAL to garbage.
1444 This behavior is undocumented and Bison
1445 users should not rely upon it. Assigning to YYVAL
1446 unconditionally makes the parser a bit smaller, and it avoids a
1447 GCC warning that YYVAL may be used uninitialized. */
1448 yyval = yyvsp[1-yylen];
1451 YY_REDUCE_PRINT (yyn);
1452 switch (yyn)
1454 case 2:
1455 #line 117 "cmCommandArgumentParser.y"
1457 (yyval.str) = 0;
1458 yyGetParser->SetResult((yyvsp[(1) - (1)].str));
1460 break;
1462 case 3:
1463 #line 124 "cmCommandArgumentParser.y"
1465 (yyval.str) = (yyvsp[(1) - (1)].str);
1467 break;
1469 case 4:
1470 #line 129 "cmCommandArgumentParser.y"
1472 (yyval.str) = yyGetParser->CombineUnions((yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].str));
1474 break;
1476 case 5:
1477 #line 134 "cmCommandArgumentParser.y"
1479 (yyval.str) = 0;
1481 break;
1483 case 6:
1484 #line 139 "cmCommandArgumentParser.y"
1486 (yyval.str) = yyGetParser->CombineUnions((yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].str));
1488 break;
1490 case 7:
1491 #line 145 "cmCommandArgumentParser.y"
1493 (yyval.str) = (yyvsp[(1) - (1)].str);
1495 break;
1497 case 8:
1498 #line 150 "cmCommandArgumentParser.y"
1500 (yyval.str) = (yyvsp[(1) - (1)].str);
1502 break;
1504 case 9:
1505 #line 156 "cmCommandArgumentParser.y"
1507 (yyval.str) = (yyvsp[(1) - (1)].str);
1509 break;
1511 case 10:
1512 #line 161 "cmCommandArgumentParser.y"
1514 (yyval.str) = (yyvsp[(1) - (1)].str);
1516 break;
1518 case 11:
1519 #line 166 "cmCommandArgumentParser.y"
1521 (yyval.str) = (yyvsp[(1) - (1)].str);
1523 break;
1525 case 12:
1526 #line 171 "cmCommandArgumentParser.y"
1528 (yyval.str) = (yyvsp[(1) - (1)].str);
1530 break;
1532 case 13:
1533 #line 176 "cmCommandArgumentParser.y"
1535 (yyval.str) = (yyvsp[(1) - (1)].str);
1537 break;
1539 case 14:
1540 #line 181 "cmCommandArgumentParser.y"
1542 (yyval.str) = (yyvsp[(1) - (1)].str);
1544 break;
1546 case 15:
1547 #line 187 "cmCommandArgumentParser.y"
1549 (yyval.str) = yyGetParser->ExpandSpecialVariable((yyvsp[(1) - (3)].str),(yyvsp[(2) - (3)].str));
1550 //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl;
1552 break;
1554 case 16:
1555 #line 193 "cmCommandArgumentParser.y"
1557 (yyval.str) = yyGetParser->ExpandSpecialVariable((yyvsp[(1) - (3)].str),(yyvsp[(2) - (3)].str));
1558 //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl;
1560 break;
1562 case 17:
1563 #line 199 "cmCommandArgumentParser.y"
1565 (yyval.str) = yyGetParser->ExpandVariable((yyvsp[(2) - (3)].str));
1566 //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl;
1568 break;
1570 case 18:
1571 #line 205 "cmCommandArgumentParser.y"
1573 (yyval.str) = yyGetParser->ExpandVariableForAt((yyvsp[(1) - (1)].str));
1575 break;
1577 case 19:
1578 #line 211 "cmCommandArgumentParser.y"
1580 (yyval.str) = (yyvsp[(1) - (1)].str);
1582 break;
1584 case 20:
1585 #line 216 "cmCommandArgumentParser.y"
1587 (yyval.str) = (yyvsp[(1) - (2)].str);
1589 break;
1591 case 21:
1592 #line 221 "cmCommandArgumentParser.y"
1594 (yyval.str) = 0;
1596 break;
1598 case 22:
1599 #line 226 "cmCommandArgumentParser.y"
1601 (yyval.str) = yyGetParser->CombineUnions((yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].str));
1603 break;
1605 case 23:
1606 #line 232 "cmCommandArgumentParser.y"
1608 (yyval.str) = (yyvsp[(1) - (1)].str);
1610 break;
1612 case 24:
1613 #line 237 "cmCommandArgumentParser.y"
1615 (yyval.str) = (yyvsp[(1) - (1)].str);
1617 break;
1620 /* Line 1267 of yacc.c. */
1621 #line 1606 "cmCommandArgumentParser.cxx"
1622 default: break;
1624 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1626 YYPOPSTACK (yylen);
1627 yylen = 0;
1628 YY_STACK_PRINT (yyss, yyssp);
1630 *++yyvsp = yyval;
1633 /* Now `shift' the result of the reduction. Determine what state
1634 that goes to, based on the state we popped back to and the rule
1635 number reduced by. */
1637 yyn = yyr1[yyn];
1639 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1640 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1641 yystate = yytable[yystate];
1642 else
1643 yystate = yydefgoto[yyn - YYNTOKENS];
1645 goto yynewstate;
1648 /*------------------------------------.
1649 | yyerrlab -- here on detecting error |
1650 `------------------------------------*/
1651 yyerrlab:
1652 /* If not already recovering from an error, report this error. */
1653 if (!yyerrstatus)
1655 ++yynerrs;
1656 #if ! YYERROR_VERBOSE
1657 yyerror (YY_("syntax error"));
1658 #else
1660 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1661 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1663 YYSIZE_T yyalloc = 2 * yysize;
1664 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1665 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1666 if (yymsg != yymsgbuf)
1667 YYSTACK_FREE (yymsg);
1668 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1669 if (yymsg)
1670 yymsg_alloc = yyalloc;
1671 else
1673 yymsg = yymsgbuf;
1674 yymsg_alloc = sizeof yymsgbuf;
1678 if (0 < yysize && yysize <= yymsg_alloc)
1680 (void) yysyntax_error (yymsg, yystate, yychar);
1681 yyerror (yymsg);
1683 else
1685 yyerror (YY_("syntax error"));
1686 if (yysize != 0)
1687 goto yyexhaustedlab;
1690 #endif
1695 if (yyerrstatus == 3)
1697 /* If just tried and failed to reuse look-ahead token after an
1698 error, discard it. */
1700 if (yychar <= YYEOF)
1702 /* Return failure if at end of input. */
1703 if (yychar == YYEOF)
1704 YYABORT;
1706 else
1708 yydestruct ("Error: discarding",
1709 yytoken, &yylval);
1710 yychar = YYEMPTY;
1714 /* Else will try to reuse look-ahead token after shifting the error
1715 token. */
1716 goto yyerrlab1;
1719 /*---------------------------------------------------.
1720 | yyerrorlab -- error raised explicitly by YYERROR. |
1721 `---------------------------------------------------*/
1722 yyerrorlab:
1724 /* Pacify compilers like GCC when the user code never invokes
1725 YYERROR and the label yyerrorlab therefore never appears in user
1726 code. */
1727 if (/*CONSTCOND*/ 0)
1728 goto yyerrorlab;
1730 /* Do not reclaim the symbols of the rule which action triggered
1731 this YYERROR. */
1732 YYPOPSTACK (yylen);
1733 yylen = 0;
1734 YY_STACK_PRINT (yyss, yyssp);
1735 yystate = *yyssp;
1736 goto yyerrlab1;
1739 /*-------------------------------------------------------------.
1740 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1741 `-------------------------------------------------------------*/
1742 yyerrlab1:
1743 yyerrstatus = 3; /* Each real token shifted decrements this. */
1745 for (;;)
1747 yyn = yypact[yystate];
1748 if (yyn != YYPACT_NINF)
1750 yyn += YYTERROR;
1751 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1753 yyn = yytable[yyn];
1754 if (0 < yyn)
1755 break;
1759 /* Pop the current state because it cannot handle the error token. */
1760 if (yyssp == yyss)
1761 YYABORT;
1764 yydestruct ("Error: popping",
1765 yystos[yystate], yyvsp);
1766 YYPOPSTACK (1);
1767 yystate = *yyssp;
1768 YY_STACK_PRINT (yyss, yyssp);
1771 if (yyn == YYFINAL)
1772 YYACCEPT;
1774 *++yyvsp = yylval;
1777 /* Shift the error token. */
1778 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1780 yystate = yyn;
1781 goto yynewstate;
1784 /*-------------------------------------.
1785 | yyacceptlab -- YYACCEPT comes here. |
1786 `-------------------------------------*/
1787 yyacceptlab:
1788 yyresult = 0;
1789 goto yyreturn;
1791 /*-----------------------------------.
1792 | yyabortlab -- YYABORT comes here. |
1793 `-----------------------------------*/
1794 yyabortlab:
1795 yyresult = 1;
1796 goto yyreturn;
1798 #ifndef yyoverflow
1799 /*-------------------------------------------------.
1800 | yyexhaustedlab -- memory exhaustion comes here. |
1801 `-------------------------------------------------*/
1802 yyexhaustedlab:
1803 yyerror (YY_("memory exhausted"));
1804 yyresult = 2;
1805 /* Fall through. */
1806 #endif
1808 yyreturn:
1809 if (yychar != YYEOF && yychar != YYEMPTY)
1810 yydestruct ("Cleanup: discarding lookahead",
1811 yytoken, &yylval);
1812 /* Do not reclaim the symbols of the rule which action triggered
1813 this YYABORT or YYACCEPT. */
1814 YYPOPSTACK (yylen);
1815 YY_STACK_PRINT (yyss, yyssp);
1816 while (yyssp != yyss)
1818 yydestruct ("Cleanup: popping",
1819 yystos[*yyssp], yyvsp);
1820 YYPOPSTACK (1);
1822 #ifndef yyoverflow
1823 if (yyss != yyssa)
1824 YYSTACK_FREE (yyss);
1825 #endif
1826 #if YYERROR_VERBOSE
1827 if (yymsg != yymsgbuf)
1828 YYSTACK_FREE (yymsg);
1829 #endif
1830 /* Make sure YYID is used. */
1831 return YYID (yyresult);
1835 #line 242 "cmCommandArgumentParser.y"
1837 /* End of grammar */
1839 /*--------------------------------------------------------------------------*/
1840 void cmCommandArgumentError(yyscan_t yyscanner, const char* message)
1842 yyGetParser->Error(message);