This commit is contained in:
Rafał Grodziński
2025-06-01 16:18:51 +09:00
parent 16439e2fb2
commit 26d476e9e3
4 changed files with 72 additions and 7 deletions

View File

@@ -12,6 +12,8 @@ class Statement {
public:
enum Kind {
EXPRESSION,
BLOCK,
FUNCTION_DECLARATION,
INVALID
};
@@ -19,9 +21,12 @@ private:
Kind kind;
shared_ptr<Token> token;
shared_ptr<Expression> expression;
shared_ptr<Statement> blockStatement;
vector<shared_ptr<Statement>> statements;
string name;
public:
Statement(Kind kind, shared_ptr<Token> token, shared_ptr<Expression> expression);
Statement(Kind kind, shared_ptr<Token> token, shared_ptr<Expression> expression, shared_ptr<Statement> blockStatement, vector<shared_ptr<Statement>> statements, string name);
shared_ptr<Token> getToken();
shared_ptr<Expression> getExpression();
bool isValid();