mirror of
https://github.com/lisk77/lambda.git
synced 2025-10-24 18:28:49 +00:00
feat: initial commit
This commit is contained in:
commit
0dd91da74f
17 changed files with 683 additions and 0 deletions
31
include/token.hpp
Normal file
31
include/token.hpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue