aboutsummaryrefslogtreecommitdiffstats
path: root/src/tok.h
diff options
context:
space:
mode:
authorkatherine <shmibs@airen-no-jikken.icu>2019-05-08 23:33:41 -0700
committerkatherine <shmibs@airen-no-jikken.icu>2019-05-08 23:33:41 -0700
commit95a9726023abd85b49ed39837911e1b231f4389b (patch)
tree3535a3ca1feac910ecf736fdc07ddcb5559f4321 /src/tok.h
parentca0d95e26663e05d702c6f3a5627812dbf0c9f90 (diff)
downloadconfconf-95a9726023abd85b49ed39837911e1b231f4389b.tar.gz
implement internal tokeniser
Diffstat (limited to 'src/tok.h')
-rw-r--r--src/tok.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/tok.h b/src/tok.h
new file mode 100644
index 0000000..2e02c40
--- /dev/null
+++ b/src/tok.h
@@ -0,0 +1,32 @@
+#ifndef CONFCONF_TOK_H
+#define CONFCONF_TOK_H
+
+#include <stdio.h>
+
+enum tok_type_e {
+ TOK_LBRACE = 0,
+ TOK_RBRACE = 1,
+ TOK_EQUAL = 2,
+ TOK_COMMA = 3,
+ TOK_BANG = 4,
+ TOK_QMARK = 5,
+ TOK_OP_STRUCT = 6,
+ TOK_OP_HKEY_SIZE = 7,
+ TOK_OP_HKEY_NAME = 8,
+ TOK_OP_FUN_SUF = 9,
+ TOK_UINT = 10,
+ TOK_ID = 11,
+ TOK_UNKNWN = 12,
+ TOK_END = 13,
+};
+
+struct tok_s {
+ enum tok_type_e type;
+ size_t line;
+ size_t col;
+ char *val;
+};
+
+struct tok_s tok_get(FILE *f);
+
+#endif