|
|
1.1 ! root 1: typedef struct Addr Addr; ! 2: struct Addr{ ! 3: char type; /* # (char addr), l (line addr), / ? . $ + - , ; */ ! 4: union{ ! 5: Regexp *aure; ! 6: Addr *auprev; /* left side of , and ; */ ! 7: }au; ! 8: int num; ! 9: Addr *next; /* or right side of , and ; */ ! 10: }; ! 11: #define are au.aure ! 12: #define aprev au.auprev ! 13: typedef struct Cmd Cmd; ! 14: struct Cmd{ ! 15: Addr *addr; /* address (range of text) */ ! 16: Regexp *re; /* regular expression for e.g. 'x' */ ! 17: union{ ! 18: Cmd *cucmd; /* target of x, g, {, etc. */ ! 19: String *cutext; /* text of a, c, i; rhs of s */ ! 20: Addr *cuaddr; /* address for m, t */ ! 21: }cu; ! 22: Cmd *next; /* pointer to next element in {} */ ! 23: short num; ! 24: ushort flag; /* whatever */ ! 25: ushort cmdc; /* command character; 'x' etc. */ ! 26: }; ! 27: #define ccmd cu.cucmd ! 28: #define ctext cu.cutext ! 29: #define caddr cu.cuaddr ! 30: extern struct cmdtab{ ! 31: ushort cmdc; /* command character */ ! 32: uchar text; /* takes a textual argument? */ ! 33: uchar regexp; /* takes a regular expression? */ ! 34: uchar addr; /* takes an address (m or t)? */ ! 35: uchar defcmd; /* default command; 0==>none */ ! 36: uchar defaddr; /* default address */ ! 37: uchar count; /* takes a count e.g. s2/// */ ! 38: char *token; /* takes text terminated by one of these */ ! 39: int (*fn)(); /* function to call with parse tree */ ! 40: }cmdtab[]; ! 41: enum Defaddr{ /* default addresses */ ! 42: aNo, ! 43: aDot, ! 44: aAll, ! 45: }; ! 46: extern Regexp *getregexp(); ! 47: extern Addr *newaddr();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.