comparison src/lwasm.h @ 82:03be43ae19cf

Added EXTERN directive
author lost
date Sat, 10 Jan 2009 22:24:29 +0000
parents 121bf4a588ea
children 918be0c02239
comparison
equal deleted inserted replaced
81:b6b1e79cc277 82:03be43ae19cf
96 // for keeping track of symbols 96 // for keeping track of symbols
97 #define SYMBOL_SET 1 // the symbol was used for "SET" 97 #define SYMBOL_SET 1 // the symbol was used for "SET"
98 #define SYMBOL_COMPLEX 2 // register symbol as a complex symbol (from l -> expr) 98 #define SYMBOL_COMPLEX 2 // register symbol as a complex symbol (from l -> expr)
99 #define SYMBOL_FORCE 4 // force resetting the symbol value if it already exists on pass 2 99 #define SYMBOL_FORCE 4 // force resetting the symbol value if it already exists on pass 2
100 #define SYMBOL_NORM 0 // no flags 100 #define SYMBOL_NORM 0 // no flags
101 #define SYMBOL_EXTERN 8 // the symbol is an external reference
101 typedef struct lwasm_symbol_ent_s lwasm_symbol_ent_t; 102 typedef struct lwasm_symbol_ent_s lwasm_symbol_ent_t;
102 struct lwasm_symbol_ent_s 103 struct lwasm_symbol_ent_s
103 { 104 {
104 char *sym; // the symbol 105 char *sym; // the symbol
105 int context; // the context number of the symbol (-1 for global) 106 int context; // the context number of the symbol (-1 for global)
106 int value; // the value of the symbol 107 int value; // the value of the symbol
107 int flags; // flags for the symbol 108 int flags; // flags for the symbol
109 char *externalname; // for external references that are aliased locally
108 sectiontab_t *sect; // the section the symbol exists in; NULL for none 110 sectiontab_t *sect; // the section the symbol exists in; NULL for none
109 lwasm_expr_stack_t *expr; // expression for a symbol that is not constant NULL for const 111 lwasm_expr_stack_t *expr; // expression for a symbol that is not constant NULL for const
110 lwasm_symbol_ent_t *next; // next symbol in the table 112 lwasm_symbol_ent_t *next; // next symbol in the table
111 lwasm_symbol_ent_t *prev; // previous symbol in the table 113 lwasm_symbol_ent_t *prev; // previous symbol in the table
112 }; 114 };