X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=symbol.h;fp=symbol.h;h=9ce6b175e9b9235624ff7a7c4e63f7709daa2c4b;hp=9f46ee35202610194b4a3505a49b449089f3f60e;hb=d16b8ea0ee65b2ad901ca6b0624c07e6e4930cc4;hpb=49cce96fba11282e4244187f15be418d5ae5bb8d diff --git a/symbol.h b/symbol.h index 9f46ee3..9ce6b17 100644 --- a/symbol.h +++ b/symbol.h @@ -9,10 +9,31 @@ #ifndef __SYMBOL_H__ #define __SYMBOL_H__ -#include "rmac.h" +#include -// Macros -#define NBUCKETS 256 // Number of hash buckets (power of 2) +// Line lists +struct LineList +{ + struct LineList * next; + char * line; +}; + +// Symbols +#define SYM struct _sym +SYM +{ + SYM * snext; // * -> Next symbol on hash-chain + SYM * sorder; // * -> Next sym in order of reference + SYM * sdecl; // * -> Next sym in order of declaration + uint8_t stype; // Symbol type + uint16_t sattr; // Attribute bits + uint32_t sattre; // Extended attribute bits + uint16_t senv; // Enviroment number + uint32_t svalue; // Symbol value + char * sname; // * -> Symbol's print-name + struct LineList * lineList; // * -> Macro's linked list of lines + struct LineList * last; // * -> end of macro linked list +}; // Globals, externals etc extern int curenv; @@ -20,8 +41,8 @@ extern char subttl[]; // Prototypes SYM * lookup(char *, int, int); -void init_sym(void); -SYM * newsym(char *, int, int); +void InitSymbolTable(void); +SYM * NewSymbol(char *, int, int); void sym_decl(SYM *); int syg_fix(void); int symtable(void);