Mercurial > hg-old > index.cgi
diff lwasm/lwasm.h @ 344:0215a0fbf61b
Added assembly error system and additional checks for symbol syntax
author | lost@starbug |
---|---|
date | Thu, 25 Mar 2010 22:06:50 -0600 |
parents | 7b4123dce741 |
children | 7416c3f9c321 |
line wrap: on
line diff
--- a/lwasm/lwasm.h Thu Mar 25 20:51:34 2010 -0600 +++ b/lwasm/lwasm.h Thu Mar 25 22:06:50 2010 -0600 @@ -63,6 +63,13 @@ PRAGMA_IMPORTUNDEFEXPORT = 0x0010 // imports symbol if undefined upon export }; +typedef struct lwasm_error_s lwasm_error_t; +struct lwasm_error_s +{ + char *mess; // actual error message + lwasm_error_t *next; // ptr to next error +}; + typedef struct line_s line_t; struct line_s { @@ -71,8 +78,9 @@ int insn; // number of insn in insn table int symset; // set if the line symbol was consumed by the instruction char *sym; // symbol, if any, on the line - line_t *prev; - line_t *next; + lwasm_error_t *err; // list of errors + line_t *prev; // previous line + line_t *next; // next line }; enum @@ -103,6 +111,7 @@ int debug_level; // level of debugging requested int flags; // assembly flags int pragmas; // pragmas currently in effect + int errorcount; // number of errors encountered line_t *line_head; // start of lines list line_t *line_tail; // tail of lines list @@ -121,9 +130,16 @@ #ifndef ___symbol_c_seen___ -extern struct symtabe *register_symbol(asmstate_t *as, char *sym, lw_expr_t value, int flags); -extern struct symtabe *lookup_symbol(asmstate_t *as, char *sym, int context, int version); +extern struct symtabe *register_symbol(asmstate_t *as, line_t *cl, char *sym, lw_expr_t value, int flags); +extern struct symtabe *lookup_symbol(asmstate_t *as, line_t *cl, char *sym, int context, int version); #endif +#ifndef ___lwasm_c_seen___ + +extern void lwasm_register_error(asmstate_t *as, line_t *cl, const char *msg, ...); + +#endif + + #endif /* ___lwasm_h_seen___ */