mirror of
https://github.com/lisk77/lambda.git
synced 2025-10-24 02:08:49 +00:00
31 lines
437 B
C++
31 lines
437 B
C++
#ifndef TOKEN_H
|
|
#define TOKEN_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
#include <string>
|
|
|
|
typedef enum {
|
|
ERROR,
|
|
EOL,
|
|
EOC,
|
|
LAMBDA,
|
|
DOT,
|
|
LPAREN,
|
|
RPAREN,
|
|
VARIABLE,
|
|
EQUALS
|
|
} TokenType;
|
|
|
|
typedef struct {
|
|
TokenType type;
|
|
std::string lexeme;
|
|
size_t start;
|
|
size_t end;
|
|
} Token;
|
|
|
|
void print_lexeme(Token);
|
|
std::string display_tokentype(TokenType);
|
|
void print_token(Token);
|
|
|
|
#endif // TOKEN_H
|