/** * Called by the {@link ASameClassExp} node from {@link ASameClassExp#apply(IAnalysis)}. * @param node the calling {@link ASameClassExp} node */ public void caseASameClassExp(ASameClassExp node) throws AnalysisException { _visitedNodes.add(node); inASameClassExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outASameClassExp(node); }
/** * Called by the {@link ASameClassExp} node from {@link ASameClassExp#apply(IAnalysis)}. * @param node the calling {@link ASameClassExp} node */ public void caseASameClassExp(ASameClassExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inASameClassExp(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this, question); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this, question); } outASameClassExp(node, question); }
/** * Called by the {@link ASameClassExp} node from {@link ASameClassExp#apply(IPOFAnalysis)}. * @param node the calling {@link ASameClassExp} node */ public void caseASameClassExp(ASameClassExp node) throws AnalysisException { _visitedNodes.add(node); inASameClassExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outASameClassExp(node); }
@Override public IProofObligationList caseASameClassExp(ASameClassExp node, IPOContextStack question) throws AnalysisException { IProofObligationList list = node.getLeft().apply(mainVisitor, question); list.addAll(node.getRight().apply(mainVisitor, question)); return list; }
@Override public ValueList caseASameClassExp(ASameClassExp exp, ObjectContext ctxt) throws AnalysisException { ValueList list = exp.getLeft().apply(THIS, ctxt); list.addAll(exp.getRight().apply(THIS, ctxt)); return list; }
@Override public PExp caseASameClassExp(ASameClassExp exp, Integer lineno) throws AnalysisException { PExp found = findExpressionBaseCase(exp, lineno); if (found != null) { return found; } found = exp.getLeft().apply(THIS, lineno); if (found != null) { return found; } found = exp.getRight().apply(THIS, lineno); if (found != null) { return found; } return null; }
/** * Called by the {@link ASameClassExp} node from {@link ASameClassExp#apply(IAnalysis)}. * @param node the calling {@link ASameClassExp} node */ public A caseASameClassExp(ASameClassExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inASameClassExp(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { mergeReturns(retVal,node.getLeft().apply(this)); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { mergeReturns(retVal,node.getRight().apply(this)); } mergeReturns(retVal,outASameClassExp(node)); return retVal; }
/** * Called by the {@link ASameClassExp} node from {@link ASameClassExp#apply(IAnalysis)}. * @param node the calling {@link ASameClassExp} node */ public A caseASameClassExp(ASameClassExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inASameClassExp(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { mergeReturns(retVal,node.getLeft().apply(this, question)); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { mergeReturns(retVal,node.getRight().apply(this, question)); } mergeReturns(retVal,outASameClassExp(node, question)); return retVal; }
public LexNameList caseASameClassExp(ASameClassExp expression) throws org.overture.ast.analysis.AnalysisException { LexNameList list = af.createPExpAssistant().getOldNames(expression.getLeft()); list.addAll(af.createPExpAssistant().getOldNames(expression.getRight())); return list; }
@Override public SExpIR caseASameClassExp(ASameClassExp node, IRInfo question) throws AnalysisException { PExp left = node.getLeft(); PExp right = node.getRight(); SExpIR leftCg = left.apply(question.getExpVisitor(), question); SExpIR rightCg = right.apply(question.getExpVisitor(), question); ASameClassExpIR sameBaseClassExp = new ASameClassExpIR(); sameBaseClassExp.setLeft(leftCg); sameBaseClassExp.setRight(rightCg); return sameBaseClassExp; } }
@Override public Value caseASameClassExp(ASameClassExp node, Context ctxt) throws AnalysisException { BreakpointManager.getBreakpoint(node).check(node.getLocation(), ctxt); try { Value l = node.getLeft().apply(VdmRuntime.getExpressionEvaluator(), ctxt); Value r = node.getRight().apply(VdmRuntime.getExpressionEvaluator(), ctxt); if (!l.isType(ObjectValue.class) || !r.isType(ObjectValue.class)) { return new BooleanValue(false); } ObjectValue lv = l.objectValue(ctxt); ObjectValue rv = r.objectValue(ctxt); return new BooleanValue(lv.type.equals(rv.type)); } catch (ValueException e) { return VdmRuntimeError.abort(node.getLocation(), e); } }
@Override public PType caseASameClassExp(ASameClassExp node, TypeCheckInfo question) throws AnalysisException { PExp left = node.getLeft(); PExp right = node.getRight(); question.qualifiers = null; PType lt = left.apply(THIS, question.newConstraint(null)); if (!question.assistantFactory.createPTypeAssistant().isClass(lt, question.env)) { TypeCheckerErrors.report(3266, "Argument is not an object", left.getLocation(), left); } question.qualifiers = null; PType rt = right.apply(THIS, question.newConstraint(null)); if (!question.assistantFactory.createPTypeAssistant().isClass(rt, question.env)) { TypeCheckerErrors.report(3266, "Argument is not an object", right.getLocation(), right); } node.setType(AstFactory.newABooleanBasicType(node.getLocation())); return question.assistantFactory.createPTypeAssistant().checkConstraint(question.constraint, node.getType(), node.getLocation()); }