Skip to content
Snippets Groups Projects
Commit 8f49aebf authored by Jan Gruteser's avatar Jan Gruteser
Browse files

use OpApplNode instead of ExprNode in BOperation

parent 02d549cb
Branches
Tags
No related merge requests found
Pipeline #142852 passed
......@@ -13,10 +13,9 @@ import java.util.*;
import java.util.Map.Entry;
import java.util.stream.Collectors;
public class BOperation extends BuiltInOPs implements ASTConstants,
ToolGlobals, TranslationGlobals {
public class BOperation extends BuiltInOPs implements ASTConstants, ToolGlobals, TranslationGlobals {
private final String name;
private final ExprNode node;
private final OpApplNode node;
private final List<OpApplNode> existQuans;
private List<String> opParams;
private List<FormalParamNode> formalParams;
......@@ -28,7 +27,7 @@ public class BOperation extends BuiltInOPs implements ASTConstants,
private List<OpDeclNode> anyVariables;
private final SpecAnalyser specAnalyser;
public BOperation(String name, ExprNode n, List<OpApplNode> existQuans, SpecAnalyser specAnalyser) {
public BOperation(String name, OpApplNode n, List<OpApplNode> existQuans, SpecAnalyser specAnalyser) {
this.name = name;
this.node = n;
this.existQuans = existQuans;
......@@ -225,10 +224,9 @@ public class BOperation extends BuiltInOPs implements ASTConstants,
}
public SymbolNode getSymbolNode() {
if (node instanceof OpApplNode) {
OpApplNode n = ((OpApplNode) node);
if (n.getOperator().getKind() == UserDefinedOpKind) {
return ((OpApplNode) node).getOperator();
if (node != null) {
if (node.getOperator().getKind() == UserDefinedOpKind) {
return node.getOperator();
}
}
return null;
......
......@@ -92,8 +92,7 @@ public class OperationsFinder extends AbstractASTVisitor implements
visitExprOrOpArgNode(n.getArgs()[0]);
} else {
String oldName = currentName;
ArrayList<OpApplNode> oldExists = new ArrayList<>(
exists);
ArrayList<OpApplNode> oldExists = new ArrayList<>(exists);
for (int i = 0; i < n.getArgs().length; i++) {
exists = new ArrayList<>(oldExists);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment