change UnaryExpression

This commit is contained in:
StefanZ3 2024-06-27 08:11:04 +02:00
parent 77a6dae94f
commit 60958538d8
2 changed files with 4 additions and 3 deletions

View File

@ -15,8 +15,8 @@ import java.util.Objects;
public class UnaryExpression extends AbstractType implements IExpression{
public String operator;
public IDatatype operand;
public UnaryExpression(String operator, IDatatype operand){
public IExpression operand;
public UnaryExpression(String operator, IExpression operand){
this.operator = operator;
this.operand = operand;
}

View File

@ -271,7 +271,8 @@ public class ASTGenerator extends DecafBaseVisitor<Node> {
} else if (ctx.value() != null) {
return visitValue(ctx.value());
} else if (ctx.binaryExpr() != null) {
//todo
IExpression expression = (IExpression) visit(ctx.binaryExpr());
return new UnaryExpression("!", expression);
}
return null;
}