#include "../cda.h" #include "../filenames.h" /* accepts .w files as input as follows: * * * .c name type * signal pin * ... * * .i name * signal pin * ... * * .o name * signal pin * ... * * */ CHAR *filename; INT reading; /* true if reading input */ CHAR *qualifier; INT newtag; CHAR current[100]; INT level; /* used during input for macro level */ ERR badline; /* error return */ INT lslflg; INT badflg; /* set if output is useless */ INT tpflg; INT prflg; INT vpflg; /* mode definitions */ typedef struct _TAG *TAG; typedef struct _CHP *CHP; typedef struct _DEF *DEF; typedef struct _SIG *SIG; /* tree of identifiers */ struct _TAG { TAG l, r; TAG val; TAG nxt; INT flg:8; /* doubles as min pin number for type */ INT lev:8; /* doubles as max pin number for type */ CHAR tc[1]; }; #define TAGSIZ (sizeof(struct _TAG)-1) struct _CHP { TAG c_tag; CHP c_next; SIG c_sig; TAG c_type; INT c_bdp:12; INT c_bdx:4; }; /* for c_bdx */ #define HARD 1 #define SOFT 2 struct _DEF { CHP d_chips; TAG d_sig; TAG d_chp; TAG d_pin; }; struct _SIG { TAG s_tag; SIG s_next; I16 s_pinnum; TAG s_pinnam; }; CHP c_chip; CHP c_head; TAG c_type; TAG TYPES, PINS, GENTAG; TAG ESIG, LSIG; TAG LCHP; TAG g_val; #define global(s) any('/',s) #define EXTSIG(s) (global(s)?&ESIG:&LSIG) #define prs(s) prints(s) #define prc(c) printc(c) #define blank() printc(SP) #define tab() printc(TB) #define prn(n) print("%d",n) TAG gentag(); TAG *lookup(); TAG gettag(); TAG addtag(); TAG find(); TAG follow();