Added lexing support for identifiers and keywords
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user