Added lexing support for identifiers and keywords

This commit is contained in:
2019-05-19 14:26:21 +02:00
parent 8285811fb7
commit 06fe0e7c4c
9 changed files with 343 additions and 140 deletions

View File

@@ -1,7 +1,10 @@
#ifndef PORYGONLANG_TOKEN_HPP
#define PORYGONLANG_TOKEN_HPP
#include <utility>
#include <string>
#include "TokenKind.hpp"
using namespace std;
class IToken{
public:
@@ -47,4 +50,17 @@ public:
}
};
class IdentifierToken : public IToken{
public:
string Value;
explicit IdentifierToken(string value){
Value = std::move(value);
}
TokenKind GetKind() override{
return TokenKind::Identifier;
}
};
#endif //PORYGONLANG_TOKEN_HPP