summaryrefslogtreecommitdiff
path: root/lexer.h
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2023-06-11 16:18:21 -0700
committerKai Stevenson <kai@kaistevenson.com>2023-06-11 16:18:21 -0700
commitd063e3c2c6f4b1566c28d0ea92186f356017f99f (patch)
treeaf7b093f016d16a4902a9094d120f1a33bee64b6 /lexer.h
parent2a232f8f42c0a7d5a7b648358a192c21865a55f6 (diff)
parsing propositions works now. added some debugging tools
Diffstat (limited to 'lexer.h')
-rw-r--r--lexer.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/lexer.h b/lexer.h
index f8dc046..7f4cfd0 100644
--- a/lexer.h
+++ b/lexer.h
@@ -17,22 +17,21 @@ typedef enum TokenType {
BI_IMPLICATION,
EXPLOSION,
ELIMINATION,
- INTRODUCTION,
+ INTRODUCTION
} tokenType_t;
-
typedef struct Token {
tokenType_t type;
void* value;
} token_t;
token_t init_token(tokenType_t type, void* value);
-typedef struct LinkedList {
- void* value;
- struct LinkedList* next;
-} linkList_t;
-
-linkList_t* init_linklist(void* value, linkList_t* next);
+typedef struct TokenSet {
+ token_t* tokens;
+ int count;
+} tokenSet_t;
+tokenSet_t init_tokenset(token_t* tokens, int count);
+char* tttos(tokenType_t tokenType);
int advance_whitespace(char** linePointer);
-linkList_t* lex_line(char* line);
+tokenSet_t lex_line(char* line);
token_t lex_first_token(char** content);
token_t lex_first_string(char** content);
token_t lex_first_int(char** content);