comparison lwasm/lwasm.h @ 345:7416c3f9c321

Basic macro processor ported forward; added context break handling for local symbols
author lost@starbug
date Thu, 25 Mar 2010 23:17:54 -0600
parents 0215a0fbf61b
children a82c55070624
comparison
equal deleted inserted replaced
344:0215a0fbf61b 345:7416c3f9c321
102 typedef struct 102 typedef struct
103 { 103 {
104 struct symtabe *head; // start of symbol table 104 struct symtabe *head; // start of symbol table
105 } symtab_t; 105 } symtab_t;
106 106
107 typedef struct macrotab_s macrotab_t;
108 struct macrotab_s
109 {
110 char *name; // name of macro
111 char **lines; // macro lines
112 int numlines; // number lines in macro
113 macrotab_t *next; // next macro in list
114 };
115
107 typedef struct 116 typedef struct
108 { 117 {
109 int output_format; // output format 118 int output_format; // output format
110 int target; // assembly target 119 int target; // assembly target
111 int debug_level; // level of debugging requested 120 int debug_level; // level of debugging requested
112 int flags; // assembly flags 121 int flags; // assembly flags
113 int pragmas; // pragmas currently in effect 122 int pragmas; // pragmas currently in effect
114 int errorcount; // number of errors encountered 123 int errorcount; // number of errors encountered
124 int inmacro; // are we in a macro?
125 int skipcond; // skipping a condition?
126 int skipmacro; // are we skipping in a macro?
115 127
116 line_t *line_head; // start of lines list 128 line_t *line_head; // start of lines list
117 line_t *line_tail; // tail of lines list 129 line_t *line_tail; // tail of lines list
118 130
119 int context; // the current "context" 131 int context; // the current "context"
120 132 int nextcontext; // the next available context
133
121 symtab_t symtab; // meta data for the symbol table 134 symtab_t symtab; // meta data for the symbol table
135 macrotab_t *macros; // macro table
122 136
123 char *list_file; // name of file to list to 137 char *list_file; // name of file to list to
124 char *output_file; // output file name 138 char *output_file; // output file name
125 lw_stringlist_t input_files; // files to assemble 139 lw_stringlist_t input_files; // files to assemble
126 void *input_data; // opaque data used by the input system 140 void *input_data; // opaque data used by the input system
136 #endif 150 #endif
137 151
138 #ifndef ___lwasm_c_seen___ 152 #ifndef ___lwasm_c_seen___
139 153
140 extern void lwasm_register_error(asmstate_t *as, line_t *cl, const char *msg, ...); 154 extern void lwasm_register_error(asmstate_t *as, line_t *cl, const char *msg, ...);
155 extern int lwasm_next_context(asmstate_t *as);
141 156
142 #endif 157 #endif
143 158
144 159
145 #endif /* ___lwasm_h_seen___ */ 160 #endif /* ___lwasm_h_seen___ */