Tokenizing and printing
This commit is contained in:
parent
371eca6269
commit
b5912b95f7
5 changed files with 259 additions and 1 deletions
|
@ -9,6 +9,23 @@ enum TokenType {
|
|||
TOKENTYPE_INTEGER,
|
||||
TOKENTYPE_DOUBLE,
|
||||
TOKENTYPE_IDENTIFIER,
|
||||
TOKENTYPE_LEFT_BRACE,
|
||||
TOKENTYPE_RIGHT_BRACE,
|
||||
TOKENTYPE_AMPERSAND,
|
||||
TOKENTYPE_PLUS,
|
||||
TOKENTYPE_MINUS,
|
||||
TOKENTYPE_MULTIPLY,
|
||||
TOKENTYPE_DIVIDE,
|
||||
TOKENTYPE_PIPE,
|
||||
TOKENTYPE_ARROW,
|
||||
TOKENTYPE_COLON,
|
||||
TOKENTYPE_EQUALITY,
|
||||
TOKENTYPE_INEQUALITY,
|
||||
TOKENTYPE_LESSTHAN,
|
||||
TOKENTYPE_LESSEQUAL,
|
||||
TOKENTYPE_GREATERTHAN,
|
||||
TOKENTYPE_GREATEREQUAL,
|
||||
TOKENTYPE_COMMA,
|
||||
TOKENTYPE_ERROR,
|
||||
};
|
||||
|
||||
|
@ -28,5 +45,6 @@ typedef struct Token_s {
|
|||
#define TOKEN_NONE ((Token) {.type = TOKENTYPE_NONE, .get = {.error = STRINGVIEW_NONE } } )
|
||||
|
||||
Token Tokenizer_NextToken(StringView* source);
|
||||
const char* TokenType_ToString(enum TokenType type);
|
||||
|
||||
#endif //header guard
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue