acpa/include/token.h
szdytom b05b91a7ff
update according to compiler's complain
Signed-off-by: szdytom <szdytom@qq.com>
2023-08-29 20:29:32 +08:00

38 lines
492 B
C++

#ifndef ACPA_TOKEN_H
#define ACPA_TOKEN_H
#include <string>
#include <vector>
enum class TokenType {
COMMA, // ,
SEMI, // ;
LB, // {
RB, // }
LP, // (
RP, // )
LT, // <
RT, // >
ASSIGN, // =
DOT, // .
COLON, // :
SCOPE, // ::
IMPLY, // ->
STRUCT, // struct
FN, // Fn
RETURN, // return
TYPEOF, // typeof
PUBLIC, // public
ID, // identifier
EXCEED
};
extern std::string token_mp[];
struct Token {
int line;
TokenType type;
std::string s;
};
#endif