26 lines
No EOL
491 B
C
26 lines
No EOL
491 B
C
#ifndef __TOKENIZER_H__
|
|
#define __TOKENIZER_H__
|
|
|
|
extern const char* TokenTypeText[];
|
|
|
|
typedef enum TokenType {
|
|
TOKEN_LPAREN,
|
|
TOKEN_RPAREN,
|
|
TOKEN_NUMBER,
|
|
TOKEN_NAME,
|
|
TOKEN_STRING
|
|
} TokenType;
|
|
|
|
typedef struct Token {
|
|
char* value;
|
|
TokenType type;
|
|
struct Token* next;
|
|
} Token;
|
|
|
|
Token* tokenize(char* input);
|
|
|
|
Token* token_create(char* value, TokenType type, Token* root);
|
|
Token* token_append(Token* root, Token* new_token);
|
|
void tokens_print(Token* root);
|
|
|
|
#endif |