another ugly basic implementation
This commit is contained in:
7
lexer.h
7
lexer.h
@@ -40,6 +40,7 @@ enum class TokenType {
|
||||
close_paren,
|
||||
logical_and,
|
||||
logical_or,
|
||||
pipe,
|
||||
semicolon,
|
||||
comma,
|
||||
newline,
|
||||
@@ -61,7 +62,8 @@ public:
|
||||
|
||||
void debugTokens();
|
||||
|
||||
Token currentToken();
|
||||
Token currentToken();
|
||||
Token consumeCurrentToken();
|
||||
|
||||
void nextToken();
|
||||
|
||||
@@ -72,7 +74,8 @@ public:
|
||||
TokenType nextTokenType();
|
||||
TokenType prevTokenType();
|
||||
|
||||
static bool isRelationalOperator(TokenType token_type);
|
||||
static bool isRelationalOperator(TokenType token_type);
|
||||
static bool isLogicalOperator(TokenType token_type);
|
||||
|
||||
private:
|
||||
TokenType type(const std::string &token);
|
||||
|
||||
Reference in New Issue
Block a user