summaryrefslogtreecommitdiff
path: root/c/token.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/token.h')
-rw-r--r--c/token.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/c/token.h b/c/token.h
index 36b3657..71183d1 100644
--- a/c/token.h
+++ b/c/token.h
@@ -23,6 +23,20 @@ enum tokentype {
Ntok,
};
+struct location {
+ usize lineno;
+ usize column;
+};
+
+struct token {
+ /* location */
+ struct location loc;
+ /* token type */
+ enum tokentype type;
+ /* string value, if any */
+ char *str;
+};
+
char* tokname(enum tokentype);
enum tokentype findkeyword(char *name);