modify some and define types for token
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
typedef enum {
|
||||
LBRACK,
|
||||
RBRACK,
|
||||
LCURLY,
|
||||
RCURLY,
|
||||
|
||||
ID,
|
||||
SEMI,
|
||||
COMMA,
|
||||
ARROW,
|
||||
STAR,
|
||||
COMMENT,
|
||||
NUM,
|
||||
|
||||
RETURN,
|
||||
IF,
|
||||
ELSE,
|
||||
|
||||
STRING_LITERAL,
|
||||
|
||||
ERROR
|
||||
} TokenType;
|
||||
|
||||
typedef struct {
|
||||
TokenType type;
|
||||
char *data;
|
||||
int line;
|
||||
} Token;
|
||||
|
||||
Reference in New Issue
Block a user