From d17eb092f620d217f08ae7fb27122bb30799eaf4 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Tue, 11 Aug 2020 12:13:21 -0400 Subject: - Changed the spacing format to now store the number of spaces, and tabs before the current token. Along with also now storing a sub-token count which is used in case the token's secondary id is meant to be treated as a sub-token. - Added suppor for saving the number of blank lines before the current tokenized line. --- asmmon.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'asmmon.h') diff --git a/asmmon.h b/asmmon.h index 6c71a4a..a03213d 100644 --- a/asmmon.h +++ b/asmmon.h @@ -16,6 +16,14 @@ struct tok { uint8_t id; /* Token ID. */ uint8_t type; /* Token type ID. */ + uint8_t tab; /* Number of tabs. */ + uint8_t space; /* Number of spaces. */ + + uint8_t subtab; /* Number of sub-token tabs. */ + uint8_t subspace; /* Number of sub-token spaces. */ + + uint8_t digits; /* Number of digits. */ + /* Token value(s). */ union { symbol *sym; @@ -31,12 +39,9 @@ struct ln { line *next; /* Pointer to the next line. */ token *tok; /* The token(s) for this line. */ uint16_t count; /* Total tokens for this line. */ + uint16_t bline; /* Number of blank lines. */ uint32_t linenum; /* Line number. */ uint64_t addr; /* The address of this line. */ - uint8_t stab; /* Number of starting tabs. */ - uint8_t sspace; /* Number of starting spaces. */ - uint8_t etab; /* Number of ending tabs. */ - uint8_t espace; /* Number of ending spaces. */ }; @@ -536,9 +541,9 @@ extern uint8_t defined; extern uint8_t isfixup; extern line *find_line(uint32_t ln, uint8_t dbg); -extern uint64_t lex(char *str, uint64_t address, uint8_t dbg); +extern uint64_t lex(char *str, uint64_t address, uint16_t bline, uint8_t dbg); extern uint64_t parse_tokens(token *tm, bytecount *bc, uint8_t isasm, uint64_t address, uint8_t dbg); -extern token *make_token(uint8_t id, uint8_t type, uint64_t value, char *str, symbol *sym); +extern token *make_token(uint8_t id, uint8_t type, uint8_t space, uint8_t tab, uint64_t value, char *str, symbol *s); extern void assemble(line *ln, bytecount *bc, uint8_t dbg); extern void cleanup(); -- cgit v1.2.3-13-gbd6f