summaryrefslogtreecommitdiff
path: root/igen/lexer.h
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-02-13 20:20:59 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2022-02-13 20:20:59 -0400
commitf478e6c1223cc8370fa51d44b9244ec25be99788 (patch)
tree4abe8889888c0b098ea99ee020c446254822a923 /igen/lexer.h
parent6833f6bc2a5730169084c74d8e8fc0b76666b2a0 (diff)
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.
Diffstat (limited to 'igen/lexer.h')
-rw-r--r--igen/lexer.h46
1 files changed, 46 insertions, 0 deletions
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