00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #define YYBISON 1
00048
00049
00050 #define YYBISON_VERSION "2.3"
00051
00052
00053 #define YYSKELETON_NAME "yacc.c"
00054
00055
00056 #define YYPURE 0
00057
00058
00059 #define YYLSP_NEEDED 0
00060
00061
00062
00063
00064 #ifndef YYTOKENTYPE
00065 # define YYTOKENTYPE
00066
00067
00068 enum yytokentype {
00069 IF = 258,
00070 THEN = 259,
00071 ELSE = 260,
00072 ELIF = 261,
00073 FI = 262,
00074 CASE = 263,
00075 IN = 264,
00076 ESAC = 265,
00077 FOR = 266,
00078 WHILE = 267,
00079 UNTIL = 268,
00080 DO = 269,
00081 DONE = 270,
00082 SEMI_SEMI = 271,
00083 AND_AND = 272,
00084 OR_OR = 273,
00085 LESS_LESS = 274,
00086 GREATER_GREATER = 275,
00087 LESS_AND = 276,
00088 GREATER_AND = 277,
00089 AND_GREATER = 278,
00090 LESS_GREATER = 279,
00091 GREATER_BAR = 280,
00092 LESS_LESS_MINUS = 281,
00093 WORD = 282,
00094 ASSIGNMENT_WORD = 283,
00095 SELECT = 284,
00096 FUNCTION = 285,
00097 BANG = 286,
00098 vsh_EOF = 287
00099 };
00100 #endif
00101
00102 #define IF 258
00103 #define THEN 259
00104 #define ELSE 260
00105 #define ELIF 261
00106 #define FI 262
00107 #define CASE 263
00108 #define IN 264
00109 #define ESAC 265
00110 #define FOR 266
00111 #define WHILE 267
00112 #define UNTIL 268
00113 #define DO 269
00114 #define DONE 270
00115 #define SEMI_SEMI 271
00116 #define AND_AND 272
00117 #define OR_OR 273
00118 #define LESS_LESS 274
00119 #define GREATER_GREATER 275
00120 #define LESS_AND 276
00121 #define GREATER_AND 277
00122 #define AND_GREATER 278
00123 #define LESS_GREATER 279
00124 #define GREATER_BAR 280
00125 #define LESS_LESS_MINUS 281
00126 #define WORD 282
00127 #define ASSIGNMENT_WORD 283
00128 #define SELECT 284
00129 #define FUNCTION 285
00130 #define BANG 286
00131 #define vsh_EOF 287
00132
00133
00134
00135
00136
00137
00138
00139
00140 #include "vsh_p.h"
00141
00142 VEMBED(rcsid="$Id: vyacc.y,v 1.7 2008/03/12 05:13:59 fetk Exp $")
00143
00144 VPUBLIC void yyerror(const char *errmsg)
00145 {
00146 fprintf(stderr, "Vsh: %s at '%s'\n", errmsg, yytext);
00147 if (!Vsh_isInteractive(Vsh_thee)) {
00148 exit(1);
00149 }
00150 }
00151
00152 VPUBLIC void report_error(const char *format, ...)
00153 {
00154 fprintf(stderr,"report_error: ERROR:\n");
00155 }
00156
00157 VPUBLIC void programming_error(const char *format, ...)
00158 {
00159 fprintf(stderr,"programming_error: ERROR:\n");
00160 }
00161
00162 VPUBLIC int yywrap(void)
00163 {
00164 if (Vsh_thee->cinUnit == stdin) {
00165 Vnm_print(1,"%s",Vsh_thee->PR_EXIT);
00166 Vnm_print(1,"%s",VNEWLINE_STRING);
00167 }
00168 cmdKey = 2;
00169 return 1;
00170 }
00171
00172
00173
00174
00175
00176
00177 GENERIC_LIST *reverse_list (GENERIC_LIST *list)
00178 {
00179 register GENERIC_LIST *next, *prev = (GENERIC_LIST *)NULL;
00180
00181 while (list) {
00182 next = list->next;
00183 list->next = prev;
00184 prev = list;
00185 list = next;
00186 }
00187 return (prev);
00188 }
00189
00190 WORD_LIST* make_word_list(WORD_DESC *word, WORD_LIST *link)
00191 {
00192 WORD_LIST *temp;
00193
00194 temp = (WORD_LIST *)malloc (sizeof (WORD_LIST));
00195 temp->word = word;
00196 temp->next = link;
00197 return temp;
00198 }
00199
00200 COMMAND *make_bare_simple_command(void)
00201 {
00202 COMMAND *command;
00203 SIMPLE_COM *temp = (SIMPLE_COM *)malloc (sizeof (SIMPLE_COM));
00204
00205 temp->flags = 0;
00206
00207 temp->line = 0;
00208 temp->words = (WORD_LIST *)NULL;
00209 temp->redirects = (REDIRECT *)NULL;
00210 command = (COMMAND *)malloc (sizeof (COMMAND));
00211 command->type = cm_simple;
00212 command->redirects = (REDIRECT *)NULL;
00213 command->flags = 0;
00214 command->value.Simple = temp;
00215 return command;
00216 }
00217
00218
00219
00220
00221
00222
00223 REDIRECT *make_redirection (int source,
00224 enum r_instruction instruction, REDIRECTEE dest_and_filename)
00225 {
00226 REDIRECT *temp = (REDIRECT *)malloc (sizeof (REDIRECT));
00227
00228
00229 temp->redirector = source;
00230 temp->redirectee = dest_and_filename;
00231 temp->instruction = instruction;
00232 temp->flags = 0;
00233 temp->next = (REDIRECT *)NULL;
00234
00235 switch (instruction) {
00236
00237 case r_output_direction:
00238 case r_output_force:
00239 temp->flags = O_TRUNC | O_WRONLY | O_CREAT;
00240 break;
00241
00242 case r_input_direction:
00243 case r_inputa_direction:
00244 temp->flags = O_RDONLY;
00245 break;
00246
00247 case r_appending_to:
00248 temp->flags = O_APPEND | O_WRONLY | O_CREAT;
00249 break;
00250
00251 case r_deblank_reading_until:
00252 case r_reading_until:
00253 break;
00254
00255 case r_duplicating_input:
00256 case r_duplicating_output:
00257 case r_close_this:
00258 case r_duplicating_input_word:
00259 case r_duplicating_output_word:
00260 break;
00261
00262 case r_err_and_out:
00263 temp->flags = O_TRUNC | O_WRONLY | O_CREAT;
00264 break;
00265
00266 case r_input_output:
00267 temp->flags = O_RDWR | O_CREAT;
00268 break;
00269
00270 default:
00271 fprintf(stderr,"We seem to have a problem...\n");
00272 abort ();
00273 break;
00274 }
00275 return (temp);
00276 }
00277
00278
00279
00280
00281
00282 COMMAND *make_simple_command (ELEMENT element, COMMAND *command) {
00283
00284
00285
00286 if (!command) command = make_bare_simple_command ();
00287
00288 if (element.word) {
00289 WORD_LIST *tw = (WORD_LIST *)malloc (sizeof (WORD_LIST));
00290 tw->word = element.word;
00291 tw->next = command->value.Simple->words;
00292 command->value.Simple->words = tw;
00293 } else {
00294 REDIRECT *r = element.redirect;
00295
00296
00297
00298 while (r->next) r = r->next;
00299 r->next = command->value.Simple->redirects;
00300 command->value.Simple->redirects = element.redirect;
00301 }
00302 return (command);
00303 }
00304
00305 COMMAND* make_command (enum command_type type, SIMPLE_COM *pointer)
00306 {
00307 COMMAND *temp;
00308
00309 temp = (COMMAND *)malloc (sizeof (COMMAND));
00310 temp->type = type;
00311 temp->value.Simple = pointer;
00312 temp->value.Simple->flags = 0;
00313 temp->flags = 0;
00314 temp->redirects = (REDIRECT *)NULL;
00315 return temp;
00316 }
00317
00318 void dispose_command (COMMAND *command);
00319 void dispose_word (WORD_DESC *word);
00320 void dispose_words (WORD_LIST *list);
00321 void dispose_word_array (char **array);
00322 void dispose_redirects (REDIRECT *list);
00323
00324
00325 void dispose_command (COMMAND *command)
00326 {
00327 if (!command) return;
00328
00329 if (command->redirects)
00330 dispose_redirects (command->redirects);
00331
00332 switch (command->type)
00333 {
00334 case cm_for:
00335 {
00336 register FOR_COM *c = command->value.For;
00337 dispose_word (c->name);
00338 dispose_words (c->map_list);
00339 dispose_command (c->action);
00340 free (c);
00341 break;
00342 }
00343
00344 case cm_group:
00345 {
00346 dispose_command (command->value.Group->command);
00347 free (command->value.Group);
00348 break;
00349 }
00350
00351 case cm_case:
00352 {
00353 register CASE_COM *c = command->value.Case;
00354 PATTERN_LIST *t, *p = c->clauses;
00355
00356 dispose_word (c->word);
00357
00358 while (p)
00359 {
00360 dispose_words (p->patterns);
00361 dispose_command (p->action);
00362 t = p;
00363 p = p->next;
00364 free (t);
00365 }
00366 free (c);
00367 break;
00368 }
00369
00370 case cm_until:
00371 case cm_while:
00372 {
00373 register WHILE_COM *c = command->value.While;
00374
00375 dispose_command (c->test);
00376 dispose_command (c->action);
00377 free (c);
00378 break;
00379 }
00380
00381 case cm_if:
00382 {
00383 register IF_COM *c = command->value.If;
00384 dispose_command (c->test);
00385 dispose_command (c->true_case);
00386 dispose_command (c->false_case);
00387 free (c);
00388 break;
00389 }
00390
00391 case cm_simple:
00392 {
00393 register SIMPLE_COM *c = command->value.Simple;
00394 dispose_words (c->words);
00395 dispose_redirects (c->redirects);
00396 free (c);
00397 break;
00398 }
00399
00400 case cm_connection:
00401 {
00402 register CONNECTION *c = command->value.Connection;
00403 dispose_command (c->first);
00404 dispose_command (c->second);
00405 free (c);
00406 break;
00407 }
00408
00409 case cm_function_def:
00410 {
00411 register FUNCTION_DEF *c = command->value.Function_def;
00412 dispose_word (c->name);
00413 dispose_command (c->command);
00414 free (c);
00415 break;
00416 }
00417
00418 default:
00419 report_error ("Attempt free unknown command type `%d'.\n", command->type);
00420 break;
00421 }
00422 free (command);
00423 }
00424
00425
00426 void dispose_word (WORD_DESC *word)
00427 {
00428 if (word->word)
00429 free (word->word);
00430 free (word);
00431 }
00432
00433
00434 void dispose_words (WORD_LIST *list)
00435 {
00436 WORD_LIST *t;
00437 while (list)
00438 {
00439 t = list;
00440 list = list->next;
00441 dispose_word (t->word);
00442 free (t);
00443 }
00444 }
00445
00446
00447 void dispose_word_array (char **array)
00448 {
00449 register int count;
00450
00451 for (count = 0; array[count]; count++)
00452 free (array[count]);
00453
00454 free (array);
00455 }
00456
00457
00458 void dispose_redirects (REDIRECT *list)
00459 {
00460 register REDIRECT *t;
00461
00462 while (list)
00463 {
00464 t = list;
00465 list = list->next;
00466 switch (t->instruction)
00467 {
00468 case r_reading_until:
00469 case r_deblank_reading_until:
00470 free (t->here_doc_eof);
00471
00472 case r_output_direction:
00473 case r_input_direction:
00474 case r_inputa_direction:
00475 case r_appending_to:
00476 case r_err_and_out:
00477 case r_input_output:
00478 case r_output_force:
00479 case r_duplicating_input_word:
00480 case r_duplicating_output_word:
00481 dispose_word (t->redirectee.filename);
00482 break;
00483 }
00484 free (t);
00485 }
00486 }
00487
00488
00489
00490
00491 COMMAND *clean_simple_command (COMMAND *command)
00492 {
00493 if (command->type != cm_simple)
00494 {
00495 programming_error
00496 ("clean_simple_command () got a command with type %d.", command->type);
00497 }
00498 else
00499 {
00500 command->value.Simple->words =
00501 REVERSE_LIST (command->value.Simple->words, WORD_LIST *);
00502 command->value.Simple->redirects =
00503 REVERSE_LIST (command->value.Simple->redirects, REDIRECT *);
00504 }
00505
00506 return (command);
00507 }
00508
00509 static REDIRECTEE redir;
00510
00511 static WORD_LIST *wordTmp;
00512 static WORD_DESC *wTmp;
00513 static char buf[VMAX_BUFSIZE];
00514
00515
00516
00517
00518 #ifndef YYDEBUG
00519 # define YYDEBUG 0
00520 #endif
00521
00522
00523 #ifdef YYERROR_VERBOSE
00524 # undef YYERROR_VERBOSE
00525 # define YYERROR_VERBOSE 1
00526 #else
00527 # define YYERROR_VERBOSE 0
00528 #endif
00529
00530
00531 #ifndef YYTOKEN_TABLE
00532 # define YYTOKEN_TABLE 0
00533 #endif
00534
00535 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
00536 typedef union YYSTYPE
00537
00538 {
00539 WORD_DESC *word;
00540
00541 WORD_LIST *word_list;
00542 COMMAND *command;
00543 REDIRECT *redirect;
00544 ELEMENT element;
00545 PATTERN_LIST *pattern;
00546 }
00547
00548
00549 YYSTYPE;
00550 # define yystype YYSTYPE
00551 # define YYSTYPE_IS_DECLARED 1
00552 # define YYSTYPE_IS_TRIVIAL 1
00553 #endif
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563 #ifdef short
00564 # undef short
00565 #endif
00566
00567 #ifdef YYTYPE_UINT8
00568 typedef YYTYPE_UINT8 yytype_uint8;
00569 #else
00570 typedef unsigned char yytype_uint8;
00571 #endif
00572
00573 #ifdef YYTYPE_INT8
00574 typedef YYTYPE_INT8 yytype_int8;
00575 #elif (defined __STDC__ || defined __C99__FUNC__ \
00576 || defined __cplusplus || defined _MSC_VER)
00577 typedef signed char yytype_int8;
00578 #else
00579 typedef short int yytype_int8;
00580 #endif
00581
00582 #ifdef YYTYPE_UINT16
00583 typedef YYTYPE_UINT16 yytype_uint16;
00584 #else
00585 typedef unsigned short int yytype_uint16;
00586 #endif
00587
00588 #ifdef YYTYPE_INT16
00589 typedef YYTYPE_INT16 yytype_int16;
00590 #else
00591 typedef short int yytype_int16;
00592 #endif
00593
00594 #ifndef YYSIZE_T
00595 # ifdef __SIZE_TYPE__
00596 # define YYSIZE_T __SIZE_TYPE__
00597 # elif defined size_t
00598 # define YYSIZE_T size_t
00599 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
00600 || defined __cplusplus || defined _MSC_VER)
00601 # include <stddef.h>
00602 # define YYSIZE_T size_t
00603 # else
00604 # define YYSIZE_T unsigned int
00605 # endif
00606 #endif
00607
00608 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
00609
00610 #ifndef YY_
00611 # if defined YYENABLE_NLS && YYENABLE_NLS
00612 # if ENABLE_NLS
00613 # include <libintl.h>
00614 # define YY_(msgid) dgettext ("bison-runtime", msgid)
00615 # endif
00616 # endif
00617 # ifndef YY_
00618 # define YY_(msgid) msgid
00619 # endif
00620 #endif
00621
00622
00623 #if ! defined lint || defined __GNUC__
00624 # define YYUSE(e) ((void) (e))
00625 #else
00626 # define YYUSE(e)
00627 #endif
00628
00629
00630 #ifndef lint
00631 # define YYID(n) (n)
00632 #else
00633 #if (defined __STDC__ || defined __C99__FUNC__ \
00634 || defined __cplusplus || defined _MSC_VER)
00635 static int
00636 YYID (int i)
00637 #else
00638 static int
00639 YYID (i)
00640 int i;
00641 #endif
00642 {
00643 return i;
00644 }
00645 #endif
00646
00647 #if ! defined yyoverflow || YYERROR_VERBOSE
00648
00649
00650
00651 # ifdef YYSTACK_USE_ALLOCA
00652 # if YYSTACK_USE_ALLOCA
00653 # ifdef __GNUC__
00654 # define YYSTACK_ALLOC __builtin_alloca
00655 # elif defined __BUILTIN_VA_ARG_INCR
00656 # include <alloca.h>
00657 # elif defined _AIX
00658 # define YYSTACK_ALLOC __alloca
00659 # elif defined _MSC_VER
00660 # include <malloc.h>
00661 # define alloca _alloca
00662 # else
00663 # define YYSTACK_ALLOC alloca
00664 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00665 || defined __cplusplus || defined _MSC_VER)
00666 # include <stdlib.h>
00667 # ifndef _STDLIB_H
00668 # define _STDLIB_H 1
00669 # endif
00670 # endif
00671 # endif
00672 # endif
00673 # endif
00674
00675 # ifdef YYSTACK_ALLOC
00676
00677 # define YYSTACK_FREE(Ptr) do { ; } while (YYID (0))
00678 # ifndef YYSTACK_ALLOC_MAXIMUM
00679
00680
00681
00682
00683 # define YYSTACK_ALLOC_MAXIMUM 4032
00684 # endif
00685 # else
00686 # define YYSTACK_ALLOC YYMALLOC
00687 # define YYSTACK_FREE YYFREE
00688 # ifndef YYSTACK_ALLOC_MAXIMUM
00689 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
00690 # endif
00691 # if (defined __cplusplus && ! defined _STDLIB_H \
00692 && ! ((defined YYMALLOC || defined malloc) \
00693 && (defined YYFREE || defined free)))
00694 # include <stdlib.h>
00695 # ifndef _STDLIB_H
00696 # define _STDLIB_H 1
00697 # endif
00698 # endif
00699 # ifndef YYMALLOC
00700 # define YYMALLOC malloc
00701 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00702 || defined __cplusplus || defined _MSC_VER)
00703 void *malloc (YYSIZE_T);
00704 # endif
00705 # endif
00706 # ifndef YYFREE
00707 # define YYFREE free
00708 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00709 || defined __cplusplus || defined _MSC_VER)
00710 void free (void *);
00711 # endif
00712 # endif
00713 # endif
00714 #endif
00715
00716
00717 #if (! defined yyoverflow \
00718 && (! defined __cplusplus \
00719 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00720
00721
00722 union yyalloc
00723 {
00724 yytype_int16 yyss;
00725 YYSTYPE yyvs;
00726 };
00727
00728
00729 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
00730
00731
00732
00733 # define YYSTACK_BYTES(N) \
00734 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
00735 + YYSTACK_GAP_MAXIMUM)
00736
00737
00738
00739 # ifndef YYCOPY
00740 # if defined __GNUC__ && 1 < __GNUC__
00741 # define YYCOPY(To, From, Count) \
00742 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00743 # else
00744 # define YYCOPY(To, From, Count) \
00745 do \
00746 { \
00747 YYSIZE_T yyi; \
00748 for (yyi = 0; yyi < (Count); yyi++) \
00749 (To)[yyi] = (From)[yyi]; \
00750 } \
00751 while (YYID (0))
00752 # endif
00753 # endif
00754
00755
00756
00757
00758
00759
00760 # define YYSTACK_RELOCATE(Stack) \
00761 do \
00762 { \
00763 YYSIZE_T yynewbytes; \
00764 YYCOPY (&yyptr->Stack, Stack, yysize); \
00765 Stack = &yyptr->Stack; \
00766 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
00767 yyptr += yynewbytes / sizeof (*yyptr); \
00768 } \
00769 while (YYID (0))
00770
00771 #endif
00772
00773
00774 #define YYFINAL 47
00775
00776 #define YYLAST 423
00777
00778
00779 #define YYNTOKENS 43
00780
00781 #define YYNNTS 32
00782
00783 #define YYNRULES 91
00784
00785 #define YYNSTATES 181
00786
00787
00788 #define YYUNDEFTOK 2
00789 #define YYMAXUTOK 287
00790
00791 #define YYTRANSLATE(YYX) \
00792 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
00793
00794
00795 static const yytype_uint8 yytranslate[] =
00796 {
00797 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00798 34, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00799 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00800 2, 2, 2, 37, 2, 2, 2, 2, 32, 2,
00801 39, 40, 2, 2, 2, 2, 2, 2, 2, 2,
00802 2, 2, 2, 2, 2, 2, 2, 2, 2, 33,
00803 2, 2, 38, 2, 2, 2, 2, 2, 2, 2,
00804 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00805 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00806 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00807 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00808 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00809 2, 2, 2, 41, 36, 42, 2, 2, 2, 2,
00810 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00811 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00812 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00813 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00814 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00815 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00816 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00817 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00818 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00819 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00820 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00821 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00822 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
00823 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
00824 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
00825 25, 26, 27, 28, 29, 30, 31, 35
00826 };
00827
00828 #if YYDEBUG
00829
00830
00831 static const yytype_uint16 yyprhs[] =
00832 {
00833 0, 0, 3, 6, 8, 10, 13, 15, 18, 21,
00834 26, 31, 35, 39, 41, 44, 49, 51, 54, 56,
00835 60, 64, 68, 73, 78, 83, 88, 93, 95, 98,
00836 101, 104, 106, 109, 111, 113, 115, 118, 120, 123,
00837 125, 127, 129, 131, 133, 135, 137, 139, 141, 143,
00838 145, 149, 153, 159, 166, 172, 180, 187, 192, 199,
00839 205, 212, 220, 227, 229, 232, 237, 242, 248, 254,
00840 256, 259, 265, 271, 278, 285, 287, 291, 298, 305,
00841 313, 321, 332, 343, 349, 355, 356, 359, 361, 363,
00842 365, 366
00843 };
00844
00845
00846 static const yytype_int8 yyrhs[] =
00847 {
00848 44, 0, -1, 45, 34, -1, 34, -1, 35, -1,
00849 1, 74, -1, 46, -1, 46, 32, -1, 46, 33,
00850 -1, 46, 17, 74, 46, -1, 46, 18, 74, 46,
00851 -1, 46, 32, 46, -1, 46, 33, 46, -1, 47,
00852 -1, 37, 47, -1, 47, 36, 74, 47, -1, 53,
00853 -1, 74, 49, -1, 50, -1, 50, 34, 74, -1,
00854 50, 32, 74, -1, 50, 33, 74, -1, 50, 17,
00855 74, 50, -1, 50, 18, 74, 50, -1, 50, 32,
00856 74, 50, -1, 50, 33, 74, 50, -1, 50, 34,
00857 74, 50, -1, 47, -1, 37, 47, -1, 38, 27,
00858 -1, 20, 27, -1, 51, -1, 52, 51, -1, 54,
00859 -1, 55, -1, 57, -1, 54, 57, -1, 56, -1,
00860 56, 52, -1, 69, -1, 63, -1, 70, -1, 71,
00861 -1, 61, -1, 58, -1, 59, -1, 60, -1, 27,
00862 -1, 28, -1, 51, -1, 39, 48, 40, -1, 41,
00863 48, 42, -1, 27, 39, 40, 74, 59, -1, 27,
00864 39, 40, 74, 59, 52, -1, 3, 48, 4, 48,
00865 7, -1, 3, 48, 4, 48, 5, 48, 7, -1,
00866 3, 48, 4, 48, 62, 7, -1, 6, 48, 4,
00867 48, -1, 6, 48, 4, 48, 5, 48, -1, 6,
00868 48, 4, 48, 62, -1, 8, 27, 74, 9, 74,
00869 10, -1, 8, 27, 74, 9, 66, 74, 10, -1,
00870 8, 27, 74, 9, 64, 10, -1, 65, -1, 66,
00871 65, -1, 74, 68, 40, 48, -1, 74, 68, 40,
00872 74, -1, 74, 39, 68, 40, 48, -1, 74, 39,
00873 68, 40, 74, -1, 67, -1, 66, 67, -1, 74,
00874 68, 40, 48, 16, -1, 74, 68, 40, 74, 16,
00875 -1, 74, 39, 68, 40, 48, 16, -1, 74, 39,
00876 68, 40, 74, 16, -1, 27, -1, 68, 36, 27,
00877 -1, 11, 27, 74, 14, 48, 15, -1, 11, 27,
00878 74, 41, 48, 42, -1, 11, 27, 33, 74, 14,
00879 48, 15, -1, 11, 27, 33, 74, 41, 48, 42,
00880 -1, 11, 27, 74, 9, 72, 73, 74, 14, 48,
00881 15, -1, 11, 27, 74, 9, 72, 73, 74, 41,
00882 48, 42, -1, 12, 48, 14, 48, 15, -1, 13,
00883 48, 14, 48, 15, -1, -1, 72, 27, -1, 34,
00884 -1, 33, -1, 35, -1, -1, 74, 34, -1
00885 };
00886
00887
00888 static const yytype_uint16 yyrline[] =
00889 {
00890 0, 471, 471, 496, 501, 507, 526, 530, 534, 540,
00891 544, 548, 552, 556, 560, 566, 570, 582, 588, 592,
00892 596, 600, 606, 610, 614, 618, 622, 626, 630, 642,
00893 647, 687, 691, 703, 707, 713, 717, 723, 727, 733,
00894 737, 741, 745, 749, 753, 757, 761, 767, 772, 777,
00895 790, 796, 802, 806, 818, 822, 826, 832, 836, 840,
00896 852, 856, 860, 866, 870, 876, 880, 884, 888, 894,
00897 898, 904, 908, 912, 916, 922, 926, 938, 942, 946,
00898 950, 954, 958, 970, 982, 994, 998, 1004, 1007, 1010,
00899 1015, 1018
00900 };
00901 #endif
00902
00903 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00904
00905
00906 static const char *const yytname[] =
00907 {
00908 "$end", "error", "$undefined", "IF", "THEN", "ELSE", "ELIF", "FI",
00909 "CASE", "IN", "ESAC", "FOR", "WHILE", "UNTIL", "DO", "DONE", "SEMI_SEMI",
00910 "AND_AND", "OR_OR", "LESS_LESS", "GREATER_GREATER", "LESS_AND",
00911 "GREATER_AND", "AND_GREATER", "LESS_GREATER", "GREATER_BAR",
00912 "LESS_LESS_MINUS", "WORD", "ASSIGNMENT_WORD", "SELECT", "FUNCTION",
00913 "BANG", "'&'", "';'", "'\\n'", "vsh_EOF", "'|'", "'!'", "'>'", "'('",
00914 "')'", "'{'", "'}'", "$accept", "inputunit", "simple_list",
00915 "simple_list1", "pipeline", "list", "list0", "list1", "redirection",
00916 "redirections", "command", "simple_command", "shell_command",
00917 "shell_command_1", "simple_command_element", "subshell", "group_command",
00918 "function_def", "if_command", "elif_clause", "case_command",
00919 "case_clause_1", "pattern_list_1", "case_clause_sequence",
00920 "pattern_list", "pattern", "for_command", "while_command",
00921 "until_command", "words", "term", "newlines", 0
00922 };
00923 #endif
00924
00925 # ifdef YYPRINT
00926
00927
00928 static const yytype_uint16 yytoknum[] =
00929 {
00930 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
00931 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
00932 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
00933 285, 286, 38, 59, 10, 287, 124, 33, 62, 40,
00934 41, 123, 125
00935 };
00936 # endif
00937
00938
00939 static const yytype_uint8 yyr1[] =
00940 {
00941 0, 43, 44, 44, 44, 44, 45, 45, 45, 46,
00942 46, 46, 46, 46, 46, 47, 47, 48, 49, 49,
00943 49, 49, 50, 50, 50, 50, 50, 50, 50, 51,
00944 51, 52, 52, 53, 53, 54, 54, 55, 55, 56,
00945 56, 56, 56, 56, 56, 56, 56, 57, 57, 57,
00946 58, 59, 60, 60, 61, 61, 61, 62, 62, 62,
00947 63, 63, 63, 64, 64, 65, 65, 65, 65, 66,
00948 66, 67, 67, 67, 67, 68, 68, 69, 69, 69,
00949 69, 69, 69, 70, 71, 72, 72, 73, 73, 73,
00950 74, 74
00951 };
00952
00953
00954 static const yytype_uint8 yyr2[] =
00955 {
00956 0, 2, 2, 1, 1, 2, 1, 2, 2, 4,
00957 4, 3, 3, 1, 2, 4, 1, 2, 1, 3,
00958 3, 3, 4, 4, 4, 4, 4, 1, 2, 2,
00959 2, 1, 2, 1, 1, 1, 2, 1, 2, 1,
00960 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00961 3, 3, 5, 6, 5, 7, 6, 4, 6, 5,
00962 6, 7, 6, 1, 2, 4, 4, 5, 5, 1,
00963 2, 5, 5, 6, 6, 1, 3, 6, 6, 7,
00964 7, 10, 10, 5, 5, 0, 2, 1, 1, 1,
00965 0, 2
00966 };
00967
00968
00969
00970
00971 static const yytype_uint8 yydefact[] =
00972 {
00973 0, 90, 90, 0, 0, 90, 90, 0, 47, 48,
00974 3, 4, 0, 0, 90, 90, 0, 0, 6, 13,
00975 49, 16, 33, 34, 37, 35, 44, 45, 46, 43,
00976 40, 39, 41, 42, 5, 0, 0, 90, 90, 0,
00977 0, 30, 0, 14, 29, 0, 0, 1, 2, 90,
00978 90, 7, 8, 90, 47, 36, 31, 38, 91, 90,
00979 0, 27, 17, 18, 0, 90, 0, 90, 90, 90,
00980 50, 51, 0, 0, 11, 12, 0, 32, 0, 28,
00981 90, 90, 90, 90, 90, 90, 0, 85, 90, 90,
00982 0, 0, 0, 9, 10, 0, 0, 15, 90, 90,
00983 54, 0, 0, 0, 20, 21, 19, 0, 63, 90,
00984 69, 0, 90, 90, 0, 0, 0, 83, 84, 52,
00985 0, 0, 56, 22, 23, 24, 25, 26, 62, 64,
00986 70, 0, 60, 75, 0, 0, 0, 0, 86, 88,
00987 87, 89, 90, 77, 78, 53, 55, 90, 90, 90,
00988 90, 61, 0, 0, 90, 79, 80, 0, 57, 0,
00989 0, 0, 90, 76, 65, 66, 90, 90, 90, 59,
00990 67, 68, 71, 72, 0, 0, 58, 73, 74, 81,
00991 82
00992 };
00993
00994
00995 static const yytype_int16 yydefgoto[] =
00996 {
00997 -1, 16, 17, 74, 61, 35, 62, 63, 20, 57,
00998 21, 22, 23, 24, 25, 26, 27, 28, 29, 101,
00999 30, 107, 108, 109, 110, 135, 31, 32, 33, 114,
01000 142, 36
01001 };
01002
01003
01004
01005 #define YYPACT_NINF -92
01006 static const yytype_int16 yypact[] =
01007 {
01008 163, -92, -92, 1, 13, -92, -92, 18, 11, -92,
01009 -92, -92, 382, 26, -92, -92, 17, 33, 78, 43,
01010 -92, -92, 9, -92, 14, -92, -92, -92, -92, -92,
01011 -92, -92, -92, -92, 42, 88, 264, -92, 52, 68,
01012 91, -92, 76, 43, -92, 77, 82, -92, -92, -92,
01013 -92, 328, 328, -92, -92, -92, -92, 14, -92, -92,
01014 382, 43, -92, 40, -4, -92, 7, -92, -92, -92,
01015 -92, -92, 296, 296, 60, 60, 350, -92, 59, 43,
01016 -92, -92, -92, -92, -92, -92, -10, -92, -92, -92,
01017 103, 104, -16, -92, -92, 328, 328, 43, -92, -92,
01018 -92, 113, 264, 264, 264, 264, 264, 116, -92, -92,
01019 -92, -7, -92, -92, 79, 112, 86, -92, -92, 14,
01020 122, 126, -92, -92, -92, 81, 81, 81, -92, -92,
01021 -92, 12, -92, -92, 105, -17, 118, 89, -92, -92,
01022 -92, -92, -92, -92, -92, 14, -92, -92, -92, -92,
01023 -92, -92, 2, 107, -92, -92, -92, -8, 97, 264,
01024 264, 264, -92, -92, 119, 200, -92, -92, -92, -92,
01025 120, 232, -92, -92, 123, 95, -92, -92, -92, -92,
01026 -92
01027 };
01028
01029
01030 static const yytype_int8 yypgoto[] =
01031 {
01032 -92, -92, -92, 8, 49, -5, -92, -91, -22, 20,
01033 -92, -92, -92, -92, 121, -92, 48, -92, -92, -12,
01034 -92, -92, 32, -92, 38, 16, -92, -92, -92, -92,
01035 -92, 6
01036 };
01037
01038
01039
01040
01041
01042 #define YYTABLE_NINF -1
01043 static const yytype_uint8 yytable[] =
01044 {
01045 39, 40, 56, 132, 112, 85, 166, 34, 18, 45,
01046 46, 123, 124, 125, 126, 127, 87, 47, 58, 153,
01047 133, 88, 151, 154, 58, 15, 58, 58, 37, 7,
01048 58, 113, 134, 167, 7, 77, 54, 9, 153, 133,
01049 38, 58, 162, 64, 66, 41, 58, 13, 89, 19,
01050 42, 134, 13, 44, 78, 72, 73, 80, 81, 76,
01051 75, 43, 90, 91, 98, 99, 100, 48, 125, 126,
01052 127, 86, 82, 83, 84, 92, 58, 49, 50, 53,
01053 93, 94, 67, 115, 116, 65, 102, 103, 104, 105,
01054 106, 111, 59, 120, 121, 49, 50, 56, 80, 81,
01055 19, 19, 168, 99, 75, 68, 138, 136, 137, 79,
01056 51, 52, 139, 140, 141, 131, 69, 70, 117, 118,
01057 122, 19, 19, 77, 71, 97, 128, 143, 144, 146,
01058 147, 156, 133, 155, 163, 172, 177, 180, 179, 145,
01059 119, 129, 158, 55, 19, 19, 169, 130, 157, 164,
01060 152, 0, 0, 0, 159, 160, 161, 170, 0, 0,
01061 165, 174, 175, 176, 1, 0, 2, 0, 171, 0,
01062 0, 3, 0, 0, 4, 5, 6, 0, 0, 0,
01063 0, 0, 0, 7, 0, 0, 0, 0, 0, 0,
01064 8, 9, 0, 0, 0, 0, 0, 10, 11, 0,
01065 12, 13, 14, 2, 15, 0, 0, 0, 3, 0,
01066 0, 4, 5, 6, 0, 0, 173, 0, 0, 0,
01067 7, 0, 0, 0, 0, 0, 0, 8, 9, 0,
01068 0, 0, 0, 0, 58, 2, 0, 60, 13, 14,
01069 3, 15, 0, 4, 5, 6, 0, 0, 178, 0,
01070 0, 0, 7, 0, 0, 0, 0, 0, 0, 8,
01071 9, 0, 0, 0, 0, 0, 58, 2, 0, 60,
01072 13, 14, 3, 15, 0, 4, 5, 6, 0, 0,
01073 0, 0, 0, 0, 7, 0, 0, 0, 0, 0,
01074 0, 8, 9, 0, 0, 0, 0, 0, 58, 2,
01075 0, 60, 13, 14, 3, 15, 0, 4, 5, 6,
01076 0, 0, 0, 0, 0, 0, 7, 0, 0, 0,
01077 0, 0, 0, 8, 9, 0, 0, 0, 0, 0,
01078 58, 2, 0, 12, 13, 14, 3, 15, 0, 4,
01079 5, 6, 0, 0, 0, 0, 0, 0, 7, 0,
01080 0, 0, 0, 2, 0, 8, 9, 0, 3, 0,
01081 0, 4, 5, 6, 0, 12, 13, 14, 0, 15,
01082 7, 0, 0, 0, 0, 0, 0, 8, 9, 0,
01083 0, 0, 0, 0, 58, 2, 0, 0, 13, 14,
01084 3, 15, 0, 4, 5, 6, 0, 0, 0, 0,
01085 0, 0, 7, 0, 0, 0, 0, 0, 0, 8,
01086 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
01087 13, 14, 0, 15
01088 };
01089
01090 static const yytype_int16 yycheck[] =
01091 {
01092 5, 6, 24, 10, 14, 9, 14, 1, 0, 14,
01093 15, 102, 103, 104, 105, 106, 9, 0, 34, 36,
01094 27, 14, 10, 40, 34, 41, 34, 34, 27, 20,
01095 34, 41, 39, 41, 20, 57, 27, 28, 36, 27,
01096 27, 34, 40, 37, 38, 27, 34, 38, 41, 0,
01097 39, 39, 38, 27, 59, 49, 50, 17, 18, 53,
01098 52, 12, 67, 68, 5, 6, 7, 34, 159, 160,
01099 161, 65, 32, 33, 34, 69, 34, 17, 18, 36,
01100 72, 73, 14, 88, 89, 33, 80, 81, 82, 83,
01101 84, 85, 4, 98, 99, 17, 18, 119, 17, 18,
01102 51, 52, 5, 6, 96, 14, 27, 112, 113, 60,
01103 32, 33, 33, 34, 35, 109, 40, 40, 15, 15,
01104 7, 72, 73, 145, 42, 76, 10, 15, 42, 7,
01105 4, 42, 27, 15, 27, 16, 16, 42, 15, 119,
01106 92, 109, 147, 22, 95, 96, 158, 109, 142, 154,
01107 134, -1, -1, -1, 148, 149, 150, 162, -1, -1,
01108 154, 166, 167, 168, 1, -1, 3, -1, 162, -1,
01109 -1, 8, -1, -1, 11, 12, 13, -1, -1, -1,
01110 -1, -1, -1, 20, -1, -1, -1, -1, -1, -1,
01111 27, 28, -1, -1, -1, -1, -1, 34, 35, -1,
01112 37, 38, 39, 3, 41, -1, -1, -1, 8, -1,
01113 -1, 11, 12, 13, -1, -1, 16, -1, -1, -1,
01114 20, -1, -1, -1, -1, -1, -1, 27, 28, -1,
01115 -1, -1, -1, -1, 34, 3, -1, 37, 38, 39,
01116 8, 41, -1, 11, 12, 13, -1, -1, 16, -1,
01117 -1, -1, 20, -1, -1, -1, -1, -1, -1, 27,
01118 28, -1, -1, -1, -1, -1, 34, 3, -1, 37,
01119 38, 39, 8, 41, -1, 11, 12, 13, -1, -1,
01120 -1, -1, -1, -1, 20, -1, -1, -1, -1, -1,
01121 -1, 27, 28, -1, -1, -1, -1, -1, 34, 3,
01122 -1, 37, 38, 39, 8, 41, -1, 11, 12, 13,
01123 -1, -1, -1, -1, -1, -1, 20, -1, -1, -1,
01124 -1, -1, -1, 27, 28, -1, -1, -1, -1, -1,
01125 34, 3, -1, 37, 38, 39, 8, 41, -1, 11,
01126 12, 13, -1, -1, -1, -1, -1, -1, 20, -1,
01127 -1, -1, -1, 3, -1, 27, 28, -1, 8, -1,
01128 -1, 11, 12, 13, -1, 37, 38, 39, -1, 41,
01129 20, -1, -1, -1, -1, -1, -1, 27, 28, -1,
01130 -1, -1, -1, -1, 34, 3, -1, -1, 38, 39,
01131 8, 41, -1, 11, 12, 13, -1, -1, -1, -1,
01132 -1, -1, 20, -1, -1, -1, -1, -1, -1, 27,
01133 28, -1, -1, -1, -1, -1, -1, -1, -1, -1,
01134 38, 39, -1, 41
01135 };
01136
01137
01138
01139 static const yytype_uint8 yystos[] =
01140 {
01141 0, 1, 3, 8, 11, 12, 13, 20, 27, 28,
01142 34, 35, 37, 38, 39, 41, 44, 45, 46, 47,
01143 51, 53, 54, 55, 56, 57, 58, 59, 60, 61,
01144 63, 69, 70, 71, 74, 48, 74, 27, 27, 48,
01145 48, 27, 39, 47, 27, 48, 48, 0, 34, 17,
01146 18, 32, 33, 36, 27, 57, 51, 52, 34, 4,
01147 37, 47, 49, 50, 74, 33, 74, 14, 14, 40,
01148 40, 42, 74, 74, 46, 46, 74, 51, 48, 47,
01149 17, 18, 32, 33, 34, 9, 74, 9, 14, 41,
01150 48, 48, 74, 46, 46, 32, 33, 47, 5, 6,
01151 7, 62, 74, 74, 74, 74, 74, 64, 65, 66,
01152 67, 74, 14, 41, 72, 48, 48, 15, 15, 59,
01153 48, 48, 7, 50, 50, 50, 50, 50, 10, 65,
01154 67, 74, 10, 27, 39, 68, 48, 48, 27, 33,
01155 34, 35, 73, 15, 42, 52, 7, 4, 32, 33,
01156 34, 10, 68, 36, 40, 15, 42, 74, 48, 74,
01157 74, 74, 40, 27, 48, 74, 14, 41, 5, 62,
01158 48, 74, 16, 16, 48, 48, 48, 16, 16, 15,
01159 42
01160 };
01161
01162 #define yyerrok (yyerrstatus = 0)
01163 #define yyclearin (yychar = YYEMPTY)
01164 #define YYEMPTY (-2)
01165 #define YYEOF 0
01166
01167 #define YYACCEPT goto yyacceptlab
01168 #define YYABORT goto yyabortlab
01169 #define YYERROR goto yyerrorlab
01170
01171
01172
01173
01174
01175
01176 #define YYFAIL goto yyerrlab
01177
01178 #define YYRECOVERING() (!!yyerrstatus)
01179
01180 #define YYBACKUP(Token, Value) \
01181 do \
01182 if (yychar == YYEMPTY && yylen == 1) \
01183 { \
01184 yychar = (Token); \
01185 yylval = (Value); \
01186 yytoken = YYTRANSLATE (yychar); \
01187 YYPOPSTACK (1); \
01188 goto yybackup; \
01189 } \
01190 else \
01191 { \
01192 yyerror (YY_("syntax error: cannot back up")); \
01193 YYERROR; \
01194 } \
01195 while (YYID (0))
01196
01197
01198 #define YYTERROR 1
01199 #define YYERRCODE 256
01200
01201
01202
01203
01204
01205
01206 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
01207 #ifndef YYLLOC_DEFAULT
01208 # define YYLLOC_DEFAULT(Current, Rhs, N) \
01209 do \
01210 if (YYID (N)) \
01211 { \
01212 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
01213 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
01214 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
01215 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
01216 } \
01217 else \
01218 { \
01219 (Current).first_line = (Current).last_line = \
01220 YYRHSLOC (Rhs, 0).last_line; \
01221 (Current).first_column = (Current).last_column = \
01222 YYRHSLOC (Rhs, 0).last_column; \
01223 } \
01224 while (YYID (0))
01225 #endif
01226
01227
01228
01229
01230
01231
01232 #ifndef YY_LOCATION_PRINT
01233 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
01234 # define YY_LOCATION_PRINT(File, Loc) \
01235 fprintf (File, "%d.%d-%d.%d", \
01236 (Loc).first_line, (Loc).first_column, \
01237 (Loc).last_line, (Loc).last_column)
01238 # else
01239 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
01240 # endif
01241 #endif
01242
01243
01244
01245
01246 #ifdef YYLEX_PARAM
01247 # define YYLEX yylex (YYLEX_PARAM)
01248 #else
01249 # define YYLEX yylex ()
01250 #endif
01251
01252
01253 #if YYDEBUG
01254
01255 # ifndef YYFPRINTF
01256 # include <stdio.h>
01257 # define YYFPRINTF fprintf
01258 # endif
01259
01260 # define YYDPRINTF(Args) \
01261 do { \
01262 if (yydebug) \
01263 YYFPRINTF Args; \
01264 } while (YYID (0))
01265
01266 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
01267 do { \
01268 if (yydebug) \
01269 { \
01270 YYFPRINTF (stderr, "%s ", Title); \
01271 yy_symbol_print (stderr, \
01272 Type, Value); \
01273 YYFPRINTF (stderr, "\n"); \
01274 } \
01275 } while (YYID (0))
01276
01277
01278
01279
01280
01281
01282
01283 #if (defined __STDC__ || defined __C99__FUNC__ \
01284 || defined __cplusplus || defined _MSC_VER)
01285 static void
01286 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
01287 #else
01288 static void
01289 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
01290 FILE *yyoutput;
01291 int yytype;
01292 YYSTYPE const * const yyvaluep;
01293 #endif
01294 {
01295 if (!yyvaluep)
01296 return;
01297 # ifdef YYPRINT
01298 if (yytype < YYNTOKENS)
01299 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
01300 # else
01301 YYUSE (yyoutput);
01302 # endif
01303 switch (yytype)
01304 {
01305 default:
01306 break;
01307 }
01308 }
01309
01310
01311
01312
01313
01314
01315 #if (defined __STDC__ || defined __C99__FUNC__ \
01316 || defined __cplusplus || defined _MSC_VER)
01317 static void
01318 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
01319 #else
01320 static void
01321 yy_symbol_print (yyoutput, yytype, yyvaluep)
01322 FILE *yyoutput;
01323 int yytype;
01324 YYSTYPE const * const yyvaluep;
01325 #endif
01326 {
01327 if (yytype < YYNTOKENS)
01328 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
01329 else
01330 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
01331
01332 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
01333 YYFPRINTF (yyoutput, ")");
01334 }
01335
01336
01337
01338
01339
01340
01341 #if (defined __STDC__ || defined __C99__FUNC__ \
01342 || defined __cplusplus || defined _MSC_VER)
01343 static void
01344 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
01345 #else
01346 static void
01347 yy_stack_print (bottom, top)
01348 yytype_int16 *bottom;
01349 yytype_int16 *top;
01350 #endif
01351 {
01352 YYFPRINTF (stderr, "Stack now");
01353 for (; bottom <= top; ++bottom)
01354 YYFPRINTF (stderr, " %d", *bottom);
01355 YYFPRINTF (stderr, "\n");
01356 }
01357
01358 # define YY_STACK_PRINT(Bottom, Top) \
01359 do { \
01360 if (yydebug) \
01361 yy_stack_print ((Bottom), (Top)); \
01362 } while (YYID (0))
01363
01364
01365
01366
01367
01368
01369 #if (defined __STDC__ || defined __C99__FUNC__ \
01370 || defined __cplusplus || defined _MSC_VER)
01371 static void
01372 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
01373 #else
01374 static void
01375 yy_reduce_print (yyvsp, yyrule)
01376 YYSTYPE *yyvsp;
01377 int yyrule;
01378 #endif
01379 {
01380 int yynrhs = yyr2[yyrule];
01381 int yyi;
01382 unsigned long int yylno = yyrline[yyrule];
01383 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
01384 yyrule - 1, yylno);
01385
01386 for (yyi = 0; yyi < yynrhs; yyi++)
01387 {
01388 fprintf (stderr, " $%d = ", yyi + 1);
01389 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
01390 &(yyvsp[(yyi + 1) - (yynrhs)])
01391 );
01392 fprintf (stderr, "\n");
01393 }
01394 }
01395
01396 # define YY_REDUCE_PRINT(Rule) \
01397 do { \
01398 if (yydebug) \
01399 yy_reduce_print (yyvsp, Rule); \
01400 } while (YYID (0))
01401
01402
01403
01404 int yydebug;
01405 #else
01406 # define YYDPRINTF(Args)
01407 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
01408 # define YY_STACK_PRINT(Bottom, Top)
01409 # define YY_REDUCE_PRINT(Rule)
01410 #endif
01411
01412
01413
01414 #ifndef YYINITDEPTH
01415 # define YYINITDEPTH 200
01416 #endif
01417
01418
01419
01420
01421
01422
01423
01424
01425 #ifndef YYMAXDEPTH
01426 # define YYMAXDEPTH 10000
01427 #endif
01428
01429
01430
01431 #if YYERROR_VERBOSE
01432
01433 # ifndef yystrlen
01434 # if defined __GLIBC__ && defined _STRING_H
01435 # define yystrlen strlen
01436 # else
01437
01438 #if (defined __STDC__ || defined __C99__FUNC__ \
01439 || defined __cplusplus || defined _MSC_VER)
01440 static YYSIZE_T
01441 yystrlen (const char *yystr)
01442 #else
01443 static YYSIZE_T
01444 yystrlen (yystr)
01445 const char *yystr;
01446 #endif
01447 {
01448 YYSIZE_T yylen;
01449 for (yylen = 0; yystr[yylen]; yylen++)
01450 continue;
01451 return yylen;
01452 }
01453 # endif
01454 # endif
01455
01456 # ifndef yystpcpy
01457 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
01458 # define yystpcpy stpcpy
01459 # else
01460
01461
01462 #if (defined __STDC__ || defined __C99__FUNC__ \
01463 || defined __cplusplus || defined _MSC_VER)
01464 static char *
01465 yystpcpy (char *yydest, const char *yysrc)
01466 #else
01467 static char *
01468 yystpcpy (yydest, yysrc)
01469 char *yydest;
01470 const char *yysrc;
01471 #endif
01472 {
01473 char *yyd = yydest;
01474 const char *yys = yysrc;
01475
01476 while ((*yyd++ = *yys++) != '\0')
01477 continue;
01478
01479 return yyd - 1;
01480 }
01481 # endif
01482 # endif
01483
01484 # ifndef yytnamerr
01485
01486
01487
01488
01489
01490
01491
01492 static YYSIZE_T
01493 yytnamerr (char *yyres, const char *yystr)
01494 {
01495 if (*yystr == '"')
01496 {
01497 YYSIZE_T yyn = 0;
01498 char const *yyp = yystr;
01499
01500 for (;;)
01501 switch (*++yyp)
01502 {
01503 case '\'':
01504 case ',':
01505 goto do_not_strip_quotes;
01506
01507 case '\\':
01508 if (*++yyp != '\\')
01509 goto do_not_strip_quotes;
01510
01511 default:
01512 if (yyres)
01513 yyres[yyn] = *yyp;
01514 yyn++;
01515 break;
01516
01517 case '"':
01518 if (yyres)
01519 yyres[yyn] = '\0';
01520 return yyn;
01521 }
01522 do_not_strip_quotes: ;
01523 }
01524
01525 if (! yyres)
01526 return yystrlen (yystr);
01527
01528 return yystpcpy (yyres, yystr) - yyres;
01529 }
01530 # endif
01531
01532
01533
01534
01535
01536
01537
01538
01539 static YYSIZE_T
01540 yysyntax_error (char *yyresult, int yystate, int yychar)
01541 {
01542 int yyn = yypact[yystate];
01543
01544 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
01545 return 0;
01546 else
01547 {
01548 int yytype = YYTRANSLATE (yychar);
01549 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
01550 YYSIZE_T yysize = yysize0;
01551 YYSIZE_T yysize1;
01552 int yysize_overflow = 0;
01553 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
01554 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
01555 int yyx;
01556
01557 # if 0
01558
01559
01560 YY_("syntax error, unexpected %s");
01561 YY_("syntax error, unexpected %s, expecting %s");
01562 YY_("syntax error, unexpected %s, expecting %s or %s");
01563 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
01564 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
01565 # endif
01566 char *yyfmt;
01567 char const *yyf;
01568 static char const yyunexpected[] = "syntax error, unexpected %s";
01569 static char const yyexpecting[] = ", expecting %s";
01570 static char const yyor[] = " or %s";
01571 char yyformat[sizeof yyunexpected
01572 + sizeof yyexpecting - 1
01573 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
01574 * (sizeof yyor - 1))];
01575 char const *yyprefix = yyexpecting;
01576
01577
01578
01579 int yyxbegin = yyn < 0 ? -yyn : 0;
01580
01581
01582 int yychecklim = YYLAST - yyn + 1;
01583 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
01584 int yycount = 1;
01585
01586 yyarg[0] = yytname[yytype];
01587 yyfmt = yystpcpy (yyformat, yyunexpected);
01588
01589 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
01590 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01591 {
01592 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
01593 {
01594 yycount = 1;
01595 yysize = yysize0;
01596 yyformat[sizeof yyunexpected - 1] = '\0';
01597 break;
01598 }
01599 yyarg[yycount++] = yytname[yyx];
01600 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
01601 yysize_overflow |= (yysize1 < yysize);
01602 yysize = yysize1;
01603 yyfmt = yystpcpy (yyfmt, yyprefix);
01604 yyprefix = yyor;
01605 }
01606
01607 yyf = YY_(yyformat);
01608 yysize1 = yysize + yystrlen (yyf);
01609 yysize_overflow |= (yysize1 < yysize);
01610 yysize = yysize1;
01611
01612 if (yysize_overflow)
01613 return YYSIZE_MAXIMUM;
01614
01615 if (yyresult)
01616 {
01617
01618
01619
01620 char *yyp = yyresult;
01621 int yyi = 0;
01622 while ((*yyp = *yyf) != '\0')
01623 {
01624 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
01625 {
01626 yyp += yytnamerr (yyp, yyarg[yyi++]);
01627 yyf += 2;
01628 }
01629 else
01630 {
01631 yyp++;
01632 yyf++;
01633 }
01634 }
01635 }
01636 return yysize;
01637 }
01638 }
01639 #endif
01640
01641
01642
01643
01644
01645
01646
01647 #if (defined __STDC__ || defined __C99__FUNC__ \
01648 || defined __cplusplus || defined _MSC_VER)
01649 static void
01650 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
01651 #else
01652 static void
01653 yydestruct (yymsg, yytype, yyvaluep)
01654 const char *yymsg;
01655 int yytype;
01656 YYSTYPE *yyvaluep;
01657 #endif
01658 {
01659 YYUSE (yyvaluep);
01660
01661 if (!yymsg)
01662 yymsg = "Deleting";
01663 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
01664
01665 switch (yytype)
01666 {
01667
01668 default:
01669 break;
01670 }
01671 }
01672
01673
01674
01675
01676 #ifdef YYPARSE_PARAM
01677 #if defined __STDC__ || defined __cplusplus
01678 int yyparse (void *YYPARSE_PARAM);
01679 #else
01680 int yyparse ();
01681 #endif
01682 #else
01683 #if defined __STDC__ || defined __cplusplus
01684 int yyparse (void);
01685 #else
01686 int yyparse ();
01687 #endif
01688 #endif
01689
01690
01691
01692
01693 int yychar;
01694
01695
01696 YYSTYPE yylval;
01697
01698
01699 int yynerrs;
01700
01701
01702
01703
01704
01705
01706
01707 #ifdef YYPARSE_PARAM
01708 #if (defined __STDC__ || defined __C99__FUNC__ \
01709 || defined __cplusplus || defined _MSC_VER)
01710 int
01711 yyparse (void *YYPARSE_PARAM)
01712 #else
01713 int
01714 yyparse (YYPARSE_PARAM)
01715 void *YYPARSE_PARAM;
01716 #endif
01717 #else
01718 #if (defined __STDC__ || defined __C99__FUNC__ \
01719 || defined __cplusplus || defined _MSC_VER)
01720 int
01721 yyparse (void)
01722 #else
01723 int
01724 yyparse ()
01725
01726 #endif
01727 #endif
01728 {
01729
01730 int yystate;
01731 int yyn;
01732 int yyresult;
01733
01734 int yyerrstatus;
01735
01736 int yytoken = 0;
01737 #if YYERROR_VERBOSE
01738
01739 char yymsgbuf[128];
01740 char *yymsg = yymsgbuf;
01741 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
01742 #endif
01743
01744
01745
01746
01747
01748
01749
01750
01751
01752
01753 yytype_int16 yyssa[YYINITDEPTH];
01754 yytype_int16 *yyss = yyssa;
01755 yytype_int16 *yyssp;
01756
01757
01758 YYSTYPE yyvsa[YYINITDEPTH];
01759 YYSTYPE *yyvs = yyvsa;
01760 YYSTYPE *yyvsp;
01761
01762
01763
01764 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
01765
01766 YYSIZE_T yystacksize = YYINITDEPTH;
01767
01768
01769
01770 YYSTYPE yyval;
01771
01772
01773
01774
01775 int yylen = 0;
01776
01777 YYDPRINTF ((stderr, "Starting parse\n"));
01778
01779 yystate = 0;
01780 yyerrstatus = 0;
01781 yynerrs = 0;
01782 yychar = YYEMPTY;
01783
01784
01785
01786
01787
01788
01789 yyssp = yyss;
01790 yyvsp = yyvs;
01791
01792 goto yysetstate;
01793
01794
01795
01796
01797 yynewstate:
01798
01799
01800 yyssp++;
01801
01802 yysetstate:
01803 *yyssp = yystate;
01804
01805 if (yyss + yystacksize - 1 <= yyssp)
01806 {
01807
01808 YYSIZE_T yysize = yyssp - yyss + 1;
01809
01810 #ifdef yyoverflow
01811 {
01812
01813
01814
01815 YYSTYPE *yyvs1 = yyvs;
01816 yytype_int16 *yyss1 = yyss;
01817
01818
01819
01820
01821
01822
01823 yyoverflow (YY_("memory exhausted"),
01824 &yyss1, yysize * sizeof (*yyssp),
01825 &yyvs1, yysize * sizeof (*yyvsp),
01826
01827 &yystacksize);
01828
01829 yyss = yyss1;
01830 yyvs = yyvs1;
01831 }
01832 #else
01833 # ifndef YYSTACK_RELOCATE
01834 goto yyexhaustedlab;
01835 # else
01836
01837 if (YYMAXDEPTH <= yystacksize)
01838 goto yyexhaustedlab;
01839 yystacksize *= 2;
01840 if (YYMAXDEPTH < yystacksize)
01841 yystacksize = YYMAXDEPTH;
01842
01843 {
01844 yytype_int16 *yyss1 = yyss;
01845 union yyalloc *yyptr =
01846 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01847 if (! yyptr)
01848 goto yyexhaustedlab;
01849 YYSTACK_RELOCATE (yyss);
01850 YYSTACK_RELOCATE (yyvs);
01851
01852 # undef YYSTACK_RELOCATE
01853 if (yyss1 != yyssa)
01854 YYSTACK_FREE (yyss1);
01855 }
01856 # endif
01857 #endif
01858
01859 yyssp = yyss + yysize - 1;
01860 yyvsp = yyvs + yysize - 1;
01861
01862
01863 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01864 (unsigned long int) yystacksize));
01865
01866 if (yyss + yystacksize - 1 <= yyssp)
01867 YYABORT;
01868 }
01869
01870 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01871
01872 goto yybackup;
01873
01874
01875
01876
01877 yybackup:
01878
01879
01880
01881
01882
01883 yyn = yypact[yystate];
01884 if (yyn == YYPACT_NINF)
01885 goto yydefault;
01886
01887
01888
01889
01890 if (yychar == YYEMPTY)
01891 {
01892 YYDPRINTF ((stderr, "Reading a token: "));
01893 yychar = YYLEX;
01894 }
01895
01896 if (yychar <= YYEOF)
01897 {
01898 yychar = yytoken = YYEOF;
01899 YYDPRINTF ((stderr, "Now at end of input.\n"));
01900 }
01901 else
01902 {
01903 yytoken = YYTRANSLATE (yychar);
01904 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
01905 }
01906
01907
01908
01909 yyn += yytoken;
01910 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01911 goto yydefault;
01912 yyn = yytable[yyn];
01913 if (yyn <= 0)
01914 {
01915 if (yyn == 0 || yyn == YYTABLE_NINF)
01916 goto yyerrlab;
01917 yyn = -yyn;
01918 goto yyreduce;
01919 }
01920
01921 if (yyn == YYFINAL)
01922 YYACCEPT;
01923
01924
01925
01926 if (yyerrstatus)
01927 yyerrstatus--;
01928
01929
01930 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01931
01932
01933 if (yychar != YYEOF)
01934 yychar = YYEMPTY;
01935
01936 yystate = yyn;
01937 *++yyvsp = yylval;
01938
01939 goto yynewstate;
01940
01941
01942
01943
01944
01945 yydefault:
01946 yyn = yydefact[yystate];
01947 if (yyn == 0)
01948 goto yyerrlab;
01949 goto yyreduce;
01950
01951
01952
01953
01954
01955 yyreduce:
01956
01957 yylen = yyr2[yyn];
01958
01959
01960
01961
01962
01963
01964
01965
01966
01967 yyval = yyvsp[1-yylen];
01968
01969
01970 YY_REDUCE_PRINT (yyn);
01971 switch (yyn)
01972 {
01973 case 2:
01974
01975 {
01976 Vsh_trace("Yacc","inputunit::1");
01977 global_command = (yyvsp[(1) - (2)].command);
01978 if (global_command != VNULL) {
01979 if (global_command->type == cm_simple) {
01980 wordTmp = (yyvsp[(1) - (2)].command)->value.Simple->words;
01981 memset(buf, VNULL_SYMBOL, sizeof(buf));
01982 while (wordTmp != VNULL) {
01983 wTmp = wordTmp->word;
01984 if (wTmp != VNULL) {
01985 strcat(buf,wTmp->word);
01986 wordTmp = wordTmp->next;
01987 } else {
01988 wordTmp = VNULL;
01989 }
01990 if (wordTmp != VNULL) strcat(buf," ");
01991 }
01992 Vnm_print(1,"Vsh: will execv: <%s>\n", buf);
01993 Vsh_parseHandoff(buf);
01994 Vsh_yyexecute(global_command);
01995 dispose_command (global_command);
01996 }
01997 }
01998 YYACCEPT;
01999 }
02000 break;
02001
02002 case 3:
02003
02004 {
02005 Vsh_trace("Yacc","inputunit::2");
02006 global_command = (COMMAND*)VNULL;
02007 YYACCEPT;
02008 }
02009 break;
02010
02011 case 4:
02012
02013 {
02014 Vsh_trace("Yacc","inputunit::3");
02015 global_command = (COMMAND*)VNULL;
02016 cmdKey = 2;
02017 YYACCEPT;
02018 }
02019 break;
02020
02021 case 5:
02022
02023 {
02024 Vsh_trace("Yacc","inputunit::4");
02025 global_command = (COMMAND*)VNULL;
02026 YYABORT;
02027 }
02028 break;
02029
02030 case 6:
02031
02032 {
02033 Vsh_trace("Yacc","simple_list::1");
02034 (yyval.command) = (yyvsp[(1) - (1)].command);
02035 }
02036 break;
02037
02038 case 7:
02039
02040 {
02041 Vsh_trace("Yacc","simple_list::2");
02042 (yyval.command) = (yyvsp[(1) - (2)].command);
02043 }
02044 break;
02045
02046 case 8:
02047
02048 {
02049 Vsh_trace("Yacc","simple_list::3");
02050 (yyval.command) = (yyvsp[(1) - (2)].command);
02051 }
02052 break;
02053
02054 case 9:
02055
02056 {
02057 Vsh_trace("Yacc","simple_list1::1");
02058 (yyval.command) = (yyvsp[(1) - (4)].command);
02059 }
02060 break;
02061
02062 case 10:
02063
02064 {
02065 Vsh_trace("Yacc","simple_list1::2");
02066 (yyval.command) = (yyvsp[(1) - (4)].command);
02067 }
02068 break;
02069
02070 case 11:
02071
02072 {
02073 Vsh_trace("Yacc","simple_list1::3");
02074 (yyval.command) = (yyvsp[(1) - (3)].command);
02075 }
02076 break;
02077
02078 case 12:
02079
02080 {
02081 Vsh_trace("Yacc","simple_list1::4");
02082 (yyval.command) = (yyvsp[(1) - (3)].command);
02083 }
02084 break;
02085
02086 case 13:
02087
02088 {
02089 Vsh_trace("Yacc","simple_list1::5");
02090 (yyval.command) = (yyvsp[(1) - (1)].command);
02091 }
02092 break;
02093
02094 case 14:
02095
02096 {
02097 Vsh_trace("Yacc","simple_list1::6");
02098 (yyval.command) = (yyvsp[(2) - (2)].command);
02099 }
02100 break;
02101
02102 case 15:
02103
02104 {
02105 Vsh_trace("Yacc","pipeline::1");
02106 (yyval.command) = (yyvsp[(1) - (4)].command);
02107 }
02108 break;
02109
02110 case 16:
02111
02112 {
02113 Vsh_trace("Yacc","pipeline::2");
02114 (yyval.command) = (yyvsp[(1) - (1)].command);
02115 }
02116 break;
02117
02118 case 17:
02119
02120 {
02121 Vsh_trace("Yacc","list::1");
02122 (yyval.command) = (yyvsp[(2) - (2)].command);
02123 }
02124 break;
02125
02126 case 18:
02127
02128 {
02129 Vsh_trace("Yacc","list0::1");
02130 (yyval.command) = (yyvsp[(1) - (1)].command);
02131 }
02132 break;
02133
02134 case 19:
02135
02136 {
02137 Vsh_trace("Yacc","list0::2");
02138 (yyval.command) = (yyvsp[(1) - (3)].command);
02139 }
02140 break;
02141
02142 case 20:
02143
02144 {
02145 Vsh_trace("Yacc","list0::3");
02146 (yyval.command) = (yyvsp[(1) - (3)].command);
02147 }
02148 break;
02149
02150 case 21:
02151
02152 {
02153 Vsh_trace("Yacc","list0::4");
02154 (yyval.command) = (yyvsp[(1) - (3)].command);
02155 }
02156 break;
02157
02158 case 22:
02159
02160 {
02161 Vsh_trace("Yacc","list1::1");
02162 (yyval.command) = (yyvsp[(1) - (4)].command);
02163 }
02164 break;
02165
02166 case 23:
02167
02168 {
02169 Vsh_trace("Yacc","list1::2");
02170 (yyval.command) = (yyvsp[(1) - (4)].command);
02171 }
02172 break;
02173
02174 case 24:
02175
02176 {
02177 Vsh_trace("Yacc","list1::3");
02178 (yyval.command) = (yyvsp[(1) - (4)].command);
02179 }
02180 break;
02181
02182 case 25:
02183
02184 {
02185 Vsh_trace("Yacc","list1::4");
02186 (yyval.command) = (yyvsp[(1) - (4)].command);
02187 }
02188 break;
02189
02190 case 26:
02191
02192 {
02193 Vsh_trace("Yacc","list1::5");
02194 (yyval.command) = (yyvsp[(1) - (4)].command);
02195 }
02196 break;
02197
02198 case 27:
02199
02200 {
02201 Vsh_trace("Yacc","list1::6");
02202 (yyval.command) = (yyvsp[(1) - (1)].command);
02203 }
02204 break;
02205
02206 case 28:
02207
02208 {
02209 Vsh_trace("Yacc","list1::7");
02210 (yyval.command) = (yyvsp[(2) - (2)].command);
02211 }
02212 break;
02213
02214 case 29:
02215
02216 {
02217 Vsh_trace("Yacc","redirection::1");
02218 redir.filename = (yyvsp[(2) - (2)].word);
02219 (yyval.redirect) = make_redirection(1, r_output_direction, redir);
02220 }
02221 break;
02222
02223 case 30:
02224
02225 {
02226 Vsh_trace("Yacc","redirection::2");
02227 redir.filename = (yyvsp[(2) - (2)].word);
02228 (yyval.redirect) = make_redirection(1, r_appending_to, redir);
02229 }
02230 break;
02231
02232 case 31:
02233
02234 {
02235 Vsh_trace("Yacc","redirections::1");
02236 (yyval.redirect) = (yyvsp[(1) - (1)].redirect);
02237 }
02238 break;
02239
02240 case 32:
02241
02242 {
02243 Vsh_trace("Yacc","redirections::2");
02244 (yyval.redirect) = (yyvsp[(1) - (2)].redirect);
02245 }
02246 break;
02247
02248 case 33:
02249
02250 {
02251 Vsh_trace("Yacc","command::1");
02252 (yyval.command) = clean_simple_command((yyvsp[(1) - (1)].command));
02253 }
02254 break;
02255
02256 case 34:
02257
02258 {
02259 Vsh_trace("Yacc","command::2");
02260 (yyval.command) = (yyvsp[(1) - (1)].command);
02261 }
02262 break;
02263
02264 case 35:
02265
02266 {
02267 Vsh_trace("Yacc","simple_command::1");
02268 (yyval.command) = make_simple_command((yyvsp[(1) - (1)].element),(COMMAND*)VNULL);
02269 }
02270 break;
02271
02272 case 36:
02273
02274 {
02275 Vsh_trace("Yacc","simple_command::2");
02276 (yyval.command) = make_simple_command((yyvsp[(2) - (2)].element),(yyvsp[(1) - (2)].command));
02277 }
02278 break;
02279
02280 case 37:
02281
02282 {
02283 Vsh_trace("Yacc","shell_command::1");
02284 (yyval.command) = (yyvsp[(1) - (1)].command);
02285 }
02286 break;
02287
02288 case 38:
02289
02290 {
02291 Vsh_trace("Yacc","shell_command::2");
02292 (yyval.command) = (yyvsp[(1) - (2)].command);
02293 }
02294 break;
02295
02296 case 39:
02297
02298 {
02299 Vsh_trace("Yacc","shell_command_1::1");
02300 (yyval.command) = VNULL;
02301 }
02302 break;
02303
02304 case 40:
02305
02306 {
02307 Vsh_trace("Yacc","shell_command_1::2");
02308 (yyval.command) = VNULL;
02309 }
02310 break;
02311
02312 case 41:
02313
02314 {
02315 Vsh_trace("Yacc","shell_command_1::3");
02316 (yyval.command) = VNULL;
02317 }
02318 break;
02319
02320 case 42:
02321
02322 {
02323 Vsh_trace("Yacc","shell_command_1::4");
02324 (yyval.command) = VNULL;
02325 }
02326 break;
02327
02328 case 43:
02329
02330 {
02331 Vsh_trace("Yacc","shell_command_1::5");
02332 (yyval.command) = VNULL;
02333 }
02334 break;
02335
02336 case 44:
02337
02338 {
02339 Vsh_trace("Yacc","shell_command_1::6");
02340 (yyval.command) = VNULL;
02341 }
02342 break;
02343
02344 case 45:
02345
02346 {
02347 Vsh_trace("Yacc","shell_command_1::7");
02348 (yyval.command) = VNULL;
02349 }
02350 break;
02351
02352 case 46:
02353
02354 {
02355 Vsh_trace("Yacc","shell_command_1::8");
02356 (yyval.command) = VNULL;
02357 }
02358 break;
02359
02360 case 47:
02361
02362 {
02363 Vsh_trace("Yacc","simple_command_element::1");
02364 (yyval.element).word = (yyvsp[(1) - (1)].word);
02365 (yyval.element).redirect = 0;
02366 }
02367 break;
02368
02369 case 48:
02370
02371 {
02372 Vsh_trace("Yacc","simple_command_element::2");
02373 (yyval.element).word = (yyvsp[(1) - (1)].word);
02374 (yyval.element).redirect = 0;
02375 }
02376 break;
02377
02378 case 49:
02379
02380 {
02381 Vsh_trace("Yacc","simple_command_element::3");
02382 (yyval.element).word = 0;
02383 (yyval.element).redirect = (yyvsp[(1) - (1)].redirect);
02384 }
02385 break;
02386
02387 case 50:
02388
02389 {
02390 Vsh_trace("Yacc","subshell::1");
02391 (yyval.command) = (yyvsp[(2) - (3)].command);
02392 }
02393 break;
02394
02395 case 51:
02396
02397 {
02398 Vsh_trace("Yacc","group_command::1");
02399 (yyval.command) = (yyvsp[(2) - (3)].command);
02400 }
02401 break;
02402
02403 case 52:
02404
02405 {
02406 Vsh_trace("Yacc","function_def::1");
02407 (yyval.command) = VNULL;
02408 }
02409 break;
02410
02411 case 53:
02412
02413 {
02414 Vsh_trace("Yacc","function_def::2");
02415 (yyval.command) = VNULL;
02416 }
02417 break;
02418
02419 case 54:
02420
02421 {
02422 Vsh_trace("Yacc","if_command::1");
02423 (yyval.command) = VNULL;
02424 }
02425 break;
02426
02427 case 55:
02428
02429 {
02430 Vsh_trace("Yacc","if_command::2");
02431 (yyval.command) = VNULL;
02432 }
02433 break;
02434
02435 case 56:
02436
02437 {
02438 Vsh_trace("Yacc","if_command::3");
02439 (yyval.command) = VNULL;
02440 }
02441 break;
02442
02443 case 57:
02444
02445 {
02446 Vsh_trace("Yacc","elif_clause::1");
02447 (yyval.command) = VNULL;
02448 }
02449 break;
02450
02451 case 58:
02452
02453 {
02454 Vsh_trace("Yacc","elif_clause::2");
02455 (yyval.command) = VNULL;
02456 }
02457 break;
02458
02459 case 59:
02460
02461 {
02462 Vsh_trace("Yacc","elif_clause::3");
02463 (yyval.command) = VNULL;
02464 }
02465 break;
02466
02467 case 60:
02468
02469 {
02470 Vsh_trace("Yacc","case_command::1");
02471 (yyval.command) = VNULL;
02472 }
02473 break;
02474
02475 case 61:
02476
02477 {
02478 Vsh_trace("Yacc","case_command::2");
02479 (yyval.command) = VNULL;
02480 }
02481 break;
02482
02483 case 62:
02484
02485 {
02486 Vsh_trace("Yacc","case_command::3");
02487 (yyval.command) = VNULL;
02488 }
02489 break;
02490
02491 case 63:
02492
02493 {
02494 Vsh_trace("Yacc","case_clause_1::1");
02495 (yyval.pattern) = VNULL;
02496 }
02497 break;
02498
02499 case 64:
02500
02501 {
02502 Vsh_trace("Yacc","case_clause_1::2");
02503 (yyval.pattern) = VNULL;
02504 }
02505 break;
02506
02507 case 65:
02508
02509 {
02510 Vsh_trace("Yacc","pattern_list_1::1");
02511 (yyval.pattern) = VNULL;
02512 }
02513 break;
02514
02515 case 66:
02516
02517 {
02518 Vsh_trace("Yacc","pattern_list_1::2");
02519 (yyval.pattern) = VNULL;
02520 }
02521 break;
02522
02523 case 67:
02524
02525 {
02526 Vsh_trace("Yacc","pattern_list_1::3");
02527 (yyval.pattern) = VNULL;
02528 }
02529 break;
02530
02531 case 68:
02532
02533 {
02534 Vsh_trace("Yacc","pattern_list_1::4");
02535 (yyval.pattern) = VNULL;
02536 }
02537 break;
02538
02539 case 69:
02540
02541 {
02542 Vsh_trace("Yacc","case_clause_sequence::1");
02543 (yyval.pattern) = VNULL;
02544 }
02545 break;
02546
02547 case 70:
02548
02549 {
02550 Vsh_trace("Yacc","case_clause_sequence::2");
02551 (yyval.pattern) = VNULL;
02552 }
02553 break;
02554
02555 case 71:
02556
02557 {
02558 Vsh_trace("Yacc","pattern_list::1");
02559 (yyval.pattern) = VNULL;
02560 }
02561 break;
02562
02563 case 72:
02564
02565 {
02566 Vsh_trace("Yacc","pattern_list::2");
02567 (yyval.pattern) = VNULL;
02568 }
02569 break;
02570
02571 case 73:
02572
02573 {
02574 Vsh_trace("Yacc","pattern_list::3");
02575 (yyval.pattern) = VNULL;
02576 }
02577 break;
02578
02579 case 74:
02580
02581 {
02582 Vsh_trace("Yacc","pattern_list::4");
02583 (yyval.pattern) = VNULL;
02584 }
02585 break;
02586
02587 case 75:
02588
02589 {
02590 Vsh_trace("Yacc","pattern::1");
02591 (yyval.word_list) = VNULL;
02592 }
02593 break;
02594
02595 case 76:
02596
02597 {
02598 Vsh_trace("Yacc","pattern::2");
02599 (yyval.word_list) = VNULL;
02600 }
02601 break;
02602
02603 case 77:
02604
02605 {
02606 Vsh_trace("Yacc","for_command::1");
02607 (yyval.command) = VNULL;
02608 }
02609 break;
02610
02611 case 78:
02612
02613 {
02614 Vsh_trace("Yacc","for_command::2");
02615 (yyval.command) = VNULL;
02616 }
02617 break;
02618
02619 case 79:
02620
02621 {
02622 Vsh_trace("Yacc","for_command::3");
02623 (yyval.command) = VNULL;
02624 }
02625 break;
02626
02627 case 80:
02628
02629 {
02630 Vsh_trace("Yacc","for_command::4");
02631 (yyval.command) = VNULL;
02632 }
02633 break;
02634
02635 case 81:
02636
02637 {
02638 Vsh_trace("Yacc","for_command::5");
02639 (yyval.command) = VNULL;
02640 }
02641 break;
02642
02643 case 82:
02644
02645 {
02646 Vsh_trace("Yacc","for_command::6");
02647 (yyval.command) = VNULL;
02648 }
02649 break;
02650
02651 case 83:
02652
02653 {
02654 Vsh_trace("Yacc","while_command::1");
02655 (yyval.command) = VNULL;
02656 }
02657 break;
02658
02659 case 84:
02660
02661 {
02662 Vsh_trace("Yacc","until_command::1");
02663 (yyval.command) = VNULL;
02664 }
02665 break;
02666
02667 case 85:
02668
02669 {
02670 Vsh_trace("Yacc","words::1");
02671 (yyval.word_list) = (WORD_LIST*)VNULL;
02672 }
02673 break;
02674
02675 case 86:
02676
02677 {
02678 Vsh_trace("Yacc","words::2");
02679 (yyval.word_list) = make_word_list((yyvsp[(2) - (2)].word),(yyvsp[(1) - (2)].word_list));
02680 }
02681 break;
02682
02683 case 87:
02684
02685 {
02686 Vsh_trace("Yacc","term::1");
02687 }
02688 break;
02689
02690 case 88:
02691
02692 {
02693 Vsh_trace("Yacc","term::2");
02694 }
02695 break;
02696
02697 case 89:
02698
02699 {
02700 Vsh_trace("Yacc","term::3");
02701 }
02702 break;
02703
02704 case 90:
02705
02706 {
02707 Vsh_trace("Yacc","newlines::1");
02708 }
02709 break;
02710
02711 case 91:
02712
02713 {
02714 Vsh_trace("Yacc","newlines::2");
02715 }
02716 break;
02717
02718
02719
02720
02721 default: break;
02722 }
02723 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
02724
02725 YYPOPSTACK (yylen);
02726 yylen = 0;
02727 YY_STACK_PRINT (yyss, yyssp);
02728
02729 *++yyvsp = yyval;
02730
02731
02732
02733
02734
02735
02736 yyn = yyr1[yyn];
02737
02738 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
02739 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
02740 yystate = yytable[yystate];
02741 else
02742 yystate = yydefgoto[yyn - YYNTOKENS];
02743
02744 goto yynewstate;
02745
02746
02747
02748
02749
02750 yyerrlab:
02751
02752 if (!yyerrstatus)
02753 {
02754 ++yynerrs;
02755 #if ! YYERROR_VERBOSE
02756 yyerror (YY_("syntax error"));
02757 #else
02758 {
02759 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
02760 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
02761 {
02762 YYSIZE_T yyalloc = 2 * yysize;
02763 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
02764 yyalloc = YYSTACK_ALLOC_MAXIMUM;
02765 if (yymsg != yymsgbuf)
02766 YYSTACK_FREE (yymsg);
02767 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
02768 if (yymsg)
02769 yymsg_alloc = yyalloc;
02770 else
02771 {
02772 yymsg = yymsgbuf;
02773 yymsg_alloc = sizeof yymsgbuf;
02774 }
02775 }
02776
02777 if (0 < yysize && yysize <= yymsg_alloc)
02778 {
02779 (void) yysyntax_error (yymsg, yystate, yychar);
02780 yyerror (yymsg);
02781 }
02782 else
02783 {
02784 yyerror (YY_("syntax error"));
02785 if (yysize != 0)
02786 goto yyexhaustedlab;
02787 }
02788 }
02789 #endif
02790 }
02791
02792
02793
02794 if (yyerrstatus == 3)
02795 {
02796
02797
02798
02799 if (yychar <= YYEOF)
02800 {
02801
02802 if (yychar == YYEOF)
02803 YYABORT;
02804 }
02805 else
02806 {
02807 yydestruct ("Error: discarding",
02808 yytoken, &yylval);
02809 yychar = YYEMPTY;
02810 }
02811 }
02812
02813
02814
02815 goto yyerrlab1;
02816
02817
02818
02819
02820
02821 yyerrorlab:
02822
02823
02824
02825
02826 if ( 0)
02827 goto yyerrorlab;
02828
02829
02830
02831 YYPOPSTACK (yylen);
02832 yylen = 0;
02833 YY_STACK_PRINT (yyss, yyssp);
02834 yystate = *yyssp;
02835 goto yyerrlab1;
02836
02837
02838
02839
02840
02841 yyerrlab1:
02842 yyerrstatus = 3;
02843
02844 for (;;)
02845 {
02846 yyn = yypact[yystate];
02847 if (yyn != YYPACT_NINF)
02848 {
02849 yyn += YYTERROR;
02850 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
02851 {
02852 yyn = yytable[yyn];
02853 if (0 < yyn)
02854 break;
02855 }
02856 }
02857
02858
02859 if (yyssp == yyss)
02860 YYABORT;
02861
02862
02863 yydestruct ("Error: popping",
02864 yystos[yystate], yyvsp);
02865 YYPOPSTACK (1);
02866 yystate = *yyssp;
02867 YY_STACK_PRINT (yyss, yyssp);
02868 }
02869
02870 if (yyn == YYFINAL)
02871 YYACCEPT;
02872
02873 *++yyvsp = yylval;
02874
02875
02876
02877 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
02878
02879 yystate = yyn;
02880 goto yynewstate;
02881
02882
02883
02884
02885
02886 yyacceptlab:
02887 yyresult = 0;
02888 goto yyreturn;
02889
02890
02891
02892
02893 yyabortlab:
02894 yyresult = 1;
02895 goto yyreturn;
02896
02897 #ifndef yyoverflow
02898
02899
02900
02901 yyexhaustedlab:
02902 yyerror (YY_("memory exhausted"));
02903 yyresult = 2;
02904
02905 #endif
02906
02907 yyreturn:
02908 if (yychar != YYEOF && yychar != YYEMPTY)
02909 yydestruct ("Cleanup: discarding lookahead",
02910 yytoken, &yylval);
02911
02912
02913 YYPOPSTACK (yylen);
02914 YY_STACK_PRINT (yyss, yyssp);
02915 while (yyssp != yyss)
02916 {
02917 yydestruct ("Cleanup: popping",
02918 yystos[*yyssp], yyvsp);
02919 YYPOPSTACK (1);
02920 }
02921 #ifndef yyoverflow
02922 if (yyss != yyssa)
02923 YYSTACK_FREE (yyss);
02924 #endif
02925 #if YYERROR_VERBOSE
02926 if (yymsg != yymsgbuf)
02927 YYSTACK_FREE (yymsg);
02928 #endif
02929
02930 return YYID (yyresult);
02931 }
02932
02933
02934
02935
02936
02937