Annotation of researchv10no/cmd/gre/egparen.c, revision 1.1.1.1

1.1       root        1: #include       "re.h"
                      2: #include       "lre.h"
                      3: #include       "hdr.h"
                      4: 
                      5: static int egparen(Expr *e);
                      6: 
                      7: int
                      8: re_paren(re_re *re)
                      9: {
                     10:        return egparen(re->root);
                     11: }
                     12: 
                     13: static int
                     14: egparen(Expr *e)
                     15: {
                     16:        if(e == 0)
                     17:                return(0);
                     18:        switch(e->type)
                     19:        {
                     20:        case Null:
                     21:        case Literal:
                     22:        case Dot:
                     23:        case Carat:
                     24:        case Dollar:
                     25:        case Backref:
                     26:        case Compcharclass:
                     27:        case Charclass:
                     28:                break;
                     29:        case Cat:
                     30:        case Alternate:
                     31:                return(egparen(e->l)+egparen(e->r));
                     32:        case Star:
                     33:        case Plus:
                     34:        case Quest:
                     35:        case EOP:
                     36:                return(egparen(e->l));
                     37:        case Group:
                     38:                return(1+egparen(e->l));
                     39:        }
                     40:        return(0);
                     41: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.