]> Shamusworld >> Repos - rmac/blob - symbol.h
9ce6b175e9b9235624ff7a7c4e63f7709daa2c4b
[rmac] / symbol.h
1 //
2 // RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
3 // SYMBOL.H - Symbol Handling
4 // Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
5 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
6 // Source Utilised with the Kind Permission of Landon Dyer
7 //
8
9 #ifndef __SYMBOL_H__
10 #define __SYMBOL_H__
11
12 #include <inttypes.h>
13
14 // Line lists
15 struct LineList
16 {
17         struct LineList * next;
18         char * line;
19 };
20
21 // Symbols
22 #define SYM struct _sym
23 SYM
24 {
25         SYM * snext;                                    // * -> Next symbol on hash-chain
26         SYM * sorder;                                   // * -> Next sym in order of reference
27         SYM * sdecl;                                    // * -> Next sym in order of declaration
28         uint8_t stype;                                  // Symbol type 
29         uint16_t sattr;                                 // Attribute bits
30         uint32_t sattre;                                // Extended attribute bits
31         uint16_t senv;                                  // Enviroment number
32         uint32_t svalue;                                // Symbol value
33         char * sname;                                   // * -> Symbol's print-name
34         struct LineList * lineList;             // * -> Macro's linked list of lines
35         struct LineList * last;                 // * -> end of macro linked list
36 };
37
38 // Globals, externals etc
39 extern int curenv;
40 extern char subttl[];
41
42 // Prototypes
43 SYM * lookup(char *, int, int);
44 void InitSymbolTable(void);
45 SYM * NewSymbol(char *, int, int);
46 void sym_decl(SYM *);
47 int syg_fix(void);
48 int symtable(void);
49 int sy_assign(char *, char *(*)());
50
51 #endif // __SYMBOL_H__