moka/lib/token.h

28 lines
508 B
C

#ifndef MK_TOKEN_H
#define MK_TOKEN_H
#include "commons.h"
#define TOKEN_KIND(G) \
G(TOKEN_INT), G(TOKEN_FLOAT), \
G(TOKEN_BOOL), G(TOKEN_STRING), \
G(TOKEN_SYMBOL), G(TOKEN_IDENT), \
G(TOKEN_OPAR), G(TOKEN_CPAR), \
G(TOKEN_OSQUARE), G(TOKEN_CSQUARE)
MK_ENUM_H(TokenKind, TOKEN_KIND);
struct token
{
TokenKind kind;
char* value;
int line;
};
void token_init(struct token* self,
TokenKind kind,
char const* value);
void token_free(struct token* self);
#endif