@Override // RWL See [1] pg. 64-65 public IProofObligationList caseAIsOfBaseClassExp(AIsOfBaseClassExp node, IPOContextStack question) throws AnalysisException { return node.getExp().apply(mainVisitor, question); }
@Override public ValueList caseAIsOfBaseClassExp(AIsOfBaseClassExp exp, ObjectContext ctxt) throws AnalysisException { return exp.getExp().apply(THIS, ctxt); }
@Override public PExp caseAIsOfBaseClassExp(AIsOfBaseClassExp exp, Integer lineno) throws AnalysisException { PExp found = findExpressionBaseCase(exp, lineno); if (found != null) { return found; } return exp.getExp().apply(THIS, lineno); }
public LexNameList caseAIsOfBaseClassExp(AIsOfBaseClassExp expression) throws org.overture.ast.analysis.AnalysisException { return af.createPExpAssistant().getOldNames(expression.getExp()); }
/** * Called by the {@link AIsOfBaseClassExp} node from {@link AIsOfBaseClassExp#apply(IAnalysis)}. * @param node the calling {@link AIsOfBaseClassExp} node */ public void caseAIsOfBaseClassExp(AIsOfBaseClassExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inAIsOfBaseClassExp(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getBaseClass() != null ) { node.getBaseClass().apply(this, question); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this, question); } outAIsOfBaseClassExp(node, question); }
/** * Called by the {@link AIsOfBaseClassExp} node from {@link AIsOfBaseClassExp#apply(IPOFAnalysis)}. * @param node the calling {@link AIsOfBaseClassExp} node */ public void caseAIsOfBaseClassExp(AIsOfBaseClassExp node) throws AnalysisException { _visitedNodes.add(node); inAIsOfBaseClassExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getBaseClass() != null ) { node.getBaseClass().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outAIsOfBaseClassExp(node); }
/** * Called by the {@link AIsOfBaseClassExp} node from {@link AIsOfBaseClassExp#apply(IAnalysis)}. * @param node the calling {@link AIsOfBaseClassExp} node */ public void caseAIsOfBaseClassExp(AIsOfBaseClassExp node) throws AnalysisException { _visitedNodes.add(node); inAIsOfBaseClassExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getBaseClass() != null ) { node.getBaseClass().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outAIsOfBaseClassExp(node); }
/** * Called by the {@link AIsOfBaseClassExp} node from {@link AIsOfBaseClassExp#apply(IAnalysis)}. * @param node the calling {@link AIsOfBaseClassExp} node */ public A caseAIsOfBaseClassExp(AIsOfBaseClassExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAIsOfBaseClassExp(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getBaseClass() != null ) { mergeReturns(retVal,node.getBaseClass().apply(this)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this)); } mergeReturns(retVal,outAIsOfBaseClassExp(node)); return retVal; }
/** * Called by the {@link AIsOfBaseClassExp} node from {@link AIsOfBaseClassExp#apply(IAnalysis)}. * @param node the calling {@link AIsOfBaseClassExp} node */ public A caseAIsOfBaseClassExp(AIsOfBaseClassExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAIsOfBaseClassExp(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getBaseClass() != null ) { mergeReturns(retVal,node.getBaseClass().apply(this, question)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this, question)); } mergeReturns(retVal,outAIsOfBaseClassExp(node, question)); return retVal; }
@Override public SExpIR caseAIsOfBaseClassExp(AIsOfBaseClassExp node, IRInfo question) throws AnalysisException { String baseClass = node.getBaseClass().getName(); PExp exp = node.getExp(); SExpIR expCg = exp.apply(question.getExpVisitor(), question); AIsOfBaseClassExpIR isOfBaseClassExp = new AIsOfBaseClassExpIR(); isOfBaseClassExp.setBaseClass(baseClass); isOfBaseClassExp.setExp(expCg); return isOfBaseClassExp; }
@Override public PType caseAIsOfBaseClassExp(AIsOfBaseClassExp node, TypeCheckInfo question) throws AnalysisException { if (question.env.findType(node.getBaseClass(), null) == null) { TypeCheckerErrors.report(3114, "Undefined base class type: " + node.getBaseClass().getName(), node.getLocation(), node); } question.qualifiers = null; PType rt = node.getExp().apply(THIS, question.newConstraint(null)); if (!question.assistantFactory.createPTypeAssistant().isClass(rt, question.env)) { TypeCheckerErrors.report(3266, "Argument is not an object", node.getExp().getLocation(), node.getExp()); } node.setType(AstFactory.newABooleanBasicType(node.getLocation())); return question.assistantFactory.createPTypeAssistant().checkConstraint(question.constraint, node.getType(), node.getLocation()); }
@Override public Value caseAIsOfBaseClassExp(AIsOfBaseClassExp node, Context ctxt) throws AnalysisException { BreakpointManager.getBreakpoint(node).check(node.getLocation(), ctxt); node.getBaseClass().getLocation().hit(); try { Value v = node.getExp().apply(VdmRuntime.getExpressionEvaluator(), ctxt).deref(); if (!(v instanceof ObjectValue)) { return new BooleanValue(false); } ObjectValue ov = v.objectValue(ctxt); return new BooleanValue(search(node, ov)); } catch (ValueException e) { return VdmRuntimeError.abort(node.getLocation(), e); } }