34 lines
492 B
C
34 lines
492 B
C
|
|
#ifndef TOKEN_H
|
|
#define TOKEN_H
|
|
|
|
typedef enum {
|
|
TT_ILLEGAL,
|
|
TT_EOF,
|
|
TT_HASH, // #
|
|
TT_ASTERISK,
|
|
TT_UNDERSCORE,
|
|
TT_DASH,
|
|
TT_PERIOD,
|
|
TT_BACKTICK,
|
|
TT_TRIPLEBACKTICK,
|
|
TT_WHITESPACE,
|
|
TT_NEWLINE,
|
|
TT_WORD,
|
|
TT_NUMBER,
|
|
} TokenType;
|
|
|
|
typedef struct Token {
|
|
TokenType type;
|
|
struct Token* next;
|
|
char* literal;
|
|
int line;
|
|
int column;
|
|
int length;
|
|
} Token;
|
|
|
|
char* TokenString(Token* t);
|
|
char* TokenTypeString(TokenType tt);
|
|
|
|
#endif
|