@Override public List<PMultipleBind> caseASetBind(ASetBind bind) throws AnalysisException { List<PPattern> plist = new ArrayList<PPattern>(); plist.add(bind.getPattern()); List<PMultipleBind> mblist = new Vector<PMultipleBind>(); mblist.add(AstFactory.newASetMultipleBind(plist, bind.getSet())); return mblist; }
public static ASetBind newASetBind(PPattern pattern, PExp readExpression) { ASetBind result = new ASetBind(); result.setLocation(pattern.getLocation()); result.setPattern(pattern); result.setSet(readExpression); return result; }
/** * Sets the {@code _setbind} child of this {@link AEqualsDefinition} node. * @param value the new {@code _setbind} child of this {@link AEqualsDefinition} node */ public void setSetbind(ASetBind value) { if (this._setbind != null) { this._setbind.parent(null); } if (value != null) { if (value.parent() != null) { value.parent().removeChild(value); } value.parent(this); } this._setbind = value; }
/** * Called by the {@link ASeqCompSeqExp} node from {@link ASeqCompSeqExp#apply(IAnalysis)}. * @param node the calling {@link ASeqCompSeqExp} node */ public void caseASeqCompSeqExp(ASeqCompSeqExp node) throws AnalysisException { _visitedNodes.add(node); inASeqCompSeqExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getFirst() != null && !_visitedNodes.contains(node.getFirst())) { node.getFirst().apply(this); } if(node.getSetBind() != null && !_visitedNodes.contains(node.getSetBind())) { node.getSetBind().apply(this); } if(node.getSeqBind() != null && !_visitedNodes.contains(node.getSeqBind())) { node.getSeqBind().apply(this); } if(node.getPredicate() != null && !_visitedNodes.contains(node.getPredicate())) { node.getPredicate().apply(this); } outASeqCompSeqExp(node); }
@Override public LexNameSet caseASetBind(ASetBind node, FreeVarInfo info) throws AnalysisException { return node.getSet().apply(this, info); }
PType st = node.getSetbind().getSet().apply(THIS, question); TypeCheckerErrors.report(3016, "Expression is not compatible with set bind", node.getSetbind().getLocation(), node.getSetbind()); question.assistantFactory.createPPatternAssistant().typeResolve(node.getSetbind().getPattern(), THIS, question); node.setDefs(question.assistantFactory.createPPatternAssistant().getDefinitions(node.getSetbind().getPattern(), node.getDefType(), question.scope));
ValueSet elements = bind.getSet().apply(VdmRuntime.getExpressionEvaluator(), state.ctxt).setValue(state.ctxt); elements.sort(); VdmRuntimeError.abort(bind.getLocation(), (ValueException) e);
NameValuePairList nvpl = ctxt.assistantFactory.createPPatternAssistant().getNamedValues(node.getSetBind().getPattern(), val, ctxt); Value sortOn = nvpl.isEmpty() ? new NaturalValue(count++) : nvpl.get(0).value;
/** * Returns a deep clone of this {@link ASetBind} node. * @return a deep clone of this {@link ASetBind} node */ public ASetBind clone() { return new ASetBind( _location, _pattern, _set ); }
/** * Called by the {@link ASeqCompSeqExp} node from {@link ASeqCompSeqExp#apply(IAnalysis)}. * @param node the calling {@link ASeqCompSeqExp} node */ public void caseASeqCompSeqExp(ASeqCompSeqExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inASeqCompSeqExp(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getFirst() != null && !_visitedNodes.contains(node.getFirst())) { node.getFirst().apply(this, question); } if(node.getSetBind() != null && !_visitedNodes.contains(node.getSetBind())) { node.getSetBind().apply(this, question); } if(node.getSeqBind() != null && !_visitedNodes.contains(node.getSeqBind())) { node.getSeqBind().apply(this, question); } if(node.getPredicate() != null && !_visitedNodes.contains(node.getPredicate())) { node.getPredicate().apply(this, question); } outASeqCompSeqExp(node, question); }
@Override public IProofObligationList caseASetBind(ASetBind node, IPOContextStack question) throws AnalysisException { try { return node.getSet().apply(this.pogExpVisitor, question); } catch (Exception e) { throw new POException(node, e.getMessage()); } }
question.assistantFactory.createPPatternAssistant().getVariableNames(node.getSetBind().getPattern()).size() > 1 || !question.assistantFactory.createPTypeAssistant().isOrdered(question.assistantFactory.createPDefinitionAssistant().getType(def), node.getLocation())))
/** * Creates a deep clone of this {@link ASetBind} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link ASetBind} node */ public ASetBind clone(Map<INode,INode> oldToNewMap) { ASetBind node = new ASetBind( _location, _pattern, _set ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link ASetBind} node from {@link ASetBind#apply(IAnalysis)}. * @param node the calling {@link ASetBind} node */ public void caseASetBind(ASetBind node, Q question) throws AnalysisException { _visitedNodes.add(node); inASetBind(node, question); if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { node.getPattern().apply(this, question); } if(node.getSet() != null && !_visitedNodes.contains(node.getSet())) { node.getSet().apply(this, question); } outASetBind(node, question); }
/** * Called by the {@link ASeqCompSeqExp} node from {@link ASeqCompSeqExp#apply(IPOFAnalysis)}. * @param node the calling {@link ASeqCompSeqExp} node */ public void caseASeqCompSeqExp(ASeqCompSeqExp node) throws AnalysisException { _visitedNodes.add(node); inASeqCompSeqExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getFirst() != null && !_visitedNodes.contains(node.getFirst())) { node.getFirst().apply(this); } if(node.getSetBind() != null && !_visitedNodes.contains(node.getSetBind())) { node.getSetBind().apply(this); } if(node.getSeqBind() != null && !_visitedNodes.contains(node.getSeqBind())) { node.getSeqBind().apply(this); } if(node.getPredicate() != null && !_visitedNodes.contains(node.getPredicate())) { node.getPredicate().apply(this); } outASeqCompSeqExp(node); }
@Override public ValueList caseASetBind(ASetBind bind, ObjectContext ctxt) throws AnalysisException { return af.createPExpAssistant().getValues(bind.getSet(), ctxt); }
/** * Sets the {@code _setBind} child of this {@link ASeqCompSeqExp} node. * @param value the new {@code _setBind} child of this {@link ASeqCompSeqExp} node */ public void setSetBind(ASetBind value) { if (this._setBind != null) { this._setBind.parent(null); } if (value != null) { if (value.parent() != null) { value.parent().removeChild(value); } value.parent(this); } this._setBind = value; }
/** * Called by the {@link ASetBind} node from {@link ASetBind#apply(IAnalysis)}. * @param node the calling {@link ASetBind} node */ public void caseASetBind(ASetBind node) throws AnalysisException { _visitedNodes.add(node); inASetBind(node); if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { node.getPattern().apply(this); } if(node.getSet() != null && !_visitedNodes.contains(node.getSet())) { node.getSet().apply(this); } outASetBind(node); }
@Override public LexNameList caseAEqualsDefinition(AEqualsDefinition def) throws AnalysisException { LexNameList list = af.createPExpAssistant().getOldNames(def.getTest()); if (def.getSetbind() != null) { list.addAll(def.getSetbind().apply(this)); } else if (def.getSeqbind() != null) { list.addAll(def.getSeqbind().apply(this)); } return list; }