Implements unary operation evaluation

This commit is contained in:
2019-05-25 14:59:12 +02:00
parent 9131fbfee7
commit b536187593
7 changed files with 82 additions and 2 deletions

View File

@@ -41,6 +41,7 @@ NumericEvalValue* Evaluator::EvaluateIntegerExpression(BoundExpression *expressi
switch (expression->GetKind()){
case BoundExpressionKind ::LiteralInteger: return new IntegerEvalValue(((BoundLiteralIntegerExpression*)expression)->GetValue());
case BoundExpressionKind ::LiteralFloat: return new FloatEvalValue(((BoundLiteralFloatExpression*)expression)->GetValue());
case BoundExpressionKind::Unary: return this -> EvaluateIntegerUnary((BoundUnaryExpression*)expression);
case BoundExpressionKind ::Binary: return this -> EvaluateIntegerBinary((BoundBinaryExpression*)expression);
case BoundExpressionKind ::LiteralString:
@@ -53,7 +54,7 @@ NumericEvalValue* Evaluator::EvaluateIntegerExpression(BoundExpression *expressi
BooleanEvalValue* Evaluator::EvaluateBoolExpression(BoundExpression *expression) {
switch (expression->GetKind()) {
case BoundExpressionKind::LiteralBool: return new BooleanEvalValue(((BoundLiteralBoolExpression*)expression)->GetValue());
case BoundExpressionKind::Unary:break;
case BoundExpressionKind::Unary: return this -> EvaluateBooleanUnary((BoundUnaryExpression*)expression);
case BoundExpressionKind::Binary: return this -> EvaluateBooleanBinary((BoundBinaryExpression*)expression);
case BoundExpressionKind::Bad:
case BoundExpressionKind::LiteralInteger: