@Override public IProofObligationList caseADistUnionUnaryExp(ADistUnionUnaryExp node, IPOContextStack question) throws AnalysisException { return node.getExp().apply(mainVisitor, question); }
/** * Called by the {@link ADistUnionUnaryExp} node from {@link ADistUnionUnaryExp#apply(IAnalysis)}. * @param node the calling {@link ADistUnionUnaryExp} node */ public void caseADistUnionUnaryExp(ADistUnionUnaryExp node) throws AnalysisException { _visitedNodes.add(node); inADistUnionUnaryExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outADistUnionUnaryExp(node); }
/** * Called by the {@link ADistUnionUnaryExp} node from {@link ADistUnionUnaryExp#apply(IPOFAnalysis)}. * @param node the calling {@link ADistUnionUnaryExp} node */ public void caseADistUnionUnaryExp(ADistUnionUnaryExp node) throws AnalysisException { _visitedNodes.add(node); inADistUnionUnaryExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outADistUnionUnaryExp(node); }
/** * Called by the {@link ADistUnionUnaryExp} node from {@link ADistUnionUnaryExp#apply(IAnalysis)}. * @param node the calling {@link ADistUnionUnaryExp} node */ public void caseADistUnionUnaryExp(ADistUnionUnaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inADistUnionUnaryExp(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this, question); } outADistUnionUnaryExp(node, question); }
/** * Called by the {@link ADistUnionUnaryExp} node from {@link ADistUnionUnaryExp#apply(IAnalysis)}. * @param node the calling {@link ADistUnionUnaryExp} node */ public A caseADistUnionUnaryExp(ADistUnionUnaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inADistUnionUnaryExp(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this, question)); } mergeReturns(retVal,outADistUnionUnaryExp(node, question)); return retVal; }
/** * Called by the {@link ADistUnionUnaryExp} node from {@link ADistUnionUnaryExp#apply(IAnalysis)}. * @param node the calling {@link ADistUnionUnaryExp} node */ public A caseADistUnionUnaryExp(ADistUnionUnaryExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inADistUnionUnaryExp(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this)); } mergeReturns(retVal,outADistUnionUnaryExp(node)); return retVal; }
@Override public Value caseADistUnionUnaryExp(ADistUnionUnaryExp node, Context ctxt) throws AnalysisException { BreakpointManager.getBreakpoint(node).check(node.getLocation(), ctxt); try { ValueSet setset = node.getExp().apply(VdmRuntime.getExpressionEvaluator(), ctxt).setValue(ctxt); ValueSet result = new ValueSet(); for (Value v : setset) { result.addAll(v.setValue(ctxt)); } return new SetValue(result); } catch (ValueException e) { return VdmRuntimeError.abort(node.getLocation(), e); } }
@Override public PType caseADistUnionUnaryExp(ADistUnionUnaryExp node, TypeCheckInfo question) throws AnalysisException { PExp exp = node.getExp(); question.qualifiers = null; TypeCheckInfo expConstraint = question; if (question.constraint != null) { PType stype = AstFactory.newASetSetType(node.getLocation(), question.constraint); expConstraint = question.newConstraint(stype); } PType type = exp.apply(THIS, expConstraint); if (question.assistantFactory.createPTypeAssistant().isSet(type)) { SSetType set = question.assistantFactory.createPTypeAssistant().getSet(type); if (question.assistantFactory.createPTypeAssistant().isSet(set.getSetof())) { node.setType(set.getSetof()); return set.getSetof(); } } TypeCheckerErrors.report(3078, "dunion argument is not a set of sets", node.getLocation(), node); node.setType(AstFactory.newASetSetType(node.getLocation(), AstFactory.newAUnknownType(node.getLocation()))); return node.getType(); }