summaryrefslogtreecommitdiff
path: root/src/lexer.h
blob: 8e3ccb13d4657be90d27b6de671adeb485de3b0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef LEXER
#define LEXER
typedef enum TokenType {
	ERR,
	EOL,
	INDENT,
	STRING,
	INT,
	OPEN_PAREN,
	CLOSE_PAREN,
	START_COMMENT,
	JUSTIFICATION,
	CONTRADICTION,
	PREMISE,
	ASSUMPTION,
	NEGATION,
	CONJUNCTION,
	DISJUNCTION,
	IMPLICATION,
	BI_IMPLICATION,
	EXPLOSION,
	ELIMINATION,
	INTRODUCTION
} tokenType_t;
typedef struct Token {
	tokenType_t type;
	void* value;
} token_t;
token_t init_token(tokenType_t type, void* value);
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);
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);
#endif