Ignore:
Timestamp:
Sep 14, 2020, 11:46:32 PM (5 years ago)
Author:
bird
Message:

kash: Use reference counting of parser output in threaded-mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/generated/nodes.h

    r3449 r3458  
    3333
    3434struct nbinary {
    35       int type;
    36       union node *ch1;
    37       union node *ch2;
     35#ifdef KASH_SEPARATE_PARSER_ALLOCATOR
     36        struct pstack_block *pblock;
     37#endif
     38        int type;
     39        union node *ch1;
     40        union node *ch2;
    3841};
    3942
    4043
    4144struct ncmd {
    42       int type;
    43       int backgnd;
    44       union node *args;
    45       union node *redirect;
     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;
    4652};
    4753
    4854
    4955struct npipe {
    50       int type;
    51       int backgnd;
    52       struct nodelist *cmdlist;
     56#ifdef KASH_SEPARATE_PARSER_ALLOCATOR
     57        struct pstack_block *pblock;
     58#endif
     59        int type;
     60        int backgnd;
     61        struct nodelist *cmdlist;
    5362};
    5463
    5564
    5665struct nredir {
    57       int type;
    58       union node *n;
    59       union node *redirect;
     66#ifdef KASH_SEPARATE_PARSER_ALLOCATOR
     67        struct pstack_block *pblock;
     68#endif
     69        int type;
     70        union node *n;
     71        union node *redirect;
    6072};
    6173
    6274
    6375struct nif {
    64       int type;
    65       union node *test;
    66       union node *ifpart;
    67       union node *elsepart;
     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;
    6883};
    6984
    7085
    7186struct nfor {
    72       int type;
    73       union node *args;
    74       union node *body;
    75       char *var;
     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;
    7694};
    7795
    7896
    7997struct ncase {
    80       int type;
    81       union node *expr;
    82       union node *cases;
     98#ifdef KASH_SEPARATE_PARSER_ALLOCATOR
     99        struct pstack_block *pblock;
     100#endif
     101        int type;
     102        union node *expr;
     103        union node *cases;
    83104};
    84105
    85106
    86107struct nclist {
    87       int type;
    88       union node *next;
    89       union node *pattern;
    90       union node *body;
     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;
    91115};
    92116
    93117
    94118struct narg {
    95       int type;
    96       union node *next;
    97       char *text;
    98       struct nodelist *backquote;
     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;
    99126};
    100127
    101128
    102129struct nfile {
    103       int type;
    104       int fd;
    105       union node *next;
    106       union node *fname;
     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;
    107137};
    108138
    109139
    110140struct ndup {
    111       int type;
    112       int fd;
    113       union node *next;
    114       int dupfd;
    115       union node *vname;
     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;
    116149};
    117150
    118151
    119152struct nhere {
    120       int type;
    121       int fd;
    122       union node *next;
    123       union node *doc;
     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;
    124160};
    125161
    126162
    127163struct nnot {
    128       int type;
    129       union node *com;
     164#ifdef KASH_SEPARATE_PARSER_ALLOCATOR
     165        struct pstack_block *pblock;
     166#endif
     167        int type;
     168        union node *com;
    130169};
    131170
    132171
    133172union node {
    134       int type;
    135       struct nbinary nbinary;
    136       struct ncmd ncmd;
    137       struct npipe npipe;
    138       struct nredir nredir;
    139       struct nif nif;
    140       struct nfor nfor;
    141       struct ncase ncase;
    142       struct nclist nclist;
    143       struct narg narg;
    144       struct nfile nfile;
    145       struct ndup ndup;
    146       struct nhere nhere;
    147       struct nnot nnot;
     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;
    148197};
    149198
Note: See TracChangeset for help on using the changeset viewer.