Use parsee results

This commit is contained in:
Rafał Grodziński
2025-07-17 17:14:19 +09:00
parent 502e4d2f6f
commit 8a708d8936
6 changed files with 102 additions and 32 deletions

View File

@@ -0,0 +1,32 @@
#ifndef PARSEE_RESULT_H
#define PARSEE_RESULT_H
#include <memory>
class Token;
class ValueType;
using namespace std;
enum class ParseeResultKind {
TOKEN,
VALUE_TYPE,
};
class ParseeResult {
private:
ParseeResultKind kind;
shared_ptr<Token> token;
shared_ptr<ValueType> valueType;
ParseeResult();
public:
static ParseeResult tokenResult(shared_ptr<Token> token);
static ParseeResult valueTypeResult(shared_ptr<ValueType> valueType);
ParseeResultKind getKind();
shared_ptr<Token> getToken();
shared_ptr<ValueType> getValueType();
};
#endif