X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=symbol.h;h=e183b432d5a50ad861726d1c94af38d2574893a1;hp=9da084326d85694cbc4de3396288cddb738dc6a8;hb=062214e62031c26d372edc2e68473ebb64f6a506;hpb=3385b366632d03745033fa6b19faabf60219bc6b diff --git a/symbol.h b/symbol.h index 9da0843..e183b43 100644 --- a/symbol.h +++ b/symbol.h @@ -9,10 +9,32 @@ #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 + uint32_t uid; // Symbol's unique ID +}; // Globals, externals etc extern int curenv; @@ -20,12 +42,12 @@ extern char subttl[]; // Prototypes SYM * lookup(char *, int, int); -void init_sym(void); -SYM * newsym(char *, int, int); -char * nstring(char *); -void sym_decl(SYM *); +void InitSymbolTable(void); +SYM * NewSymbol(char *, int, int); +void AddToSymbolOrderList(SYM *); int syg_fix(void); int symtable(void); int sy_assign(char *, char *(*)()); +char * GetSymbolNameByUID(uint32_t); #endif // __SYMBOL_H__