From f478e6c1223cc8370fa51d44b9244ec25be99788 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sun, 13 Feb 2022 20:20:59 -0400 Subject: igen: Start work on writing an instruction handler generator. This will make it easier in the long run to modify instructions, add new instructions, and move the opcode tables around. --- igen/lexer.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 igen/lexer.h (limited to 'igen/lexer.h') diff --git a/igen/lexer.h b/igen/lexer.h new file mode 100644 index 0000000..ba81cb1 --- /dev/null +++ b/igen/lexer.h @@ -0,0 +1,46 @@ +#ifndef LEXER_H +#define LEXER_H + +typedef enum atom atom; +typedef struct lexeme lexeme; + +enum atom { + ATOM_LBRACK, + ATOM_RBRACK, + ATOM_SLASH, + ATOM_PLUS, + ATOM_MINUS, + ATOM_ASTR, + ATOM_PRCNT, + ATOM_AMPR, + ATOM_PIPE, + ATOM_CARROT, + ATOM_HASH, + ATOM_COL, + ATOM_SCOL, + ATOM_SPACE, + ATOM_USCORE, + ATOM_EQUAL, + ATOM_DOT, + ATOM_QMARK, + ATOM_BANG, + ATOM_LT, + ATOM_GT, + ATOM_PERCENT, + ATOM_COMMA, + ATOM_BSLASH, + ATOM_QUOTE, + ATOM_SQUOTE, + ATOM_TAB, + ATOM_NLINE, + ATOM_ALPHA, + ATOM_NUM, + ATOM_NONE, + NUM_ATOMS +}; + +struct lexeme { +}; + +extern int lex(char *str, int dbg); +#endif -- cgit v1.2.3-13-gbd6f