acpa/include/token.h
2023-08-30 15:16:59 +08:00

40 lines
532 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
PRIVATE, // private
ADMIT, // admit
DELETE, // delete
ID, // identifier
EXCEED
};
extern std::string token_mp[];
struct Token {
int line;
TokenType type;
std::string s;
};
#endif