acpa/include/token.h
方而静 e5caca5350 拆分源代码到多个文件 (#5)
fixes #3

Co-authored-by: lcw <ez_lcw@foxmail.com>
Co-authored-by: szdytom <szdytom@qq.com>
Reviewed-on: #5
2023-08-29 12:37:26 +00: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