ENH: keep cleaning up Tcl/Tk modules
[cmake.git] / Source / cmCommandArgumentParser.cxx
blob8ea1e3aee22a03883be9b2837441d1b010ad88a7
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCommandArgumentParser.cxx,v $
5 Language: C++
6 Date: $Date: 2007-07-27 14:55:24 $
7 Version: $Revision: 1.13 $
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.1. */
19 /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984,
20 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation,
21 Inc.
23 This program is free software; you can redistribute it and/or modify
24 it under the terms of the GNU General Public License as published by
25 the Free Software Foundation; either version 2, or (at your option)
26 any later version.
28 This program is distributed in the hope that it will be useful,
29 but WITHOUT ANY WARRANTY; without even the implied warranty of
30 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 GNU General Public License for more details.
33 You should have received a copy of the GNU General Public License
34 along with this program; if not, write to the Free Software
35 Foundation, Inc., 51 Franklin Street, Fifth Floor,
36 Boston, MA 02110-1301, USA. */
38 /* As a special exception, when this file is copied by Bison into a
39 Bison output file, you may use that output file without restriction.
40 This special exception was added by the Free Software Foundation
41 in version 1.24 of Bison. */
43 /* Written by Richard Stallman by simplifying the original so called
44 ``semantic'' parser. */
46 /* All symbols defined below should begin with yy or YY, to avoid
47 infringing on user name space. This should be done even for local
48 variables, as they might otherwise be expanded by user macros.
49 There are some unavoidable exceptions within include files to
50 define necessary library symbols; they are noted "INFRINGES ON
51 USER NAME SPACE" below. */
53 /* turn off some warning as this is generated code */
54 #if defined(_MSC_VER)
55 # pragma warning ( disable : 4702 ) /* unreachable code */
56 #endif
58 /* Identify Bison output. */
59 #define YYBISON 1
61 /* Bison version. */
62 #define YYBISON_VERSION "2.1"
64 /* Skeleton name. */
65 #define YYSKELETON_NAME "yacc.c"
67 /* Pure parsers. */
68 #define YYPURE 1
70 /* Using locations. */
71 #define YYLSP_NEEDED 0
73 /* Substitute the variable and function names. */
74 #define yyparse cmCommandArgument_yyparse
75 #define yylex cmCommandArgument_yylex
76 #define yyerror cmCommandArgument_yyerror
77 #define yylval cmCommandArgument_yylval
78 #define yychar cmCommandArgument_yychar
79 #define yydebug cmCommandArgument_yydebug
80 #define yynerrs cmCommandArgument_yynerrs
83 /* Tokens. */
84 #ifndef YYTOKENTYPE
85 # define YYTOKENTYPE
86 /* Put the tokens into the symbol table, so that GDB and other debuggers
87 know about them. */
88 enum yytokentype {
89 cal_NCURLY = 258,
90 cal_DCURLY = 259,
91 cal_DOLLAR = 260,
92 cal_LCURLY = 261,
93 cal_RCURLY = 262,
94 cal_NAME = 263,
95 cal_BSLASH = 264,
96 cal_SYMBOL = 265,
97 cal_AT = 266,
98 cal_ERROR = 267,
99 cal_ATNAME = 268
101 #endif
102 /* Tokens. */
103 #define cal_NCURLY 258
104 #define cal_DCURLY 259
105 #define cal_DOLLAR 260
106 #define cal_LCURLY 261
107 #define cal_RCURLY 262
108 #define cal_NAME 263
109 #define cal_BSLASH 264
110 #define cal_SYMBOL 265
111 #define cal_AT 266
112 #define cal_ERROR 267
113 #define cal_ATNAME 268
118 /* Copy the first part of user declarations. */
119 #line 1 "cmCommandArgumentParser.y"
121 /*=========================================================================
123 Program: CMake - Cross-Platform Makefile Generator
124 Module: $RCSfile: cmCommandArgumentParser.cxx,v $
125 Language: C++
126 Date: $Date: 2007-07-27 14:55:24 $
127 Version: $Revision: 1.13 $
129 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
130 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
132 This software is distributed WITHOUT ANY WARRANTY; without even
133 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
134 PURPOSE. See the above copyright notices for more information.
136 =========================================================================*/
139 This file must be translated to C and modified to build everywhere.
141 Run bison like this:
143 bison --yacc --name-prefix=cmCommandArgument_yy
144 --defines=cmCommandArgumentParserTokens.h -ocmCommandArgumentParser.cxx
145 cmCommandArgumentParser.y
147 Modify cmCommandArgumentParser.cxx:
148 - remove TABs
152 #include "cmStandardIncludes.h"
154 /* Configure the parser to use a lexer object. */
155 #define YYPARSE_PARAM yyscanner
156 #define YYLEX_PARAM yyscanner
157 #define YYERROR_VERBOSE 1
158 #define cmCommandArgument_yyerror(x) \
159 cmCommandArgumentError(yyscanner, x)
160 #define yyGetParser (cmCommandArgument_yyget_extra(yyscanner))
162 /* Make sure malloc and free are available on QNX. */
163 #ifdef __QNX__
164 # include <malloc.h>
165 #endif
167 /* Make sure the parser uses standard memory allocation. The default
168 generated parser malloc/free declarations do not work on all
169 platforms. */
170 #include <stdlib.h>
171 #define YYMALLOC malloc
172 #define YYFREE free
174 /*-------------------------------------------------------------------------*/
175 #include "cmCommandArgumentParserHelper.h" /* Interface to parser object. */
176 #include "cmCommandArgumentLexer.h" /* Interface to lexer object. */
177 #include "cmCommandArgumentParserTokens.h" /* Need YYSTYPE for YY_DECL. */
179 /* Forward declare the lexer entry point. */
180 YY_DECL;
182 /* Internal utility functions. */
183 static void cmCommandArgumentError(yyscan_t yyscanner, const char* message);
185 #define YYDEBUG 1
186 // Set these high so that
187 #define YYMAXDEPTH 100000
188 #define YYINITDEPTH 10000
191 /* Disable some warnings in the generated code. */
192 #ifdef __BORLANDC__
193 # pragma warn -8004 /* Variable assigned a value that is not used. */
194 # pragma warn -8008 /* condition always returns true */
195 # pragma warn -8060 /* possibly incorrect assignment */
196 # pragma warn -8066 /* unreachable code */
197 #endif
198 #ifdef _MSC_VER
199 # pragma warning (disable: 4102) /* Unused goto label. */
200 # pragma warning (disable: 4065) /* Switch statement contains default but no
201 case. */
202 #endif
205 /* Enabling traces. */
206 #ifndef YYDEBUG
207 # define YYDEBUG 0
208 #endif
210 /* Enabling verbose error messages. */
211 #ifdef YYERROR_VERBOSE
212 # undef YYERROR_VERBOSE
213 # define YYERROR_VERBOSE 1
214 #else
215 # define YYERROR_VERBOSE 0
216 #endif
218 /* Enabling the token table. */
219 #ifndef YYTOKEN_TABLE
220 # define YYTOKEN_TABLE 0
221 #endif
223 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
224 typedef int YYSTYPE;
225 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
226 # define YYSTYPE_IS_DECLARED 1
227 # define YYSTYPE_IS_TRIVIAL 1
228 #endif
232 /* Copy the second part of user declarations. */
235 /* Line 219 of yacc.c. */
236 #line 195 "cmCommandArgumentParser.cxx"
238 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
239 # define YYSIZE_T __SIZE_TYPE__
240 #endif
241 #if ! defined (YYSIZE_T) && defined (size_t)
242 # define YYSIZE_T size_t
243 #endif
244 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
245 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
246 # define YYSIZE_T size_t
247 #endif
248 #if ! defined (YYSIZE_T)
249 # define YYSIZE_T unsigned int
250 #endif
252 #ifndef YY_
253 # if YYENABLE_NLS
254 # if ENABLE_NLS
255 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
256 # define YY_(msgid) dgettext ("bison-runtime", msgid)
257 # endif
258 # endif
259 # ifndef YY_
260 # define YY_(msgid) msgid
261 # endif
262 #endif
264 #if ! defined (yyoverflow) || YYERROR_VERBOSE
266 /* The parser invokes alloca or malloc; define the necessary symbols. */
268 # ifdef YYSTACK_USE_ALLOCA
269 # if YYSTACK_USE_ALLOCA
270 # ifdef __GNUC__
271 # define YYSTACK_ALLOC __builtin_alloca
272 # else
273 # define YYSTACK_ALLOC alloca
274 # if defined (__STDC__) || defined (__cplusplus)
275 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
276 # define YYINCLUDED_STDLIB_H
277 # endif
278 # endif
279 # endif
280 # endif
282 # ifdef YYSTACK_ALLOC
283 /* Pacify GCC's `empty if-body' warning. */
284 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
285 # ifndef YYSTACK_ALLOC_MAXIMUM
286 /* The OS might guarantee only one guard page at the bottom of the stack,
287 and a page size can be as small as 4096 bytes. So we cannot safely
288 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
289 to allow for a few compiler-allocated temporary stack slots. */
290 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
291 # endif
292 # else
293 # define YYSTACK_ALLOC YYMALLOC
294 # define YYSTACK_FREE YYFREE
295 # ifndef YYSTACK_ALLOC_MAXIMUM
296 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
297 # endif
298 # ifdef __cplusplus
299 extern "C" {
300 # endif
301 # ifndef YYMALLOC
302 # define YYMALLOC malloc
303 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
304 && (defined (__STDC__) || defined (__cplusplus)))
305 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
306 # endif
307 # endif
308 # ifndef YYFREE
309 # define YYFREE free
310 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
311 && (defined (__STDC__) || defined (__cplusplus)))
312 void free (void *); /* INFRINGES ON USER NAME SPACE */
313 # endif
314 # endif
315 # ifdef __cplusplus
317 # endif
318 # endif
319 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
322 #if (! defined (yyoverflow) \
323 && (! defined (__cplusplus) \
324 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
326 /* A type that is properly aligned for any stack member. */
327 union yyalloc
329 short int yyss;
330 YYSTYPE yyvs;
333 /* The size of the maximum gap between one aligned stack and the next. */
334 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
336 /* The size of an array large to enough to hold all stacks, each with
337 N elements. */
338 # define YYSTACK_BYTES(N) \
339 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
340 + YYSTACK_GAP_MAXIMUM)
342 /* Copy COUNT objects from FROM to TO. The source and destination do
343 not overlap. */
344 # ifndef YYCOPY
345 # if defined (__GNUC__) && 1 < __GNUC__
346 # define YYCOPY(To, From, Count) \
347 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
348 # else
349 # define YYCOPY(To, From, Count) \
350 do \
352 YYSIZE_T yyi; \
353 for (yyi = 0; yyi < (Count); yyi++) \
354 (To)[yyi] = (From)[yyi]; \
356 while (0)
357 # endif
358 # endif
360 /* Relocate STACK from its old location to the new one. The
361 local variables YYSIZE and YYSTACKSIZE give the old and new number of
362 elements in the stack, and YYPTR gives the new location of the
363 stack. Advance YYPTR to a properly aligned location for the next
364 stack. */
365 # define YYSTACK_RELOCATE(Stack) \
366 do \
368 YYSIZE_T yynewbytes; \
369 YYCOPY (&yyptr->Stack, Stack, yysize); \
370 Stack = &yyptr->Stack; \
371 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
372 yyptr += yynewbytes / sizeof (*yyptr); \
374 while (0)
376 #endif
378 #if defined (__STDC__) || defined (__cplusplus)
379 typedef signed char yysigned_char;
380 #else
381 typedef short int yysigned_char;
382 #endif
384 /* YYFINAL -- State number of the termination state. */
385 #define YYFINAL 21
386 /* YYLAST -- Last index in YYTABLE. */
387 #define YYLAST 25
389 /* YYNTOKENS -- Number of terminals. */
390 #define YYNTOKENS 14
391 /* YYNNTS -- Number of nonterminals. */
392 #define YYNNTS 9
393 /* YYNRULES -- Number of rules. */
394 #define YYNRULES 21
395 /* YYNRULES -- Number of states. */
396 #define YYNSTATES 27
398 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
399 #define YYUNDEFTOK 2
400 #define YYMAXUTOK 268
402 #define YYTRANSLATE(YYX) \
403 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
405 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
406 static const unsigned char yytranslate[] =
408 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
409 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
410 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
413 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
414 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
415 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
416 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
417 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
418 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
421 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
434 5, 6, 7, 8, 9, 10, 11, 12, 13
437 #if YYDEBUG
438 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
439 YYRHS. */
440 static const unsigned char yyprhs[] =
442 0, 0, 3, 5, 7, 10, 11, 14, 16, 18,
443 20, 22, 24, 26, 28, 30, 34, 38, 40, 41,
444 44, 46
447 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
448 static const yysigned_char yyrhs[] =
450 15, 0, -1, 16, -1, 17, -1, 17, 9, -1,
451 -1, 18, 17, -1, 19, -1, 20, -1, 8, -1,
452 11, -1, 5, -1, 6, -1, 7, -1, 10, -1,
453 3, 21, 7, -1, 4, 21, 7, -1, 13, -1,
454 -1, 22, 21, -1, 8, -1, 20, -1
457 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
458 static const unsigned char yyrline[] =
460 0, 95, 95, 102, 107, 113, 117, 123, 128, 134,
461 139, 144, 149, 154, 159, 165, 171, 177, 183, 187,
462 193, 198
464 #endif
466 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
467 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
468 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
469 static const char *const yytname[] =
471 "$end", "error", "$undefined", "cal_NCURLY", "cal_DCURLY", "\"$\"",
472 "\"{\"", "\"}\"", "cal_NAME", "\"\\\\\"", "cal_SYMBOL", "\"@\"",
473 "cal_ERROR", "cal_ATNAME", "$accept", "Start",
474 "GoalWithOptionalBackSlash", "Goal", "String", "OuterText", "Variable",
475 "MultipleIds", "ID", 0
477 #endif
479 # ifdef YYPRINT
480 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
481 token YYLEX-NUM. */
482 static const unsigned short int yytoknum[] =
484 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
485 265, 266, 267, 268
487 # endif
489 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
490 static const unsigned char yyr1[] =
492 0, 14, 15, 16, 16, 17, 17, 18, 18, 19,
493 19, 19, 19, 19, 19, 20, 20, 20, 21, 21,
494 22, 22
497 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
498 static const unsigned char yyr2[] =
500 0, 2, 1, 1, 2, 0, 2, 1, 1, 1,
501 1, 1, 1, 1, 1, 3, 3, 1, 0, 2,
502 1, 1
505 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
506 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
507 means the default is an error. */
508 static const unsigned char yydefact[] =
510 5, 18, 18, 11, 12, 13, 9, 14, 10, 17,
511 0, 2, 3, 5, 7, 8, 20, 21, 0, 18,
512 0, 1, 4, 6, 15, 19, 16
515 /* YYDEFGOTO[NTERM-NUM]. */
516 static const yysigned_char yydefgoto[] =
518 -1, 10, 11, 12, 13, 14, 17, 18, 19
521 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
522 STATE-NUM. */
523 #define YYPACT_NINF -3
524 static const yysigned_char yypact[] =
526 -1, 12, 12, -3, -3, -3, -3, -3, -3, -3,
527 8, -3, 2, -1, -3, -3, -3, -3, 6, 12,
528 11, -3, -3, -3, -3, -3, -3
531 /* YYPGOTO[NTERM-NUM]. */
532 static const yysigned_char yypgoto[] =
534 -3, -3, -3, 9, -3, -3, 1, -2, -3
537 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
538 positive, shift that token. If negative, reduce the rule which
539 number is the opposite. If zero, do what YYDEFACT says.
540 If YYTABLE_NINF, syntax error. */
541 #define YYTABLE_NINF -1
542 static const unsigned char yytable[] =
544 20, 15, 1, 2, 3, 4, 5, 6, 21, 7,
545 8, 22, 9, 24, 15, 1, 2, 25, 26, 0,
546 16, 0, 23, 0, 0, 9
549 static const yysigned_char yycheck[] =
551 2, 0, 3, 4, 5, 6, 7, 8, 0, 10,
552 11, 9, 13, 7, 13, 3, 4, 19, 7, -1,
553 8, -1, 13, -1, -1, 13
556 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
557 symbol of state STATE-NUM. */
558 static const unsigned char yystos[] =
560 0, 3, 4, 5, 6, 7, 8, 10, 11, 13,
561 15, 16, 17, 18, 19, 20, 8, 20, 21, 22,
562 21, 0, 9, 17, 7, 21, 7
565 #define yyerrok (yyerrstatus = 0)
566 #define yyclearin (yychar = YYEMPTY)
567 #define YYEMPTY (-2)
568 #define YYEOF 0
570 #define YYACCEPT goto yyacceptlab
571 #define YYABORT goto yyabortlab
572 #define YYERROR goto yyerrorlab
575 /* Like YYERROR except do call yyerror. This remains here temporarily
576 to ease the transition to the new meaning of YYERROR, for GCC.
577 Once GCC version 2 has supplanted version 1, this can go. */
579 #define YYFAIL goto yyerrlab
581 #define YYRECOVERING() (!!yyerrstatus)
583 #define YYBACKUP(Token, Value) \
584 do \
585 if (yychar == YYEMPTY && yylen == 1) \
587 yychar = (Token); \
588 yylval = (Value); \
589 yytoken = YYTRANSLATE (yychar); \
590 YYPOPSTACK; \
591 goto yybackup; \
593 else \
595 yyerror (YY_("syntax error: cannot back up")); \
596 YYERROR; \
598 while (0)
601 #define YYTERROR 1
602 #define YYERRCODE 256
605 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
606 If N is 0, then set CURRENT to the empty location which ends
607 the previous symbol: RHS[0] (always defined). */
609 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
610 #ifndef YYLLOC_DEFAULT
611 # define YYLLOC_DEFAULT(Current, Rhs, N) \
612 do \
613 if (N) \
615 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
616 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
617 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
618 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
620 else \
622 (Current).first_line = (Current).last_line = \
623 YYRHSLOC (Rhs, 0).last_line; \
624 (Current).first_column = (Current).last_column = \
625 YYRHSLOC (Rhs, 0).last_column; \
627 while (0)
628 #endif
631 /* YY_LOCATION_PRINT -- Print the location on the stream.
632 This macro was not mandated originally: define only if we know
633 we won't break user code: when these are the locations we know. */
635 #ifndef YY_LOCATION_PRINT
636 # if YYLTYPE_IS_TRIVIAL
637 # define YY_LOCATION_PRINT(File, Loc) \
638 fprintf (File, "%d.%d-%d.%d", \
639 (Loc).first_line, (Loc).first_column, \
640 (Loc).last_line, (Loc).last_column)
641 # else
642 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
643 # endif
644 #endif
647 /* YYLEX -- calling `yylex' with the right arguments. */
649 #ifdef YYLEX_PARAM
650 # define YYLEX yylex (&yylval, YYLEX_PARAM)
651 #else
652 # define YYLEX yylex (&yylval)
653 #endif
655 /* Enable debugging if requested. */
656 #if YYDEBUG
658 # ifndef YYFPRINTF
659 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
660 # define YYFPRINTF fprintf
661 # endif
663 # define YYDPRINTF(Args) \
664 do { \
665 if (yydebug) \
666 YYFPRINTF Args; \
667 } while (0)
669 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
670 do { \
671 if (yydebug) \
673 YYFPRINTF (stderr, "%s ", Title); \
674 yysymprint (stderr, \
675 Type, Value); \
676 YYFPRINTF (stderr, "\n"); \
678 } while (0)
680 /*------------------------------------------------------------------.
681 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
682 | TOP (included). |
683 `------------------------------------------------------------------*/
685 #if defined (__STDC__) || defined (__cplusplus)
686 static void
687 yy_stack_print (short int *bottom, short int *top)
688 #else
689 static void
690 yy_stack_print (bottom, top)
691 short int *bottom;
692 short int *top;
693 #endif
695 YYFPRINTF (stderr, "Stack now");
696 for (/* Nothing. */; bottom <= top; ++bottom)
697 YYFPRINTF (stderr, " %d", *bottom);
698 YYFPRINTF (stderr, "\n");
701 # define YY_STACK_PRINT(Bottom, Top) \
702 do { \
703 if (yydebug) \
704 yy_stack_print ((Bottom), (Top)); \
705 } while (0)
708 /*------------------------------------------------.
709 | Report that the YYRULE is going to be reduced. |
710 `------------------------------------------------*/
712 #if defined (__STDC__) || defined (__cplusplus)
713 static void
714 yy_reduce_print (int yyrule)
715 #else
716 static void
717 yy_reduce_print (yyrule)
718 int yyrule;
719 #endif
721 int yyi;
722 unsigned long int yylno = yyrline[yyrule];
723 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
724 yyrule - 1, yylno);
725 /* Print the symbols being reduced, and their result. */
726 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
727 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
728 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
731 # define YY_REDUCE_PRINT(Rule) \
732 do { \
733 if (yydebug) \
734 yy_reduce_print (Rule); \
735 } while (0)
737 /* Nonzero means print parse trace. It is left uninitialized so that
738 multiple parsers can coexist. */
739 int yydebug;
740 #else /* !YYDEBUG */
741 # define YYDPRINTF(Args)
742 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
743 # define YY_STACK_PRINT(Bottom, Top)
744 # define YY_REDUCE_PRINT(Rule)
745 #endif /* !YYDEBUG */
748 /* YYINITDEPTH -- initial size of the parser's stacks. */
749 #ifndef YYINITDEPTH
750 # define YYINITDEPTH 200
751 #endif
753 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
754 if the built-in stack extension method is used).
756 Do not make this value too large; the results are undefined if
757 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
758 evaluated with infinite-precision integer arithmetic. */
760 #ifndef YYMAXDEPTH
761 # define YYMAXDEPTH 10000
762 #endif
766 #if YYERROR_VERBOSE
768 # ifndef yystrlen
769 # if defined (__GLIBC__) && defined (_STRING_H)
770 # define yystrlen strlen
771 # else
772 /* Return the length of YYSTR. */
773 static YYSIZE_T
774 # if defined (__STDC__) || defined (__cplusplus)
775 yystrlen (const char *yystr)
776 # else
777 yystrlen (yystr)
778 const char *yystr;
779 # endif
781 const char *yys = yystr;
783 while (*yys++ != '\0')
784 continue;
786 return yys - yystr - 1;
788 # endif
789 # endif
791 # ifndef yystpcpy
792 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
793 # define yystpcpy stpcpy
794 # else
795 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
796 YYDEST. */
797 static char *
798 # if defined (__STDC__) || defined (__cplusplus)
799 yystpcpy (char *yydest, const char *yysrc)
800 # else
801 yystpcpy (yydest, yysrc)
802 char *yydest;
803 const char *yysrc;
804 # endif
806 char *yyd = yydest;
807 const char *yys = yysrc;
809 while ((*yyd++ = *yys++) != '\0')
810 continue;
812 return yyd - 1;
814 # endif
815 # endif
817 # ifndef yytnamerr
818 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
819 quotes and backslashes, so that it's suitable for yyerror. The
820 heuristic is that double-quoting is unnecessary unless the string
821 contains an apostrophe, a comma, or backslash (other than
822 backslash-backslash). YYSTR is taken from yytname. If YYRES is
823 null, do not copy; instead, return the length of what the result
824 would have been. */
825 static YYSIZE_T
826 yytnamerr (char *yyres, const char *yystr)
828 if (*yystr == '"')
830 size_t yyn = 0;
831 char const *yyp = yystr;
833 for (;;)
834 switch (*++yyp)
836 case '\'':
837 case ',':
838 goto do_not_strip_quotes;
840 case '\\':
841 if (*++yyp != '\\')
842 goto do_not_strip_quotes;
843 /* Fall through. */
844 default:
845 if (yyres)
846 yyres[yyn] = *yyp;
847 yyn++;
848 break;
850 case '"':
851 if (yyres)
852 yyres[yyn] = '\0';
853 return yyn;
855 do_not_strip_quotes: ;
858 if (! yyres)
859 return yystrlen (yystr);
861 return yystpcpy (yyres, yystr) - yyres;
863 # endif
865 #endif /* YYERROR_VERBOSE */
869 #if YYDEBUG
870 /*--------------------------------.
871 | Print this symbol on YYOUTPUT. |
872 `--------------------------------*/
874 #if defined (__STDC__) || defined (__cplusplus)
875 static void
876 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
877 #else
878 static void
879 yysymprint (yyoutput, yytype, yyvaluep)
880 FILE *yyoutput;
881 int yytype;
882 YYSTYPE *yyvaluep;
883 #endif
885 /* Pacify ``unused variable'' warnings. */
886 (void) yyvaluep;
888 if (yytype < YYNTOKENS)
889 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
890 else
891 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
894 # ifdef YYPRINT
895 if (yytype < YYNTOKENS)
896 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
897 # endif
898 switch (yytype)
900 default:
901 break;
903 YYFPRINTF (yyoutput, ")");
906 #endif /* ! YYDEBUG */
907 /*-----------------------------------------------.
908 | Release the memory associated to this symbol. |
909 `-----------------------------------------------*/
911 #if defined (__STDC__) || defined (__cplusplus)
912 static void
913 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
914 #else
915 static void
916 yydestruct (yymsg, yytype, yyvaluep)
917 const char *yymsg;
918 int yytype;
919 YYSTYPE *yyvaluep;
920 #endif
922 /* Pacify ``unused variable'' warnings. */
923 (void) yyvaluep;
925 if (!yymsg)
926 yymsg = "Deleting";
927 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
929 switch (yytype)
932 default:
933 break;
938 /* Prevent warnings from -Wmissing-prototypes. */
940 #ifdef YYPARSE_PARAM
941 # if defined (__STDC__) || defined (__cplusplus)
942 int yyparse (void *YYPARSE_PARAM);
943 # else
944 int yyparse ();
945 # endif
946 #else /* ! YYPARSE_PARAM */
947 #if defined (__STDC__) || defined (__cplusplus)
948 int yyparse (void);
949 #else
950 int yyparse ();
951 #endif
952 #endif /* ! YYPARSE_PARAM */
959 /*----------.
960 | yyparse. |
961 `----------*/
963 #ifdef YYPARSE_PARAM
964 # if defined (__STDC__) || defined (__cplusplus)
965 int yyparse (void *YYPARSE_PARAM)
966 # else
967 int yyparse (YYPARSE_PARAM)
968 void *YYPARSE_PARAM;
969 # endif
970 #else /* ! YYPARSE_PARAM */
971 #if defined (__STDC__) || defined (__cplusplus)
973 yyparse (void)
974 #else
976 yyparse ()
978 #endif
979 #endif
981 /* The look-ahead symbol. */
982 int yychar;
984 /* The semantic value of the look-ahead symbol. */
985 YYSTYPE yylval;
987 /* Number of syntax errors so far. */
988 int yynerrs;
990 int yystate;
991 int yyn;
992 int yyresult;
993 /* Number of tokens to shift before error messages enabled. */
994 int yyerrstatus;
995 /* Look-ahead token as an internal (translated) token number. */
996 int yytoken = 0;
998 /* Three stacks and their tools:
999 `yyss': related to states,
1000 `yyvs': related to semantic values,
1001 `yyls': related to locations.
1003 Refer to the stacks thru separate pointers, to allow yyoverflow
1004 to reallocate them elsewhere. */
1006 /* The state stack. */
1007 short int yyssa[YYINITDEPTH];
1008 short int *yyss = yyssa;
1009 short int *yyssp;
1011 /* The semantic value stack. */
1012 YYSTYPE yyvsa[YYINITDEPTH];
1013 YYSTYPE *yyvs = yyvsa;
1014 YYSTYPE *yyvsp;
1018 #define YYPOPSTACK (yyvsp--, yyssp--)
1020 YYSIZE_T yystacksize = YYINITDEPTH;
1022 /* The variables used to return semantic value and location from the
1023 action routines. */
1024 YYSTYPE yyval;
1027 /* When reducing, the number of symbols on the RHS of the reduced
1028 rule. */
1029 int yylen;
1031 YYDPRINTF ((stderr, "Starting parse\n"));
1033 yystate = 0;
1034 yyerrstatus = 0;
1035 yynerrs = 0;
1036 yychar = YYEMPTY; /* Cause a token to be read. */
1038 /* Initialize stack pointers.
1039 Waste one element of value and location stack
1040 so that they stay on the same level as the state stack.
1041 The wasted elements are never initialized. */
1043 yyssp = yyss;
1044 yyvsp = yyvs;
1046 goto yysetstate;
1048 /*------------------------------------------------------------.
1049 | yynewstate -- Push a new state, which is found in yystate. |
1050 `------------------------------------------------------------*/
1051 yynewstate:
1052 /* In all cases, when you get here, the value and location stacks
1053 have just been pushed. so pushing a state here evens the stacks.
1055 yyssp++;
1057 yysetstate:
1058 *yyssp = yystate;
1060 if (yyss + yystacksize - 1 <= yyssp)
1062 /* Get the current used size of the three stacks, in elements. */
1063 YYSIZE_T yysize = yyssp - yyss + 1;
1065 #ifdef yyoverflow
1067 /* Give user a chance to reallocate the stack. Use copies of
1068 these so that the &'s don't force the real ones into
1069 memory. */
1070 YYSTYPE *yyvs1 = yyvs;
1071 short int *yyss1 = yyss;
1074 /* Each stack pointer address is followed by the size of the
1075 data in use in that stack, in bytes. This used to be a
1076 conditional around just the two extra args, but that might
1077 be undefined if yyoverflow is a macro. */
1078 yyoverflow (YY_("memory exhausted"),
1079 &yyss1, yysize * sizeof (*yyssp),
1080 &yyvs1, yysize * sizeof (*yyvsp),
1082 &yystacksize);
1084 yyss = yyss1;
1085 yyvs = yyvs1;
1087 #else /* no yyoverflow */
1088 # ifndef YYSTACK_RELOCATE
1089 goto yyexhaustedlab;
1090 # else
1091 /* Extend the stack our own way. */
1092 if (YYMAXDEPTH <= yystacksize)
1093 goto yyexhaustedlab;
1094 yystacksize *= 2;
1095 if (YYMAXDEPTH < yystacksize)
1096 yystacksize = YYMAXDEPTH;
1099 short int *yyss1 = yyss;
1100 union yyalloc *yyptr =
1101 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1102 if (! yyptr)
1103 goto yyexhaustedlab;
1104 YYSTACK_RELOCATE (yyss);
1105 YYSTACK_RELOCATE (yyvs);
1107 # undef YYSTACK_RELOCATE
1108 if (yyss1 != yyssa)
1109 YYSTACK_FREE (yyss1);
1111 # endif
1112 #endif /* no yyoverflow */
1114 yyssp = yyss + yysize - 1;
1115 yyvsp = yyvs + yysize - 1;
1118 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1119 (unsigned long int) yystacksize));
1121 if (yyss + yystacksize - 1 <= yyssp)
1122 YYABORT;
1125 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1127 goto yybackup;
1129 /*-----------.
1130 | yybackup. |
1131 `-----------*/
1132 yybackup:
1134 /* Do appropriate processing given the current state. */
1135 /* Read a look-ahead token if we need one and don't already have one. */
1136 /* yyresume: */
1138 /* First try to decide what to do without reference to look-ahead token. */
1140 yyn = yypact[yystate];
1141 if (yyn == YYPACT_NINF)
1142 goto yydefault;
1144 /* Not known => get a look-ahead token if don't already have one. */
1146 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1147 if (yychar == YYEMPTY)
1149 YYDPRINTF ((stderr, "Reading a token: "));
1150 yychar = YYLEX;
1153 if (yychar <= YYEOF)
1155 yychar = yytoken = YYEOF;
1156 YYDPRINTF ((stderr, "Now at end of input.\n"));
1158 else
1160 yytoken = YYTRANSLATE (yychar);
1161 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1164 /* If the proper action on seeing token YYTOKEN is to reduce or to
1165 detect an error, take that action. */
1166 yyn += yytoken;
1167 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1168 goto yydefault;
1169 yyn = yytable[yyn];
1170 if (yyn <= 0)
1172 if (yyn == 0 || yyn == YYTABLE_NINF)
1173 goto yyerrlab;
1174 yyn = -yyn;
1175 goto yyreduce;
1178 if (yyn == YYFINAL)
1179 YYACCEPT;
1181 /* Shift the look-ahead token. */
1182 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1184 /* Discard the token being shifted unless it is eof. */
1185 if (yychar != YYEOF)
1186 yychar = YYEMPTY;
1188 *++yyvsp = yylval;
1191 /* Count tokens shifted since error; after three, turn off error
1192 status. */
1193 if (yyerrstatus)
1194 yyerrstatus--;
1196 yystate = yyn;
1197 goto yynewstate;
1200 /*-----------------------------------------------------------.
1201 | yydefault -- do the default action for the current state. |
1202 `-----------------------------------------------------------*/
1203 yydefault:
1204 yyn = yydefact[yystate];
1205 if (yyn == 0)
1206 goto yyerrlab;
1207 goto yyreduce;
1210 /*-----------------------------.
1211 | yyreduce -- Do a reduction. |
1212 `-----------------------------*/
1213 yyreduce:
1214 /* yyn is the number of a rule to reduce with. */
1215 yylen = yyr2[yyn];
1217 /* If YYLEN is nonzero, implement the default value of the action:
1218 `$$ = $1'.
1220 Otherwise, the following line sets YYVAL to garbage.
1221 This behavior is undocumented and Bison
1222 users should not rely upon it. Assigning to YYVAL
1223 unconditionally makes the parser a bit smaller, and it avoids a
1224 GCC warning that YYVAL may be used uninitialized. */
1225 yyval = yyvsp[1-yylen];
1228 YY_REDUCE_PRINT (yyn);
1229 switch (yyn)
1231 case 2:
1232 #line 96 "cmCommandArgumentParser.y"
1234 (yyval.str) = 0;
1235 yyGetParser->SetResult((yyvsp[0].str));
1237 break;
1239 case 3:
1240 #line 103 "cmCommandArgumentParser.y"
1242 (yyval.str) = (yyvsp[0].str);
1244 break;
1246 case 4:
1247 #line 108 "cmCommandArgumentParser.y"
1249 (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str));
1251 break;
1253 case 5:
1254 #line 113 "cmCommandArgumentParser.y"
1256 (yyval.str) = 0;
1258 break;
1260 case 6:
1261 #line 118 "cmCommandArgumentParser.y"
1263 (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str));
1265 break;
1267 case 7:
1268 #line 124 "cmCommandArgumentParser.y"
1270 (yyval.str) = (yyvsp[0].str);
1272 break;
1274 case 8:
1275 #line 129 "cmCommandArgumentParser.y"
1277 (yyval.str) = (yyvsp[0].str);
1279 break;
1281 case 9:
1282 #line 135 "cmCommandArgumentParser.y"
1284 (yyval.str) = (yyvsp[0].str);
1286 break;
1288 case 10:
1289 #line 140 "cmCommandArgumentParser.y"
1291 (yyval.str) = (yyvsp[0].str);
1293 break;
1295 case 11:
1296 #line 145 "cmCommandArgumentParser.y"
1298 (yyval.str) = (yyvsp[0].str);
1300 break;
1302 case 12:
1303 #line 150 "cmCommandArgumentParser.y"
1305 (yyval.str) = (yyvsp[0].str);
1307 break;
1309 case 13:
1310 #line 155 "cmCommandArgumentParser.y"
1312 (yyval.str) = (yyvsp[0].str);
1314 break;
1316 case 14:
1317 #line 160 "cmCommandArgumentParser.y"
1319 (yyval.str) = (yyvsp[0].str);
1321 break;
1323 case 15:
1324 #line 166 "cmCommandArgumentParser.y"
1326 (yyval.str) =
1327 yyGetParser->ExpandSpecialVariable((yyvsp[-2].str),(yyvsp[-1].str));
1328 //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "]
1329 //[" << $<str>3 << "]" << std::endl;
1331 break;
1333 case 16:
1334 #line 172 "cmCommandArgumentParser.y"
1336 (yyval.str) = yyGetParser->ExpandVariable((yyvsp[-1].str));
1337 //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "]
1338 //[" << $<str>3 << "]" << std::endl;
1340 break;
1342 case 17:
1343 #line 178 "cmCommandArgumentParser.y"
1345 (yyval.str) = yyGetParser->ExpandVariableForAt((yyvsp[0].str));
1347 break;
1349 case 18:
1350 #line 183 "cmCommandArgumentParser.y"
1352 (yyval.str) = 0;
1354 break;
1356 case 19:
1357 #line 188 "cmCommandArgumentParser.y"
1359 (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str));
1361 break;
1363 case 20:
1364 #line 194 "cmCommandArgumentParser.y"
1366 (yyval.str) = (yyvsp[0].str);
1368 break;
1370 case 21:
1371 #line 199 "cmCommandArgumentParser.y"
1373 (yyval.str) = (yyvsp[0].str);
1375 break;
1378 default: break;
1381 /* Line 1126 of yacc.c. */
1382 #line 1338 "cmCommandArgumentParser.cxx"
1384 yyvsp -= yylen;
1385 yyssp -= yylen;
1388 YY_STACK_PRINT (yyss, yyssp);
1390 *++yyvsp = yyval;
1393 /* Now `shift' the result of the reduction. Determine what state
1394 that goes to, based on the state we popped back to and the rule
1395 number reduced by. */
1397 yyn = yyr1[yyn];
1399 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1400 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1401 yystate = yytable[yystate];
1402 else
1403 yystate = yydefgoto[yyn - YYNTOKENS];
1405 goto yynewstate;
1408 /*------------------------------------.
1409 | yyerrlab -- here on detecting error |
1410 `------------------------------------*/
1411 yyerrlab:
1412 /* If not already recovering from an error, report this error. */
1413 if (!yyerrstatus)
1415 ++yynerrs;
1416 #if YYERROR_VERBOSE
1417 yyn = yypact[yystate];
1419 if (YYPACT_NINF < yyn && yyn < YYLAST)
1421 int yytype = YYTRANSLATE (yychar);
1422 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1423 YYSIZE_T yysize = yysize0;
1424 YYSIZE_T yysize1;
1425 int yysize_overflow = 0;
1426 char *yymsg = 0;
1427 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
1428 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1429 int yyx;
1431 #if 0
1432 /* This is so xgettext sees the translatable formats that are
1433 constructed on the fly. */
1434 YY_("syntax error, unexpected %s");
1435 YY_("syntax error, unexpected %s, expecting %s");
1436 YY_("syntax error, unexpected %s, expecting %s or %s");
1437 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1438 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1439 #endif
1440 char *yyfmt;
1441 char const *yyf;
1442 static char const yyunexpected[] = "syntax error, unexpected %s";
1443 static char const yyexpecting[] = ", expecting %s";
1444 static char const yyor[] = " or %s";
1445 char yyformat[sizeof yyunexpected
1446 + sizeof yyexpecting - 1
1447 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1448 * (sizeof yyor - 1))];
1449 char const *yyprefix = yyexpecting;
1451 /* Start YYX at -YYN if negative to avoid negative indexes in
1452 YYCHECK. */
1453 int yyxbegin = yyn < 0 ? -yyn : 0;
1455 /* Stay within bounds of both yycheck and yytname. */
1456 int yychecklim = YYLAST - yyn;
1457 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1458 int yycount = 1;
1460 yyarg[0] = yytname[yytype];
1461 yyfmt = yystpcpy (yyformat, yyunexpected);
1463 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1464 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1466 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1468 yycount = 1;
1469 yysize = yysize0;
1470 yyformat[sizeof yyunexpected - 1] = '\0';
1471 break;
1473 yyarg[yycount++] = yytname[yyx];
1474 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1475 yysize_overflow |= yysize1 < yysize;
1476 yysize = yysize1;
1477 yyfmt = yystpcpy (yyfmt, yyprefix);
1478 yyprefix = yyor;
1481 yyf = YY_(yyformat);
1482 yysize1 = yysize + yystrlen (yyf);
1483 yysize_overflow |= yysize1 < yysize;
1484 yysize = yysize1;
1486 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
1487 yymsg = (char *) YYSTACK_ALLOC (yysize);
1488 if (yymsg)
1490 /* Avoid sprintf, as that infringes on the user's name space.
1491 Don't have undefined behavior even if the translation
1492 produced a string with the wrong number of "%s"s. */
1493 char *yyp = yymsg;
1494 int yyi = 0;
1495 while ((*yyp = *yyf))
1497 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1499 yyp += yytnamerr (yyp, yyarg[yyi++]);
1500 yyf += 2;
1502 else
1504 yyp++;
1505 yyf++;
1508 yyerror (yymsg);
1509 YYSTACK_FREE (yymsg);
1511 else
1513 yyerror (YY_("syntax error"));
1514 goto yyexhaustedlab;
1517 else
1518 #endif /* YYERROR_VERBOSE */
1519 yyerror (YY_("syntax error"));
1524 if (yyerrstatus == 3)
1526 /* If just tried and failed to reuse look-ahead token after an
1527 error, discard it. */
1529 if (yychar <= YYEOF)
1531 /* Return failure if at end of input. */
1532 if (yychar == YYEOF)
1533 YYABORT;
1535 else
1537 yydestruct ("Error: discarding", yytoken, &yylval);
1538 yychar = YYEMPTY;
1542 /* Else will try to reuse look-ahead token after shifting the error
1543 token. */
1544 goto yyerrlab1;
1547 /*---------------------------------------------------.
1548 | yyerrorlab -- error raised explicitly by YYERROR. |
1549 `---------------------------------------------------*/
1550 yyerrorlab:
1552 /* Pacify compilers like GCC when the user code never invokes
1553 YYERROR and the label yyerrorlab therefore never appears in user
1554 code. */
1555 if (0)
1556 goto yyerrorlab;
1558 yyvsp -= yylen;
1559 yyssp -= yylen;
1560 yystate = *yyssp;
1561 goto yyerrlab1;
1564 /*-------------------------------------------------------------.
1565 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1566 `-------------------------------------------------------------*/
1567 yyerrlab1:
1568 yyerrstatus = 3; /* Each real token shifted decrements this. */
1570 for (;;)
1572 yyn = yypact[yystate];
1573 if (yyn != YYPACT_NINF)
1575 yyn += YYTERROR;
1576 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1578 yyn = yytable[yyn];
1579 if (0 < yyn)
1580 break;
1584 /* Pop the current state because it cannot handle the error token. */
1585 if (yyssp == yyss)
1586 YYABORT;
1589 yydestruct ("Error: popping", yystos[yystate], yyvsp);
1590 YYPOPSTACK;
1591 yystate = *yyssp;
1592 YY_STACK_PRINT (yyss, yyssp);
1595 if (yyn == YYFINAL)
1596 YYACCEPT;
1598 *++yyvsp = yylval;
1601 /* Shift the error token. */
1602 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1604 yystate = yyn;
1605 goto yynewstate;
1608 /*-------------------------------------.
1609 | yyacceptlab -- YYACCEPT comes here. |
1610 `-------------------------------------*/
1611 yyacceptlab:
1612 yyresult = 0;
1613 goto yyreturn;
1615 /*-----------------------------------.
1616 | yyabortlab -- YYABORT comes here. |
1617 `-----------------------------------*/
1618 yyabortlab:
1619 yyresult = 1;
1620 goto yyreturn;
1622 #ifndef yyoverflow
1623 /*-------------------------------------------------.
1624 | yyexhaustedlab -- memory exhaustion comes here. |
1625 `-------------------------------------------------*/
1626 yyexhaustedlab:
1627 yyerror (YY_("memory exhausted"));
1628 yyresult = 2;
1629 /* Fall through. */
1630 #endif
1632 yyreturn:
1633 if (yychar != YYEOF && yychar != YYEMPTY)
1634 yydestruct ("Cleanup: discarding lookahead",
1635 yytoken, &yylval);
1636 while (yyssp != yyss)
1638 yydestruct ("Cleanup: popping",
1639 yystos[*yyssp], yyvsp);
1640 YYPOPSTACK;
1642 #ifndef yyoverflow
1643 if (yyss != yyssa)
1644 YYSTACK_FREE (yyss);
1645 #endif
1646 return yyresult;
1650 #line 204 "cmCommandArgumentParser.y"
1652 /* End of grammar */
1654 /*--------------------------------------------------------------------------*/
1655 void cmCommandArgumentError(yyscan_t yyscanner, const char* message)
1657 yyGetParser->Error(message);