Work on evaluation

This commit is contained in:
2019-05-23 18:50:09 +02:00
parent 57cd3efec9
commit d949d9aa8f
10 changed files with 283 additions and 4 deletions

View File

@@ -20,7 +20,6 @@ enum class BoundExpressionKind{
Unary,
Binary,
Parenthesized,
};
class BoundExpression{
@@ -150,6 +149,18 @@ public:
BoundExpressionKind GetKind() final{
return BoundExpressionKind ::Binary;
}
BoundExpression* GetLeft(){
return _left;
}
BoundExpression* GetRight(){
return _right;
}
BoundBinaryOperation GetOperation(){
return _operation;
}
};
class BoundUnaryExpression : public BoundExpression {

View File

@@ -37,6 +37,10 @@ public:
BoundStatementKind GetKind() override{
return BoundStatementKind ::Block;
}
vector<BoundStatement*> GetStatements(){
return _statements;
}
};
class BoundScriptStatement : public BoundBlockStatement{
@@ -62,6 +66,10 @@ public:
BoundStatementKind GetKind() final{
return BoundStatementKind ::Expression;
}
BoundExpression* GetExpression(){
return _expression;
}
};
#endif //PORYGONLANG_BOUNDSTATEMENT_HPP