-
Notifications
You must be signed in to change notification settings - Fork 0
/
parse.c
1117 lines (1106 loc) · 39.5 KB
/
parse.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifndef lint
static char const
yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28 2000/01/17 02:04:06 bde Exp $";
#endif
#include "rc.h"
#include <stdlib.h>
#define YYBYACC 1
#define YYMAJOR 1
#define YYMINOR 9
#define YYLEX yylex()
#define YYEMPTY -1
#define yyclearin (yychar=(YYEMPTY))
#define yyerrok (yyerrflag=0)
#define YYRECOVERING() (yyerrflag!=0)
static int yygrowstack();
#define YYPREFIX "yy"
#line 8 "parse.y"
static Node *star, *nolist;
Node *parsetree; /* not using yylval because bison declares it as an auto */
#line 26 "parse.y"
typedef union {
struct Node *node;
struct Redir redir;
struct Pipe pipe;
struct Dup dup;
struct Word word;
char *keyword;
} YYSTYPE;
#line 31 "y.tab.c"
#define YYERRCODE 256
#define ANDAND 257
#define BACKBACK 258
#define BANG 259
#define CASE 260
#define COUNT 261
#define DUP 262
#define ELSE 263
#define END 264
#define FLAT 265
#define FN 266
#define FOR 267
#define IF 268
#define IN 269
#define OROR 270
#define PIPE 271
#define REDIR 272
#define SREDIR 273
#define SUB 274
#define SUBSHELL 275
#define SWITCH 276
#define TWIDDLE 277
#define WHILE 278
#define WORD 279
#define HUH 280
const short yylhs[] = { -1,
0, 0, 22, 22, 8, 8, 13, 13, 3, 3,
9, 9, 4, 15, 2, 11, 11, 16, 16, 16,
5, 5, 6, 6, 6, 19, 19, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 24, 24, 18, 18, 18,
12, 12, 17, 17, 20, 20, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 21, 21,
14, 14, 14, 23, 23,
};
const short yylen[] = { 2,
2, 2, 1, 1, 2, 2, 1, 2, 1, 2,
1, 2, 3, 3, 3, 0, 2, 1, 2, 2,
3, 3, 1, 2, 2, 1, 4, 0, 1, 2,
4, 8, 6, 4, 8, 4, 4, 4, 4, 2,
2, 3, 3, 3, 2, 0, 1, 1, 2, 2,
1, 3, 1, 1, 1, 3, 2, 5, 2, 2,
2, 2, 3, 3, 3, 2, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 0, 2,
0, 2, 2, 0, 2,
};
const short yydefred[] = { 0,
0, 0, 0, 0, 18, 0, 79, 0, 0, 0,
0, 0, 0, 0, 0, 67, 0, 0, 81, 0,
0, 0, 0, 0, 0, 51, 0, 0, 0, 0,
3, 4, 2, 77, 75, 74, 73, 68, 71, 69,
0, 78, 72, 76, 70, 54, 53, 55, 0, 47,
0, 59, 60, 0, 0, 0, 84, 66, 0, 0,
0, 0, 0, 84, 0, 0, 0, 11, 0, 0,
62, 61, 0, 0, 30, 0, 84, 84, 84, 5,
6, 8, 0, 0, 1, 0, 50, 0, 0, 63,
64, 0, 44, 0, 0, 0, 0, 0, 0, 0,
0, 79, 13, 12, 10, 65, 82, 0, 17, 0,
0, 0, 0, 52, 56, 79, 84, 14, 85, 0,
0, 31, 84, 0, 0, 0, 0, 0, 39, 0,
0, 84, 0, 58, 84, 0, 0, 0, 0, 0,
79, 0, 0, 0, 0, 0, 0, 24, 35, 25,
22, 21,
};
const short yydgoto[] = { 21,
46, 22, 66, 23, 142, 143, 67, 68, 69, 47,
75, 27, 28, 70, 57, 29, 48, 30, 122, 94,
54, 33, 97, 51,
};
const short yysindex[] = { 874,
24, 1001, -82, 1001, 0, 1001, 0, -27, -26, 900,
1001, -82, -20, -82, -26, 0, 1001, 1134, 0, 900,
0, 1134, -203, -30, 1134, 0, -55, 24, 1134, 826,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-66, 0, 0, 0, 0, 0, 0, 0, 849, 0,
1134, 0, 0, 900, 1001, 1134, 0, 0, -52, -52,
1134, 1001, 1001, 0, -212, -58, 154, 0, 1134, 426,
0, 0, -196, 1001, 0, -203, 0, 0, 0, 0,
0, 0, 1001, 1001, 0, -196, 0, -52, 1001, 0,
0, -196, 0, -52, -38, 36, 502, -196, -36, -52,
502, 0, 0, 0, 0, 0, 0, -52, 0, 502,
502, 502, -52, 0, 0, 0, 0, 0, 0, -97,
-234, 0, 0, 1001, -234, 922, -196, -196, 0, 944,
502, 0, -9, 0, 0, -234, 502, 967, 502, -234,
0, 967, -45, 154, 967, -234, 448, 0, 0, 0,
0, 0,
};
const short yyrindex[] = { 134,
0, 0, 356, 0, 0, 0, 0, 0, 0, 0,
0, 356, 0, 1024, 0, 0, 0, 571, 0, 0,
0, 487, 529, 54, 134, 0, 62, 0, 487, 548,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
487, 0, 0, 712, 0, 142, 0, 0, 14, 38,
487, 0, 0, 0, -10, 0, -32, 0, 744, 0,
0, 0, 749, 0, 0, 529, 0, 0, 0, 0,
0, 0, 0, 0, 0, 763, 0, 86, 0, 0,
0, 779, 0, 110, 0, 0, -34, 788, 0, 380,
-34, 0, 0, 0, 0, 0, 0, 470, 0, -34,
-34, -34, 404, 0, 0, 0, 0, 0, 0, 529,
6, 0, 0, 724, 30, 0, 805, 813, 0, 0,
-34, 0, 0, 0, 0, 119, -34, 571, -34, 187,
0, 571, 0, -44, 571, 396, 0, 0, 0, 0,
0, 0,
};
const short yygindex[] = { 0,
0, 0, -23, 12, 0, -104, 1319, 2, -127, 1307,
7, 0, 57, 0, 70, -13, 84, 0, 0, 420,
-81, 59, 369, 31,
};
#define YYTABLESIZE 1464
const short yytable[] = { 57,
119, 25, 117, 28, 123, 83, 28, 81, 9, 76,
145, 50, 55, 56, 145, 26, 87, 145, 124, 62,
126, 58, 77, 19, 28, 57, 25, 57, 80, 57,
57, 71, 96, 32, 130, 78, 79, 148, 84, 34,
150, 89, 61, 26, 63, 105, 26, 20, 57, 19,
57, 19, 58, 19, 19, 89, 18, 89, 5, 147,
90, 102, 76, 7, 26, 93, 103, 34, 74, 11,
34, 48, 19, 20, 79, 20, 118, 20, 20, 149,
23, 82, 109, 57, 64, 57, 85, 52, 34, 53,
28, 0, 9, 0, 0, 49, 20, 48, 0, 48,
65, 48, 48, 72, 0, 0, 76, 0, 120, 19,
0, 0, 57, 138, 57, 0, 0, 0, 0, 80,
48, 49, 0, 49, 0, 49, 49, 0, 33, 0,
26, 0, 91, 20, 0, 0, 19, 0, 19, 0,
0, 0, 0, 28, 49, 80, 0, 80, 0, 80,
80, 28, 0, 0, 34, 0, 33, 48, 0, 33,
20, 0, 20, 104, 5, 132, 0, 114, 80, 0,
0, 28, 115, 0, 74, 11, 0, 33, 0, 28,
0, 49, 28, 0, 0, 0, 48, 0, 0, 0,
0, 81, 28, 0, 0, 0, 27, 0, 0, 0,
28, 0, 0, 0, 0, 80, 0, 0, 0, 0,
49, 0, 80, 0, 0, 0, 0, 0, 0, 0,
0, 0, 28, 0, 27, 0, 77, 27, 0, 28,
116, 0, 80, 0, 80, 28, 28, 0, 0, 78,
79, 0, 0, 33, 0, 27, 57, 57, 57, 57,
57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
57, 57, 57, 0, 57, 57, 57, 57, 57, 26,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 31, 19, 19,
19, 19, 19, 34, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 27, 20, 20, 20, 20, 20, 7, 48, 48,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
48, 48, 48, 48, 48, 0, 48, 48, 48, 48,
48, 0, 49, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 49, 49, 49, 0,
49, 49, 49, 49, 49, 46, 80, 80, 80, 80,
80, 0, 80, 80, 80, 80, 80, 80, 80, 80,
80, 80, 33, 0, 80, 80, 80, 80, 80, 79,
28, 46, 0, 46, 0, 46, 46, 28, 28, 0,
0, 0, 0, 28, 28, 32, 0, 0, 0, 0,
77, 28, 28, 15, 46, 79, 0, 79, 0, 79,
79, 49, 0, 78, 79, 0, 0, 0, 0, 59,
60, 0, 101, 32, 0, 107, 32, 0, 79, 15,
0, 15, 0, 15, 15, 110, 111, 112, 0, 88,
27, 46, 0, 0, 32, 0, 0, 151, 0, 0,
0, 17, 15, 0, 0, 19, 106, 0, 0, 0,
0, 0, 0, 0, 95, 79, 0, 0, 46, 83,
46, 99, 100, 17, 0, 131, 0, 19, 0, 108,
0, 133, 0, 59, 0, 0, 28, 0, 0, 15,
137, 0, 113, 139, 79, 83, 152, 0, 0, 83,
83, 119, 0, 0, 0, 0, 0, 0, 0, 0,
32, 20, 0, 0, 28, 0, 15, 28, 15, 0,
0, 0, 0, 0, 0, 0, 0, 17, 16, 0,
0, 19, 0, 20, 0, 28, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 29, 0, 0,
0, 0, 0, 0, 0, 83, 16, 0, 0, 16,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
28, 0, 0, 0, 0, 29, 0, 16, 29, 0,
0, 0, 0, 0, 0, 0, 0, 20, 0, 0,
0, 0, 0, 0, 0, 0, 29, 0, 28, 0,
0, 28, 46, 46, 46, 0, 46, 46, 0, 46,
46, 46, 46, 46, 18, 46, 46, 46, 46, 28,
46, 46, 46, 46, 46, 0, 79, 79, 79, 79,
79, 0, 79, 79, 79, 79, 79, 79, 79, 79,
79, 79, 0, 16, 79, 79, 79, 79, 79, 32,
15, 15, 15, 0, 15, 15, 0, 15, 15, 15,
15, 15, 29, 15, 15, 15, 15, 0, 15, 15,
15, 15, 15, 2, 34, 35, 4, 0, 36, 0,
6, 37, 38, 39, 40, 28, 0, 41, 0, 0,
42, 43, 44, 45, 16, 2, 34, 35, 4, 0,
36, 0, 6, 37, 38, 39, 40, 0, 0, 41,
0, 45, 42, 43, 44, 45, 16, 83, 83, 83,
83, 0, 83, 36, 83, 83, 83, 83, 83, 0,
0, 83, 0, 28, 83, 83, 83, 83, 83, 45,
28, 0, 45, 28, 0, 0, 28, 28, 41, 2,
3, 36, 4, 5, 36, 0, 6, 7, 8, 9,
45, 0, 40, 10, 11, 0, 12, 13, 14, 15,
16, 28, 36, 0, 28, 16, 41, 0, 42, 41,
0, 0, 16, 0, 0, 0, 0, 43, 16, 16,
40, 0, 28, 40, 29, 0, 0, 41, 0, 0,
0, 29, 0, 0, 37, 0, 42, 29, 29, 42,
0, 40, 38, 0, 0, 43, 0, 28, 43, 0,
0, 0, 0, 0, 0, 0, 45, 42, 0, 0,
28, 28, 37, 0, 0, 37, 43, 0, 36, 0,
38, 0, 0, 38, 0, 0, 0, 0, 0, 0,
0, 17, 0, 37, 0, 19, 0, 0, 28, 0,
0, 38, 0, 41, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 17, 0, 0, 40, 19, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 42, 0, 0, 0, 0, 0, 17,
0, 0, 43, 19, 0, 0, 0, 0, 0, 0,
0, 20, 0, 0, 0, 0, 0, 0, 0, 37,
0, 0, 0, 0, 0, 17, 0, 38, 0, 19,
0, 0, 89, 0, 20, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 17, 0, 0,
0, 19, 134, 0, 0, 0, 0, 0, 45, 20,
0, 18, 0, 0, 0, 45, 0, 0, 0, 17,
36, 45, 45, 19, 135, 0, 0, 36, 0, 0,
0, 0, 0, 36, 36, 20, 18, 0, 0, 0,
28, 0, 17, 0, 0, 41, 19, 0, 0, 0,
0, 0, 41, 28, 28, 0, 0, 20, 41, 40,
0, 0, 18, 0, 0, 0, 40, 0, 0, 0,
0, 0, 40, 0, 0, 42, 17, 0, 0, 20,
19, 0, 42, 0, 43, 0, 0, 0, 42, 0,
0, 43, 0, 0, 0, 0, 0, 43, 0, 46,
0, 37, 20, 46, 0, 0, 0, 0, 37, 38,
0, 0, 0, 0, 37, 0, 38, 0, 0, 0,
0, 0, 38, 2, 34, 35, 4, 5, 36, 18,
6, 37, 38, 39, 40, 0, 20, 10, 11, 0,
42, 43, 44, 45, 16, 0, 2, 34, 35, 4,
0, 36, 0, 6, 37, 38, 39, 40, 0, 46,
41, 0, 0, 42, 43, 44, 45, 16, 0, 1,
0, 2, 3, 0, 4, 5, 0, 0, 6, 7,
8, 9, 0, 0, 0, 10, 11, 0, 12, 13,
14, 15, 16, 0, 0, 0, 0, 2, 34, 35,
4, 0, 36, 0, 6, 37, 38, 39, 40, 17,
0, 41, 0, 19, 42, 43, 44, 45, 16, 2,
34, 35, 4, 0, 36, 0, 6, 37, 38, 39,
40, 0, 0, 41, 0, 0, 42, 43, 44, 45,
16, 2, 34, 35, 4, 0, 36, 0, 6, 37,
38, 39, 40, 0, 0, 41, 0, 0, 42, 43,
44, 45, 16, 0, 2, 3, 141, 4, 5, 20,
0, 6, 7, 8, 9, 0, 0, 0, 10, 11,
0, 12, 13, 14, 15, 16, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 18, 0, 2, 34,
35, 4, 0, 36, 0, 6, 37, 38, 39, 40,
0, 0, 41, 0, 0, 42, 43, 44, 45, 16,
0, 46, 46, 46, 46, 0, 46, 0, 46, 46,
46, 46, 46, 0, 0, 46, 0, 0, 46, 46,
46, 46, 46, 0, 0, 0, 26, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 24, 0,
0, 0, 0, 0, 26, 0, 0, 0, 26, 0,
0, 26, 0, 0, 0, 26, 0, 0, 0, 0,
73, 0, 0, 24, 0, 0, 0, 86, 0, 0,
0, 0, 0, 0, 0, 0, 0, 26, 0, 0,
0, 0, 26, 0, 0, 0, 0, 26, 0, 92,
0, 0, 0, 0, 0, 26, 0, 0, 0, 98,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 2, 3, 0, 4, 5, 0, 0, 6, 7,
8, 9, 0, 26, 0, 10, 11, 26, 12, 13,
14, 15, 16, 0, 0, 121, 26, 26, 26, 125,
0, 0, 0, 0, 0, 0, 0, 0, 127, 128,
129, 0, 0, 0, 0, 0, 0, 26, 0, 0,
0, 0, 0, 26, 26, 26, 0, 0, 26, 136,
0, 26, 0, 0, 0, 140, 144, 146, 0, 0,
144, 0, 0, 144,
};
const short yycheck[] = { 10,
10, 0, 41, 38, 41, 61, 41, 38, 41, 23,
138, 94, 40, 40, 142, 10, 30, 145, 100, 40,
102, 10, 257, 10, 59, 36, 25, 38, 59, 40,
41, 20, 56, 10, 116, 270, 271, 142, 94, 10,
145, 94, 12, 38, 14, 69, 41, 10, 59, 36,
61, 38, 41, 40, 41, 94, 123, 94, 262, 141,
49, 274, 76, 10, 59, 54, 125, 38, 272, 273,
41, 10, 59, 36, 271, 38, 41, 40, 41, 125,
125, 25, 76, 94, 15, 96, 28, 4, 59, 6,
125, -1, 125, -1, -1, 10, 59, 36, -1, 38,
17, 40, 41, 20, -1, -1, 120, -1, 97, 96,
-1, -1, 123, 123, 125, -1, -1, -1, -1, 10,
59, 36, -1, 38, -1, 40, 41, -1, 10, -1,
125, -1, 49, 96, -1, -1, 123, -1, 125, -1,
-1, -1, -1, 10, 59, 36, -1, 38, -1, 40,
41, 10, -1, -1, 125, -1, 38, 96, -1, 41,
123, -1, 125, 10, 262, 263, -1, 84, 59, -1,
-1, 38, 89, -1, 272, 273, -1, 59, -1, 38,
-1, 96, 41, -1, -1, -1, 125, -1, -1, -1,
-1, 38, 59, -1, -1, -1, 10, -1, -1, -1,
59, -1, -1, -1, -1, 96, -1, -1, -1, -1,
125, -1, 59, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 257, -1, 38, -1, 257, 41, -1, 264,
269, -1, 123, -1, 125, 270, 271, -1, -1, 270,
271, -1, -1, 125, -1, 59, 257, 258, 259, 260,
261, 262, 263, 264, 265, 266, 267, 268, 269, 270,
271, 272, 273, -1, 275, 276, 277, 278, 279, 264,
257, 258, 259, 260, 261, 262, 263, 264, 265, 266,
267, 268, 269, 270, 271, 272, 273, 264, 275, 276,
277, 278, 279, 264, 257, 258, 259, 260, 261, 262,
263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
273, 125, 275, 276, 277, 278, 279, 264, 257, 258,
259, 260, 261, 262, 263, 264, 265, 266, 267, 268,
269, 270, 271, 272, 273, -1, 275, 276, 277, 278,
279, -1, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, -1,
275, 276, 277, 278, 279, 10, 257, 258, 259, 260,
261, -1, 263, 264, 265, 266, 267, 268, 269, 270,
271, 272, 264, -1, 275, 276, 277, 278, 279, 10,
257, 36, -1, 38, -1, 40, 41, 264, 257, -1,
-1, -1, -1, 270, 271, 10, -1, -1, -1, -1,
257, 270, 271, 10, 59, 36, -1, 38, -1, 40,
41, 2, -1, 270, 271, -1, -1, -1, -1, 10,
11, -1, 64, 38, -1, 10, 41, -1, 59, 36,
-1, 38, -1, 40, 41, 77, 78, 79, -1, 30,
264, 96, -1, -1, 59, -1, -1, 10, -1, -1,
-1, 36, 59, -1, -1, 40, 41, -1, -1, -1,
-1, -1, -1, -1, 55, 96, -1, -1, 123, 10,
125, 62, 63, 36, -1, 117, -1, 40, -1, 70,
-1, 123, -1, 74, -1, -1, 10, -1, -1, 96,
132, -1, 83, 135, 125, 36, 59, -1, -1, 40,
41, 10, -1, -1, -1, -1, -1, -1, -1, -1,
125, 96, -1, -1, 38, -1, 123, 41, 125, -1,
-1, -1, -1, -1, -1, -1, -1, 36, 10, -1,
-1, 40, -1, 96, -1, 59, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 10, -1, -1,
-1, -1, -1, -1, -1, 96, 38, -1, -1, 41,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
10, -1, -1, -1, -1, 38, -1, 59, 41, -1,
-1, -1, -1, -1, -1, -1, -1, 96, -1, -1,
-1, -1, -1, -1, -1, -1, 59, -1, 38, -1,
-1, 125, 257, 258, 259, -1, 261, 262, -1, 264,
265, 266, 267, 268, 123, 270, 271, 272, 273, 59,
275, 276, 277, 278, 279, -1, 257, 258, 259, 260,
261, -1, 263, 264, 265, 266, 267, 268, 269, 270,
271, 272, -1, 125, 275, 276, 277, 278, 279, 264,
257, 258, 259, -1, 261, 262, -1, 264, 265, 266,
267, 268, 125, 270, 271, 272, 273, -1, 275, 276,
277, 278, 279, 258, 259, 260, 261, -1, 263, -1,
265, 266, 267, 268, 269, 125, -1, 272, -1, -1,
275, 276, 277, 278, 279, 258, 259, 260, 261, -1,
263, -1, 265, 266, 267, 268, 269, -1, -1, 272,
-1, 10, 275, 276, 277, 278, 279, 258, 259, 260,
261, -1, 263, 10, 265, 266, 267, 268, 269, -1,
-1, 272, -1, 257, 275, 276, 277, 278, 279, 38,
264, -1, 41, 10, -1, -1, 270, 271, 10, 258,
259, 38, 261, 262, 41, -1, 265, 266, 267, 268,
59, -1, 10, 272, 273, -1, 275, 276, 277, 278,
279, 38, 59, -1, 41, 257, 38, -1, 10, 41,
-1, -1, 264, -1, -1, -1, -1, 10, 270, 271,
38, -1, 59, 41, 257, -1, -1, 59, -1, -1,
-1, 264, -1, -1, 10, -1, 38, 270, 271, 41,
-1, 59, 10, -1, -1, 38, -1, 257, 41, -1,
-1, -1, -1, -1, -1, -1, 125, 59, -1, -1,
270, 271, 38, -1, -1, 41, 59, -1, 125, -1,
38, -1, -1, 41, -1, -1, -1, -1, -1, -1,
-1, 36, -1, 59, -1, 40, -1, -1, 125, -1,
-1, 59, -1, 125, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 36, -1, -1, 125, 40, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 125, -1, -1, -1, -1, -1, 36,
-1, -1, 125, 40, -1, -1, -1, -1, -1, -1,
-1, 96, -1, -1, -1, -1, -1, -1, -1, 125,
-1, -1, -1, -1, -1, 36, -1, 125, -1, 40,
-1, -1, 94, -1, 96, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 36, -1, -1,
-1, 40, 41, -1, -1, -1, -1, -1, 257, 96,
-1, 123, -1, -1, -1, 264, -1, -1, -1, 36,
257, 270, 271, 40, 41, -1, -1, 264, -1, -1,
-1, -1, -1, 270, 271, 96, 123, -1, -1, -1,
257, -1, 36, -1, -1, 257, 40, -1, -1, -1,
-1, -1, 264, 270, 271, -1, -1, 96, 270, 257,
-1, -1, 123, -1, -1, -1, 264, -1, -1, -1,
-1, -1, 270, -1, -1, 257, 36, -1, -1, 96,
40, -1, 264, -1, 257, -1, -1, -1, 270, -1,
-1, 264, -1, -1, -1, -1, -1, 270, -1, 36,
-1, 257, 96, 40, -1, -1, -1, -1, 264, 257,
-1, -1, -1, -1, 270, -1, 264, -1, -1, -1,
-1, -1, 270, 258, 259, 260, 261, 262, 263, 123,
265, 266, 267, 268, 269, -1, 96, 272, 273, -1,
275, 276, 277, 278, 279, -1, 258, 259, 260, 261,
-1, 263, -1, 265, 266, 267, 268, 269, -1, 96,
272, -1, -1, 275, 276, 277, 278, 279, -1, 256,
-1, 258, 259, -1, 261, 262, -1, -1, 265, 266,
267, 268, -1, -1, -1, 272, 273, -1, 275, 276,
277, 278, 279, -1, -1, -1, -1, 258, 259, 260,
261, -1, 263, -1, 265, 266, 267, 268, 269, 36,
-1, 272, -1, 40, 275, 276, 277, 278, 279, 258,
259, 260, 261, -1, 263, -1, 265, 266, 267, 268,
269, -1, -1, 272, -1, -1, 275, 276, 277, 278,
279, 258, 259, 260, 261, -1, 263, -1, 265, 266,
267, 268, 269, -1, -1, 272, -1, -1, 275, 276,
277, 278, 279, -1, 258, 259, 260, 261, 262, 96,
-1, 265, 266, 267, 268, -1, -1, -1, 272, 273,
-1, 275, 276, 277, 278, 279, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 123, -1, 258, 259,
260, 261, -1, 263, -1, 265, 266, 267, 268, 269,
-1, -1, 272, -1, -1, 275, 276, 277, 278, 279,
-1, 258, 259, 260, 261, -1, 263, -1, 265, 266,
267, 268, 269, -1, -1, 272, -1, -1, 275, 276,
277, 278, 279, -1, -1, -1, 0, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 0, -1,
-1, -1, -1, -1, 18, -1, -1, -1, 22, -1,
-1, 25, -1, -1, -1, 29, -1, -1, -1, -1,
22, -1, -1, 25, -1, -1, -1, 29, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 51, -1, -1,
-1, -1, 56, -1, -1, -1, -1, 61, -1, 51,
-1, -1, -1, -1, -1, 69, -1, -1, -1, 61,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 258, 259, -1, 261, 262, -1, -1, 265, 266,
267, 268, -1, 97, -1, 272, 273, 101, 275, 276,
277, 278, 279, -1, -1, 97, 110, 111, 112, 101,
-1, -1, -1, -1, -1, -1, -1, -1, 110, 111,
112, -1, -1, -1, -1, -1, -1, 131, -1, -1,
-1, -1, -1, 137, 138, 139, -1, -1, 142, 131,
-1, 145, -1, -1, -1, 137, 138, 139, -1, -1,
142, -1, -1, 145,
};
#define YYFINAL 21
#ifndef YYDEBUG
#define YYDEBUG 0
#endif
#define YYMAXTOKEN 280
#if YYDEBUG
const char * const yyname[] = {
"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,"'$'",0,"'&'",0,"'('","')'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"';'",0,
"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'^'",0,
"'`'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'{'",0,"'}'",0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,"ANDAND","BACKBACK","BANG","CASE","COUNT","DUP","ELSE","END",
"FLAT","FN","FOR","IF","IN","OROR","PIPE","REDIR","SREDIR","SUB","SUBSHELL",
"SWITCH","TWIDDLE","WHILE","WORD","HUH",
};
const char * const yyrule[] = {
"$accept : rc",
"rc : line end",
"rc : error end",
"end : END",
"end : '\\n'",
"cmdsa : cmd ';'",
"cmdsa : cmd '&'",
"line : cmd",
"line : cmdsa line",
"body : cmd",
"body : cmdsan body",
"cmdsan : cmdsa",
"cmdsan : cmd '\\n'",
"brace : '{' body '}'",
"paren : '(' body ')'",
"assign : first '=' word",
"epilog :",
"epilog : redir epilog",
"redir : DUP",
"redir : REDIR word",
"redir : SREDIR word",
"case : CASE words ';'",
"case : CASE words '\\n'",
"cbody : cmd",
"cbody : case cbody",
"cbody : cmdsan cbody",
"iftail : cmd",
"iftail : brace ELSE optnl cmd",
"cmd :",
"cmd : simple",
"cmd : brace epilog",
"cmd : IF paren optnl iftail",
"cmd : FOR '(' word IN words ')' optnl cmd",
"cmd : FOR '(' word ')' optnl cmd",
"cmd : WHILE paren optnl cmd",
"cmd : SWITCH '(' word ')' optnl '{' cbody '}'",
"cmd : TWIDDLE optcaret word words",
"cmd : cmd ANDAND optnl cmd",
"cmd : cmd OROR optnl cmd",
"cmd : cmd PIPE optnl cmd",
"cmd : redir cmd",
"cmd : assign cmd",
"cmd : BANG optcaret cmd",
"cmd : SUBSHELL optcaret cmd",
"cmd : FN words brace",
"cmd : FN words",
"optcaret :",
"optcaret : '^'",
"simple : first",
"simple : simple word",
"simple : simple redir",
"first : comword",
"first : first '^' sword",
"sword : comword",
"sword : keyword",
"word : sword",
"word : word '^' sword",
"comword : '$' sword",
"comword : '$' sword SUB words ')'",
"comword : COUNT sword",
"comword : FLAT sword",
"comword : '`' sword",
"comword : '`' brace",
"comword : BACKBACK word brace",
"comword : BACKBACK word sword",
"comword : '(' nlwords ')'",
"comword : REDIR brace",
"comword : WORD",
"keyword : FOR",
"keyword : IN",
"keyword : WHILE",
"keyword : IF",
"keyword : SWITCH",
"keyword : FN",
"keyword : ELSE",
"keyword : CASE",
"keyword : TWIDDLE",
"keyword : BANG",
"keyword : SUBSHELL",
"words :",
"words : words word",
"nlwords :",
"nlwords : nlwords '\\n'",
"nlwords : nlwords word",
"optnl :",
"optnl : optnl '\\n'",
};
#endif
#if YYDEBUG
#include <stdio.h>
#endif
#ifdef YYSTACKSIZE
#undef YYMAXDEPTH
#define YYMAXDEPTH YYSTACKSIZE
#else
#ifdef YYMAXDEPTH
#define YYSTACKSIZE YYMAXDEPTH
#else
#define YYSTACKSIZE 10000
#define YYMAXDEPTH 10000
#endif
#endif
#define YYINITSTACKSIZE 200
int yydebug;
int yynerrs;
int yyerrflag;
int yychar;
short *yyssp;
YYSTYPE *yyvsp;
YYSTYPE yyval;
YYSTYPE yylval;
short *yyss;
short *yysslim;
YYSTYPE *yyvs;
int yystacksize;
#line 167 "parse.y"
void initparse() {
star = treecpy(mk(nVar, mk(nWord,"*", NULL, FALSE)), ealloc);
nolist = treecpy(mk(nVar, mk(nWord,"ifs", NULL, FALSE)), ealloc);
}
#line 583 "y.tab.c"
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
static int yygrowstack()
{
int newsize, i;
short *newss;
YYSTYPE *newvs;
if ((newsize = yystacksize) == 0)
newsize = YYINITSTACKSIZE;
else if (newsize >= YYMAXDEPTH)
return -1;
else if ((newsize *= 2) > YYMAXDEPTH)
newsize = YYMAXDEPTH;
i = yyssp - yyss;
newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) :
(short *)malloc(newsize * sizeof *newss);
if (newss == NULL)
return -1;
yyss = newss;
yyssp = newss + i;
newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) :
(YYSTYPE *)malloc(newsize * sizeof *newvs);
if (newvs == NULL)
return -1;
yyvs = newvs;
yyvsp = newvs + i;
yystacksize = newsize;
yysslim = yyss + newsize - 1;
return 0;
}
#define YYABORT goto yyabort
#define YYREJECT goto yyabort
#define YYACCEPT goto yyaccept
#define YYERROR goto yyerrlab
#ifndef YYPARSE_PARAM
#if defined(__cplusplus) || __STDC__
#define YYPARSE_PARAM_ARG void
#define YYPARSE_PARAM_DECL
#else /* ! ANSI-C/C++ */
#define YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_DECL
#endif /* ANSI-C/C++ */
#else /* YYPARSE_PARAM */
#ifndef YYPARSE_PARAM_TYPE
#define YYPARSE_PARAM_TYPE void *
#endif
#if defined(__cplusplus) || __STDC__
#define YYPARSE_PARAM_ARG YYPARSE_PARAM_TYPE YYPARSE_PARAM
#define YYPARSE_PARAM_DECL
#else /* ! ANSI-C/C++ */
#define YYPARSE_PARAM_ARG YYPARSE_PARAM
#define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM;
#endif /* ANSI-C/C++ */
#endif /* ! YYPARSE_PARAM */
int
yyparse (YYPARSE_PARAM_ARG)
YYPARSE_PARAM_DECL
{
register int yym, yyn, yystate;
#if YYDEBUG
register const char *yys;
if ((yys = getenv("YYDEBUG")))
{
yyn = *yys;
if (yyn >= '0' && yyn <= '9')
yydebug = yyn - '0';
}
#endif
yynerrs = 0;
yyerrflag = 0;
yychar = (-1);
if (yyss == NULL && yygrowstack()) goto yyoverflow;
yyssp = yyss;
yyvsp = yyvs;
*yyssp = yystate = 0;
yyloop:
if ((yyn = yydefred[yystate])) goto yyreduce;
if (yychar < 0)
{
if ((yychar = yylex()) < 0) yychar = 0;
#if YYDEBUG
if (yydebug)
{
yys = 0;
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
if (!yys) yys = "illegal-symbol";
printf("%sdebug: state %d, reading %d (%s)\n",
YYPREFIX, yystate, yychar, yys);
}
#endif
}
if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
{
#if YYDEBUG
if (yydebug)
printf("%sdebug: state %d, shifting to state %d\n",
YYPREFIX, yystate, yytable[yyn]);
#endif
if (yyssp >= yysslim && yygrowstack())
{
goto yyoverflow;
}
*++yyssp = yystate = yytable[yyn];
*++yyvsp = yylval;
yychar = (-1);
if (yyerrflag > 0) --yyerrflag;
goto yyloop;
}
if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
{
yyn = yytable[yyn];
goto yyreduce;
}
if (yyerrflag) goto yyinrecovery;
#if defined(lint) || defined(__GNUC__)
goto yynewerror;
#endif
yynewerror:
yyerror("syntax error");
#if defined(lint) || defined(__GNUC__)
goto yyerrlab;
#endif
yyerrlab:
++yynerrs;
yyinrecovery:
if (yyerrflag < 3)
{
yyerrflag = 3;
for (;;)
{
if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
{
#if YYDEBUG
if (yydebug)
printf("%sdebug: state %d, error recovery shifting\
to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
#endif
if (yyssp >= yysslim && yygrowstack())
{
goto yyoverflow;
}
*++yyssp = yystate = yytable[yyn];
*++yyvsp = yylval;
goto yyloop;
}
else
{
#if YYDEBUG
if (yydebug)
printf("%sdebug: error recovery discarding state %d\n",
YYPREFIX, *yyssp);
#endif
if (yyssp <= yyss) goto yyabort;
--yyssp;
--yyvsp;
}
}
}
else
{
if (yychar == 0) goto yyabort;
#if YYDEBUG
if (yydebug)
{
yys = 0;
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
if (!yys) yys = "illegal-symbol";
printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
YYPREFIX, yystate, yychar, yys);
}
#endif
yychar = (-1);
goto yyloop;
}
yyreduce:
#if YYDEBUG
if (yydebug)
printf("%sdebug: state %d, reducing by rule %d (%s)\n",
YYPREFIX, yystate, yyn, yyrule[yyn]);
#endif
yym = yylen[yyn];
yyval = yyvsp[1-yym];
switch (yyn)
{
case 1:
#line 47 "parse.y"
{ parsetree = yyvsp[-1].node; YYACCEPT; }
break;
case 2:
#line 48 "parse.y"
{ yyerrok; parsetree = NULL; YYABORT; }
break;
case 3:
#line 51 "parse.y"
{ if (!heredoc(1)) YYABORT; }
break;
case 4:
#line 52 "parse.y"
{ if (!heredoc(0)) YYABORT; }
break;
case 6:
#line 56 "parse.y"
{ yyval.node = (yyvsp[-1].node != NULL ? mk(nNowait,yyvsp[-1].node) : yyvsp[-1].node); }
break;
case 8:
#line 60 "parse.y"
{ yyval.node = (yyvsp[-1].node != NULL ? mk(nBody,yyvsp[-1].node,yyvsp[0].node) : yyvsp[0].node); }
break;
case 10:
#line 64 "parse.y"
{ yyval.node = (yyvsp[-1].node == NULL ? yyvsp[0].node : yyvsp[0].node == NULL ? yyvsp[-1].node : mk(nBody,yyvsp[-1].node,yyvsp[0].node)); }
break;
case 12:
#line 67 "parse.y"
{ yyval.node = yyvsp[-1].node; if (!heredoc(0)) YYABORT; }
break;
case 13:
#line 69 "parse.y"
{ yyval.node = yyvsp[-1].node; }
break;
case 14:
#line 71 "parse.y"
{ yyval.node = yyvsp[-1].node; }
break;
case 15:
#line 73 "parse.y"
{ yyval.node = mk(nAssign,yyvsp[-2].node,yyvsp[0].node); }
break;
case 16:
#line 75 "parse.y"
{ yyval.node = NULL; }
break;
case 17:
#line 76 "parse.y"
{ yyval.node = mk(nEpilog,yyvsp[-1].node,yyvsp[0].node); }
break;
case 18:
#line 79 "parse.y"
{ yyval.node = mk(nDup,yyvsp[0].dup.type,yyvsp[0].dup.left,yyvsp[0].dup.right); }
break;
case 19:
#line 80 "parse.y"
{ yyval.node = mk(nRedir,yyvsp[-1].redir.type,yyvsp[-1].redir.fd,yyvsp[0].node);
if (yyvsp[-1].redir.type == rHeredoc && !qdoc(yyvsp[0].node, yyval.node)) YYABORT; /* queue heredocs up */
}
break;
case 20:
#line 83 "parse.y"
{ yyval.node = mk(nRedir,yyvsp[-1].redir.type,yyvsp[-1].redir.fd,yyvsp[0].node);
if (yyvsp[-1].redir.type == rHeredoc && !qdoc(yyvsp[0].node, yyval.node)) YYABORT; /* queue heredocs up */
}
break;
case 21:
#line 87 "parse.y"
{ yyval.node = mk(nCase, yyvsp[-1].node); }
break;
case 22:
#line 88 "parse.y"
{ yyval.node = mk(nCase, yyvsp[-1].node); }
break;
case 23:
#line 90 "parse.y"
{ yyval.node = mk(nCbody, yyvsp[0].node, NULL); }
break;
case 24:
#line 91 "parse.y"
{ yyval.node = mk(nCbody, yyvsp[-1].node, yyvsp[0].node); }
break;
case 25:
#line 92 "parse.y"
{ yyval.node = mk(nCbody, yyvsp[-1].node, yyvsp[0].node); }
break;
case 27:
#line 95 "parse.y"
{ yyval.node = mk(nElse,yyvsp[-3].node,yyvsp[0].node); }
break;
case 28:
#line 97 "parse.y"
{ yyval.node = NULL; }
break;
case 30:
#line 99 "parse.y"
{ yyval.node = mk(nBrace,yyvsp[-1].node,yyvsp[0].node); }
break;
case 31:
#line 100 "parse.y"
{ yyval.node = mk(nIf,yyvsp[-2].node,yyvsp[0].node); }
break;
case 32:
#line 101 "parse.y"
{ yyval.node = mk(nForin,yyvsp[-5].node,yyvsp[-3].node,yyvsp[0].node); }
break;
case 33:
#line 102 "parse.y"
{ yyval.node = mk(nForin,yyvsp[-3].node,star,yyvsp[0].node); }
break;
case 34:
#line 103 "parse.y"
{ yyval.node = mk(nWhile,yyvsp[-2].node,yyvsp[0].node); }
break;
case 35:
#line 104 "parse.y"
{ yyval.node = mk(nSwitch,yyvsp[-5].node,yyvsp[-1].node); }
break;
case 36:
#line 105 "parse.y"
{ yyval.node = mk(nMatch,yyvsp[-1].node,yyvsp[0].node); }
break;
case 37:
#line 106 "parse.y"
{ yyval.node = mk(nAndalso,yyvsp[-3].node,yyvsp[0].node); }
break;
case 38:
#line 107 "parse.y"
{ yyval.node = mk(nOrelse,yyvsp[-3].node,yyvsp[0].node); }
break;
case 39:
#line 108 "parse.y"
{ yyval.node = mk(nPipe,yyvsp[-2].pipe.left,yyvsp[-2].pipe.right,yyvsp[-3].node,yyvsp[0].node); }
break;
case 40:
#line 109 "parse.y"
{ yyval.node = (yyvsp[0].node != NULL ? mk(nPre,yyvsp[-1].node,yyvsp[0].node) : yyvsp[-1].node); }
break;
case 41:
#line 110 "parse.y"
{ yyval.node = (yyvsp[0].node != NULL ? mk(nPre,yyvsp[-1].node,yyvsp[0].node) : yyvsp[-1].node); }
break;
case 42:
#line 111 "parse.y"
{ yyval.node = mk(nBang,yyvsp[0].node); }
break;
case 43:
#line 112 "parse.y"
{ yyval.node = mk(nSubshell,yyvsp[0].node); }
break;
case 44:
#line 113 "parse.y"
{ yyval.node = mk(nNewfn,yyvsp[-1].node,yyvsp[0].node); }
break;
case 45:
#line 114 "parse.y"
{ yyval.node = mk(nRmfn,yyvsp[0].node); }
break;
case 49:
#line 120 "parse.y"
{ yyval.node = (yyvsp[0].node != NULL ? mk(nArgs,yyvsp[-1].node,yyvsp[0].node) : yyvsp[-1].node); }
break;
case 50:
#line 121 "parse.y"
{ yyval.node = mk(nArgs,yyvsp[-1].node,yyvsp[0].node); }
break;
case 52:
#line 124 "parse.y"
{ yyval.node = mk(nConcat,yyvsp[-2].node,yyvsp[0].node); }
break;
case 54:
#line 127 "parse.y"
{ yyval.node = mk(nWord, yyvsp[0].keyword, NULL, FALSE); }
break;
case 56:
#line 130 "parse.y"
{ yyval.node = mk(nConcat,yyvsp[-2].node,yyvsp[0].node); }
break;
case 57:
#line 132 "parse.y"
{ yyval.node = mk(nVar,yyvsp[0].node); }
break;
case 58:
#line 133 "parse.y"
{ yyval.node = mk(nVarsub,yyvsp[-3].node,yyvsp[-1].node); }
break;
case 59:
#line 134 "parse.y"
{ yyval.node = mk(nCount,yyvsp[0].node); }
break;
case 60:
#line 135 "parse.y"
{ yyval.node = mk(nFlat, yyvsp[0].node); }
break;
case 61:
#line 136 "parse.y"
{ yyval.node = mk(nBackq,nolist,yyvsp[0].node); }
break;
case 62:
#line 137 "parse.y"
{ yyval.node = mk(nBackq,nolist,yyvsp[0].node); }
break;
case 63:
#line 138 "parse.y"
{ yyval.node = mk(nBackq,yyvsp[-1].node,yyvsp[0].node); }
break;
case 64:
#line 139 "parse.y"
{ yyval.node = mk(nBackq,yyvsp[-1].node,yyvsp[0].node); }
break;
case 65:
#line 140 "parse.y"
{ yyval.node = yyvsp[-1].node; }
break;
case 66:
#line 141 "parse.y"
{ yyval.node = mk(nNmpipe,yyvsp[-1].redir.type,yyvsp[-1].redir.fd,yyvsp[0].node); }
break;
case 67:
#line 142 "parse.y"
{ yyval.node = mk(nWord, yyvsp[0].word.w, yyvsp[0].word.m, yyvsp[0].word.q); }
break;