Compare commits

...

2 Commits

Author SHA1 Message Date
b84ad2ef6b Merge remote-tracking branch 'origin/master' 2024-06-27 08:11:17 +02:00
60958538d8 change UnaryExpression 2024-06-27 08:11:04 +02:00
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;
}