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