summaryrefslogtreecommitdiff
path: root/lexer.c
diff options
context:
space:
mode:
authorCarson Fleming <cflems@cflems.net>2026-07-30 22:54:31 -0400
committerCarson Fleming <cflems@cflems.net>2026-07-30 22:54:31 -0400
commit5adb568da4dfda6d5d9699ee4b92fe44b43fc4cf (patch)
tree0772ae3bf2f5bacfbeeece4eb69063cd20f92325 /lexer.c
parent65dd0651eb7d9e0434a88ec4118d64dfb119d74b (diff)
downloadccc-5adb568da4dfda6d5d9699ee4b92fe44b43fc4cf.tar.gz
token names
Diffstat (limited to 'lexer.c')
-rw-r--r--lexer.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/lexer.c b/lexer.c
index c8c98db..b1d7f55 100644
--- a/lexer.c
+++ b/lexer.c
@@ -4,6 +4,59 @@
#include <string.h>
#include <stdckdint.h>
+const char* token_labels[] = {
+ "not found",
+ "identifier",
+ "integer literal",
+ "floating point literal",
+ "character literal",
+ "string literal",
+ "#",
+ "(",
+ ")",
+ "{",
+ "}",
+ "[",
+ "]",
+ ":",
+ ";",
+ ",",
+ ".",
+ "?",
+ "!",
+ "!=",
+ "^",
+ "^=",
+ "&",
+ "&&",
+ "&=",
+ "*",
+ "*=",
+ "-",
+ "-=",
+ "->",
+ "=",
+ "==",
+ "+",
+ "+=",
+ "\\",
+ "|",
+ "||",
+ "|=",
+ "/",
+ "/=",
+ "%",
+ "%=",
+ "<",
+ ">",
+ "<=",
+ ">=",
+ ">>",
+ ">>=",
+ "<<",
+ "<<=",
+};
+
static FILE* file = NULL;
static int lookahead;
static const char* PATH;