@Override public PExp caseAMapletExp(AMapletExp exp, Integer lineno) throws AnalysisException { PExp found = exp.getLeft().apply(THIS, lineno); return found == null ? exp.getRight().apply(THIS, lineno) : found; }
@Override public ValueList caseAMapletExp(AMapletExp exp, ObjectContext ctxt) throws AnalysisException { ValueList list = exp.apply(THIS, ctxt); list.addAll(exp.getRight().apply(THIS, ctxt)); return list; }
/** * Called by the {@link AMapletExp} node from {@link AMapletExp#apply(IAnalysis)}. * @param node the calling {@link AMapletExp} node */ public void caseAMapletExp(AMapletExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inAMapletExp(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); } outAMapletExp(node, question); }
/** * Called by the {@link AMapletExp} node from {@link AMapletExp#apply(IPOFAnalysis)}. * @param node the calling {@link AMapletExp} node */ public void caseAMapletExp(AMapletExp node) throws AnalysisException { _visitedNodes.add(node); inAMapletExp(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); } outAMapletExp(node); }
/** * Called by the {@link AMapletExp} node from {@link AMapletExp#apply(IAnalysis)}. * @param node the calling {@link AMapletExp} node */ public void caseAMapletExp(AMapletExp node) throws AnalysisException { _visitedNodes.add(node); inAMapletExp(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); } outAMapletExp(node); }
@Override public LexNameSet caseAMapletExp(AMapletExp node, FreeVarInfo info) throws AnalysisException { LexNameSet names = node.getLeft().apply(this, info); names.addAll(node.getRight().apply(this, info)); return names; }
@Override public IProofObligationList caseAMapletExp(AMapletExp node, IPOContextStack question) throws AnalysisException { IProofObligationList obligations = node.getLeft().apply(mainVisitor, question); obligations.addAll(node.getRight().apply(mainVisitor, question)); return obligations; }
/** * Called by the {@link AMapletExp} node from {@link AMapletExp#apply(IAnalysis)}. * @param node the calling {@link AMapletExp} node */ public A caseAMapletExp(AMapletExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAMapletExp(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,outAMapletExp(node, question)); return retVal; }
/** * Called by the {@link AMapletExp} node from {@link AMapletExp#apply(IAnalysis)}. * @param node the calling {@link AMapletExp} node */ public A caseAMapletExp(AMapletExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAMapletExp(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,outAMapletExp(node)); return retVal; }
public LexNameList caseAMapletExp(AMapletExp 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 caseAMapletExp(AMapletExp node, IRInfo question) throws AnalysisException { PType type = node.getType(); PExp left = node.getLeft(); PExp right = node.getRight(); STypeIR typeCg = type.apply(question.getTypeVisitor(), question); SExpIR leftCg = left.apply(question.getExpVisitor(), question); SExpIR rightCg = right.apply(question.getExpVisitor(), question); AMapletExpIR maplet = new AMapletExpIR(); maplet.setType(typeCg); maplet.setLeft(leftCg); maplet.setRight(rightCg); return maplet; }
@Override public PType caseAMapletExp(AMapletExp node, TypeCheckInfo question) throws AnalysisException { TypeCheckInfo domConstraint = question; TypeCheckInfo rngConstraint = question; if (question.constraint != null && question.assistantFactory.createPTypeAssistant().isMap(question.constraint)) { PType dtype = question.assistantFactory.createPTypeAssistant().getMap(question.constraint).getFrom(); domConstraint = question.newConstraint(dtype); PType rtype = question.assistantFactory.createPTypeAssistant().getMap(question.constraint).getTo(); rngConstraint = question.newConstraint(rtype); } PType ltype = node.getLeft().apply(THIS, domConstraint); PType rtype = node.getRight().apply(THIS, rngConstraint); node.setType(AstFactory.newAMapMapType(node.getLocation(), ltype, rtype)); return node.getType(); }
@Override public Value caseAMapEnumMapExp(AMapEnumMapExp node, Context ctxt) throws AnalysisException { BreakpointManager.getBreakpoint(node).check(node.getLocation(), ctxt); ValueMap map = new ValueMap(); for (AMapletExp e : node.getMembers()) { Value l = e.getLeft().apply(VdmRuntime.getExpressionEvaluator(), ctxt); Value r = e.getRight().apply(VdmRuntime.getExpressionEvaluator(), ctxt); e.getLocation().hit(); Value old = map.put(l, r); if (old != null && !old.equals(r)) { VdmRuntimeError.abort(node.getLocation(), 4017, "Duplicate map keys have different values: " + l, ctxt); } } return new MapValue(map); }
s = oneType(true, m.getRight(), mtype.getTo(), rit.next());
Value rng = node.getFirst().getRight().apply(VdmRuntime.getExpressionEvaluator(), evalContext); node.getFirst().getLocation().hit();