@Override public IProofObligationList caseAElementsUnaryExp(AElementsUnaryExp node, IPOContextStack question) throws AnalysisException { return node.getExp().apply(mainVisitor, question); }
@Override public LexNameList caseAElementsUnaryExp(AElementsUnaryExp expression) throws AnalysisException { return af.createPExpAssistant().getOldNames(expression.getExp()); }
/** * Called by the {@link AElementsUnaryExp} node from {@link AElementsUnaryExp#apply(IPOFAnalysis)}. * @param node the calling {@link AElementsUnaryExp} node */ public void caseAElementsUnaryExp(AElementsUnaryExp node) throws AnalysisException { _visitedNodes.add(node); inAElementsUnaryExp(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); } outAElementsUnaryExp(node); }
/** * Called by the {@link AElementsUnaryExp} node from {@link AElementsUnaryExp#apply(IAnalysis)}. * @param node the calling {@link AElementsUnaryExp} node */ public void caseAElementsUnaryExp(AElementsUnaryExp node) throws AnalysisException { _visitedNodes.add(node); inAElementsUnaryExp(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); } outAElementsUnaryExp(node); }
/** * Called by the {@link AElementsUnaryExp} node from {@link AElementsUnaryExp#apply(IAnalysis)}. * @param node the calling {@link AElementsUnaryExp} node */ public void caseAElementsUnaryExp(AElementsUnaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inAElementsUnaryExp(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); } outAElementsUnaryExp(node, question); }
/** * Called by the {@link AElementsUnaryExp} node from {@link AElementsUnaryExp#apply(IAnalysis)}. * @param node the calling {@link AElementsUnaryExp} node */ public A caseAElementsUnaryExp(AElementsUnaryExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAElementsUnaryExp(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,outAElementsUnaryExp(node)); return retVal; }
/** * Called by the {@link AElementsUnaryExp} node from {@link AElementsUnaryExp#apply(IAnalysis)}. * @param node the calling {@link AElementsUnaryExp} node */ public A caseAElementsUnaryExp(AElementsUnaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAElementsUnaryExp(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,outAElementsUnaryExp(node, question)); return retVal; }
@Override public Value caseAElementsUnaryExp(AElementsUnaryExp node, Context ctxt) throws AnalysisException { BreakpointManager.getBreakpoint(node).check(node.getLocation(), ctxt); try { ValueList seq = node.getExp().apply(VdmRuntime.getExpressionEvaluator(), ctxt).seqValue(ctxt); ValueSet set = new ValueSet(); set.addAll(seq); return new SetValue(set); } catch (ValueException e) { return VdmRuntimeError.abort(node.getLocation(), e); } }
@Override public PType caseAElementsUnaryExp(AElementsUnaryExp node, TypeCheckInfo question) throws AnalysisException { PExp etype = node.getExp(); question.qualifiers = null; TypeCheckInfo argConstraint = question; if (question.constraint != null && question.assistantFactory.createPTypeAssistant().isSet(question.constraint)) { PType stype = question.assistantFactory.createPTypeAssistant().getSet(question.constraint).getSetof(); stype = AstFactory.newASeqSeqType(node.getLocation(), stype); argConstraint = question.newConstraint(stype); } PType arg = etype.apply(THIS, argConstraint); if (!question.assistantFactory.createPTypeAssistant().isSeq(arg)) { TypeCheckerErrors.report(3085, "Argument of 'elems' is not a sequence", node.getLocation(), node); node.setType(AstFactory.newASetSetType(node.getLocation(), AstFactory.newAUnknownType(node.getLocation()))); return node.getType(); } SSeqType seq = question.assistantFactory.createPTypeAssistant().getSeq(arg); node.setType(seq.getEmpty() ? AstFactory.newASetSetType(node.getLocation()) : AstFactory.newASetSetType(node.getLocation(), seq.getSeqof())); return node.getType(); }