[631] | 1 | /*
|
---|
| 2 | * This file was generated by mknodes.sh
|
---|
| 3 | */
|
---|
| 4 |
|
---|
| 5 | #define NSEMI 0
|
---|
| 6 | #define NCMD 1
|
---|
| 7 | #define NPIPE 2
|
---|
| 8 | #define NREDIR 3
|
---|
| 9 | #define NBACKGND 4
|
---|
| 10 | #define NSUBSHELL 5
|
---|
| 11 | #define NAND 6
|
---|
| 12 | #define NOR 7
|
---|
| 13 | #define NIF 8
|
---|
| 14 | #define NWHILE 9
|
---|
| 15 | #define NUNTIL 10
|
---|
| 16 | #define NFOR 11
|
---|
| 17 | #define NCASE 12
|
---|
| 18 | #define NCLIST 13
|
---|
| 19 | #define NDEFUN 14
|
---|
| 20 | #define NARG 15
|
---|
| 21 | #define NTO 16
|
---|
| 22 | #define NCLOBBER 17
|
---|
| 23 | #define NFROM 18
|
---|
| 24 | #define NFROMTO 19
|
---|
| 25 | #define NAPPEND 20
|
---|
| 26 | #define NTOFD 21
|
---|
| 27 | #define NFROMFD 22
|
---|
| 28 | #define NHERE 23
|
---|
| 29 | #define NXHERE 24
|
---|
| 30 | #define NNOT 25
|
---|
| 31 |
|
---|
| 32 |
|
---|
| 33 |
|
---|
| 34 | struct nbinary {
|
---|
[3458] | 35 | #ifdef KASH_SEPARATE_PARSER_ALLOCATOR
|
---|
| 36 | struct pstack_block *pblock;
|
---|
| 37 | #endif
|
---|
| 38 | int type;
|
---|
| 39 | union node *ch1;
|
---|
| 40 | union node *ch2;
|
---|
[631] | 41 | };
|
---|
| 42 |
|
---|
| 43 |
|
---|
| 44 | struct ncmd {
|
---|
[3458] | 45 | #ifdef KASH_SEPARATE_PARSER_ALLOCATOR
|
---|
| 46 | struct pstack_block *pblock;
|
---|
| 47 | #endif
|
---|
| 48 | int type;
|
---|
| 49 | int backgnd;
|
---|
| 50 | union node *args;
|
---|
| 51 | union node *redirect;
|
---|
[631] | 52 | };
|
---|
| 53 |
|
---|
| 54 |
|
---|
| 55 | struct npipe {
|
---|
[3458] | 56 | #ifdef KASH_SEPARATE_PARSER_ALLOCATOR
|
---|
| 57 | struct pstack_block *pblock;
|
---|
| 58 | #endif
|
---|
| 59 | int type;
|
---|
| 60 | int backgnd;
|
---|
| 61 | struct nodelist *cmdlist;
|
---|
[631] | 62 | };
|
---|
| 63 |
|
---|
| 64 |
|
---|
| 65 | struct nredir {
|
---|
[3458] | 66 | #ifdef KASH_SEPARATE_PARSER_ALLOCATOR
|
---|
| 67 | struct pstack_block *pblock;
|
---|
| 68 | #endif
|
---|
| 69 | int type;
|
---|
| 70 | union node *n;
|
---|
| 71 | union node *redirect;
|
---|
[631] | 72 | };
|
---|
| 73 |
|
---|
| 74 |
|
---|
| 75 | struct nif {
|
---|
[3458] | 76 | #ifdef KASH_SEPARATE_PARSER_ALLOCATOR
|
---|
| 77 | struct pstack_block *pblock;
|
---|
| 78 | #endif
|
---|
| 79 | int type;
|
---|
| 80 | union node *test;
|
---|
| 81 | union node *ifpart;
|
---|
| 82 | union node *elsepart;
|
---|
[631] | 83 | };
|
---|
| 84 |
|
---|
| 85 |
|
---|
| 86 | struct nfor {
|
---|
[3458] | 87 | #ifdef KASH_SEPARATE_PARSER_ALLOCATOR
|
---|
| 88 | struct pstack_block *pblock;
|
---|
| 89 | #endif
|
---|
| 90 | int type;
|
---|
| 91 | union node *args;
|
---|
| 92 | union node *body;
|
---|
| 93 | char *var;
|
---|
[631] | 94 | };
|
---|
| 95 |
|
---|
| 96 |
|
---|
| 97 | struct ncase {
|
---|
[3458] | 98 | #ifdef KASH_SEPARATE_PARSER_ALLOCATOR
|
---|
| 99 | struct pstack_block *pblock;
|
---|
| 100 | #endif
|
---|
| 101 | int type;
|
---|
| 102 | union node *expr;
|
---|
| 103 | union node *cases;
|
---|
[631] | 104 | };
|
---|
| 105 |
|
---|
| 106 |
|
---|
| 107 | struct nclist {
|
---|
[3458] | 108 | #ifdef KASH_SEPARATE_PARSER_ALLOCATOR
|
---|
| 109 | struct pstack_block *pblock;
|
---|
| 110 | #endif
|
---|
| 111 | int type;
|
---|
| 112 | union node *next;
|
---|
| 113 | union node *pattern;
|
---|
| 114 | union node *body;
|
---|
[631] | 115 | };
|
---|
| 116 |
|
---|
| 117 |
|
---|
| 118 | struct narg {
|
---|
[3458] | 119 | #ifdef KASH_SEPARATE_PARSER_ALLOCATOR
|
---|
| 120 | struct pstack_block *pblock;
|
---|
| 121 | #endif
|
---|
| 122 | int type;
|
---|
| 123 | union node *next;
|
---|
| 124 | char *text;
|
---|
| 125 | struct nodelist *backquote;
|
---|
[631] | 126 | };
|
---|
| 127 |
|
---|
| 128 |
|
---|
| 129 | struct nfile {
|
---|
[3458] | 130 | #ifdef KASH_SEPARATE_PARSER_ALLOCATOR
|
---|
| 131 | struct pstack_block *pblock;
|
---|
| 132 | #endif
|
---|
| 133 | int type;
|
---|
| 134 | int fd;
|
---|
| 135 | union node *next;
|
---|
| 136 | union node *fname;
|
---|
[631] | 137 | };
|
---|
| 138 |
|
---|
| 139 |
|
---|
| 140 | struct ndup {
|
---|
[3458] | 141 | #ifdef KASH_SEPARATE_PARSER_ALLOCATOR
|
---|
| 142 | struct pstack_block *pblock;
|
---|
| 143 | #endif
|
---|
| 144 | int type;
|
---|
| 145 | int fd;
|
---|
| 146 | union node *next;
|
---|
| 147 | int dupfd;
|
---|
| 148 | union node *vname;
|
---|
[631] | 149 | };
|
---|
| 150 |
|
---|
| 151 |
|
---|
| 152 | struct nhere {
|
---|
[3458] | 153 | #ifdef KASH_SEPARATE_PARSER_ALLOCATOR
|
---|
| 154 | struct pstack_block *pblock;
|
---|
| 155 | #endif
|
---|
| 156 | int type;
|
---|
| 157 | int fd;
|
---|
| 158 | union node *next;
|
---|
| 159 | union node *doc;
|
---|
[631] | 160 | };
|
---|
| 161 |
|
---|
| 162 |
|
---|
| 163 | struct nnot {
|
---|
[3458] | 164 | #ifdef KASH_SEPARATE_PARSER_ALLOCATOR
|
---|
| 165 | struct pstack_block *pblock;
|
---|
| 166 | #endif
|
---|
| 167 | int type;
|
---|
| 168 | union node *com;
|
---|
[631] | 169 | };
|
---|
| 170 |
|
---|
| 171 |
|
---|
| 172 | union node {
|
---|
[3458] | 173 | #ifdef KASH_SEPARATE_PARSER_ALLOCATOR
|
---|
| 174 | # ifdef __GNUC__
|
---|
| 175 | __extension__
|
---|
| 176 | # endif
|
---|
| 177 | struct {
|
---|
| 178 | struct pstack_block *pblock;
|
---|
| 179 | int type;
|
---|
| 180 | };
|
---|
| 181 | #else
|
---|
| 182 | int type;
|
---|
| 183 | #endif
|
---|
| 184 | struct nbinary nbinary;
|
---|
| 185 | struct ncmd ncmd;
|
---|
| 186 | struct npipe npipe;
|
---|
| 187 | struct nredir nredir;
|
---|
| 188 | struct nif nif;
|
---|
| 189 | struct nfor nfor;
|
---|
| 190 | struct ncase ncase;
|
---|
| 191 | struct nclist nclist;
|
---|
| 192 | struct narg narg;
|
---|
| 193 | struct nfile nfile;
|
---|
| 194 | struct ndup ndup;
|
---|
| 195 | struct nhere nhere;
|
---|
| 196 | struct nnot nnot;
|
---|
[631] | 197 | };
|
---|
| 198 |
|
---|
| 199 |
|
---|
| 200 | struct nodelist {
|
---|
| 201 | struct nodelist *next;
|
---|
| 202 | union node *n;
|
---|
| 203 | };
|
---|
| 204 |
|
---|
| 205 |
|
---|
[2290] | 206 | union node *copyfunc(struct shinstance *, union node *);
|
---|
| 207 | void freefunc(struct shinstance *, union node *);
|
---|