@Override public PType defaultPObjectDesignator(PObjectDesignator node, TypeCheckInfo question) throws AnalysisException { return node.apply(tcOthers, question); }
/** * Called by the {@link AApplyObjectDesignator} node from {@link AApplyObjectDesignator#apply(IPOFAnalysis)}. * @param node the calling {@link AApplyObjectDesignator} node */ public void caseAApplyObjectDesignator(AApplyObjectDesignator node) throws AnalysisException { _visitedNodes.add(node); inAApplyObjectDesignator(node); if(node.getObject() != null && !_visitedNodes.contains(node.getObject())) { node.getObject().apply(this); } { List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outAApplyObjectDesignator(node); }
/** * Called by the {@link AApplyObjectDesignator} node from {@link AApplyObjectDesignator#apply(IAnalysis)}. * @param node the calling {@link AApplyObjectDesignator} node */ public void caseAApplyObjectDesignator(AApplyObjectDesignator node, Q question) throws AnalysisException { _visitedNodes.add(node); inAApplyObjectDesignator(node, question); if(node.getObject() != null && !_visitedNodes.contains(node.getObject())) { node.getObject().apply(this, question); } { List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } outAApplyObjectDesignator(node, question); }
/** * Called by the {@link AApplyObjectDesignator} node from {@link AApplyObjectDesignator#apply(IAnalysis)}. * @param node the calling {@link AApplyObjectDesignator} node */ public void caseAApplyObjectDesignator(AApplyObjectDesignator node) throws AnalysisException { _visitedNodes.add(node); inAApplyObjectDesignator(node); if(node.getObject() != null && !_visitedNodes.contains(node.getObject())) { node.getObject().apply(this); } { List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outAApplyObjectDesignator(node); }
/** * Called by the {@link AApplyObjectDesignator} node from {@link AApplyObjectDesignator#apply(IAnalysis)}. * @param node the calling {@link AApplyObjectDesignator} node */ public A caseAApplyObjectDesignator(AApplyObjectDesignator node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAApplyObjectDesignator(node, question)); if(node.getObject() != null && !_visitedNodes.contains(node.getObject())) { mergeReturns(retVal,node.getObject().apply(this, question)); } { List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } mergeReturns(retVal,outAApplyObjectDesignator(node, question)); return retVal; }
/** * Called by the {@link AApplyObjectDesignator} node from {@link AApplyObjectDesignator#apply(IAnalysis)}. * @param node the calling {@link AApplyObjectDesignator} node */ public A caseAApplyObjectDesignator(AApplyObjectDesignator node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAApplyObjectDesignator(node)); if(node.getObject() != null && !_visitedNodes.contains(node.getObject())) { mergeReturns(retVal,node.getObject().apply(this)); } { List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } mergeReturns(retVal,outAApplyObjectDesignator(node)); return retVal; }
@Override public SObjectDesignatorIR caseAApplyObjectDesignator( AApplyObjectDesignator node, IRInfo question) throws AnalysisException { PObjectDesignator obj = node.getObject(); SObjectDesignatorIR objCg = obj.apply(question.getObjectDesignatorVisitor(), question); AApplyObjectDesignatorIR applyObjDesignator = new AApplyObjectDesignatorIR(); applyObjDesignator.setObject(objCg); LinkedList<SExpIR> newExpArgs = applyObjDesignator.getArgs(); for (PExp arg : node.getArgs()) { SExpIR argCg = arg.apply(question.getExpVisitor(), question); if (argCg != null) { newExpArgs.add(argCg); } else { return null; } } return applyObjDesignator; }
/** * Called by the {@link AFieldObjectDesignator} node from {@link AFieldObjectDesignator#apply(IPOFAnalysis)}. * @param node the calling {@link AFieldObjectDesignator} node */ public void caseAFieldObjectDesignator(AFieldObjectDesignator node) throws AnalysisException { _visitedNodes.add(node); inAFieldObjectDesignator(node); if(node.getObject() != null && !_visitedNodes.contains(node.getObject())) { node.getObject().apply(this); } if(node.getClassName() != null ) { node.getClassName().apply(this); } if(node.getFieldName() != null ) { node.getFieldName().apply(this); } if(node.getField() != null ) { node.getField().apply(this); } outAFieldObjectDesignator(node); }
node.getDesignator().apply(this);
node.getDesignator().apply(this);
node.getDesignator().apply(this, question);
/** * Called by the {@link AFieldObjectDesignator} node from {@link AFieldObjectDesignator#apply(IAnalysis)}. * @param node the calling {@link AFieldObjectDesignator} node */ public void caseAFieldObjectDesignator(AFieldObjectDesignator node) throws AnalysisException { _visitedNodes.add(node); inAFieldObjectDesignator(node); if(node.getObject() != null && !_visitedNodes.contains(node.getObject())) { node.getObject().apply(this); } if(node.getClassName() != null ) { node.getClassName().apply(this); } if(node.getFieldName() != null ) { node.getFieldName().apply(this); } if(node.getField() != null ) { node.getField().apply(this); } outAFieldObjectDesignator(node); }
/** * Called by the {@link AFieldObjectDesignator} node from {@link AFieldObjectDesignator#apply(IAnalysis)}. * @param node the calling {@link AFieldObjectDesignator} node */ public void caseAFieldObjectDesignator(AFieldObjectDesignator node, Q question) throws AnalysisException { _visitedNodes.add(node); inAFieldObjectDesignator(node, question); if(node.getObject() != null && !_visitedNodes.contains(node.getObject())) { node.getObject().apply(this, question); } if(node.getClassName() != null ) { node.getClassName().apply(this, question); } if(node.getFieldName() != null ) { node.getFieldName().apply(this, question); } if(node.getField() != null ) { node.getField().apply(this, question); } outAFieldObjectDesignator(node, question); }
mergeReturns(retVal,node.getDesignator().apply(this));
mergeReturns(retVal,node.getDesignator().apply(this, question));
/** * Called by the {@link AFieldObjectDesignator} node from {@link AFieldObjectDesignator#apply(IAnalysis)}. * @param node the calling {@link AFieldObjectDesignator} node */ public A caseAFieldObjectDesignator(AFieldObjectDesignator node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAFieldObjectDesignator(node, question)); if(node.getObject() != null && !_visitedNodes.contains(node.getObject())) { mergeReturns(retVal,node.getObject().apply(this, question)); } if(node.getClassName() != null ) { mergeReturns(retVal,node.getClassName().apply(this, question)); } if(node.getFieldName() != null ) { mergeReturns(retVal,node.getFieldName().apply(this, question)); } if(node.getField() != null ) { mergeReturns(retVal,node.getField().apply(this, question)); } mergeReturns(retVal,outAFieldObjectDesignator(node, question)); return retVal; }
/** * Called by the {@link AFieldObjectDesignator} node from {@link AFieldObjectDesignator#apply(IAnalysis)}. * @param node the calling {@link AFieldObjectDesignator} node */ public A caseAFieldObjectDesignator(AFieldObjectDesignator node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAFieldObjectDesignator(node)); if(node.getObject() != null && !_visitedNodes.contains(node.getObject())) { mergeReturns(retVal,node.getObject().apply(this)); } if(node.getClassName() != null ) { mergeReturns(retVal,node.getClassName().apply(this)); } if(node.getFieldName() != null ) { mergeReturns(retVal,node.getFieldName().apply(this)); } if(node.getField() != null ) { mergeReturns(retVal,node.getField().apply(this)); } mergeReturns(retVal,outAFieldObjectDesignator(node)); return retVal; }
@Override public SObjectDesignatorIR caseAFieldObjectDesignator( AFieldObjectDesignator node, IRInfo question) throws AnalysisException { PObjectDesignator obj = node.getObject(); String fieldCg = null; String fieldModuleCg = null; if (node.getField() != null) { fieldCg = node.getField().getName(); fieldModuleCg = node.getField().getModule(); } else { fieldCg = node.getFieldName() != null ? node.getFieldName().getName() : null; } SObjectDesignatorIR objCg = obj.apply(question.getObjectDesignatorVisitor(), question); AFieldObjectDesignatorIR fieldObjDesignator = new AFieldObjectDesignatorIR(); fieldObjDesignator.setFieldName(fieldCg); fieldObjDesignator.setFieldModule(fieldModuleCg); fieldObjDesignator.setObject(objCg); return fieldObjDesignator; }
Value val = node.getObject().apply(VdmRuntime.getStatementEvaluator(), ctxt).deref();
PType type = node.getObject().apply(THIS, new TypeCheckInfo(question.assistantFactory, question.env, null, argtypes)); boolean unique = !question.assistantFactory.createPTypeAssistant().isUnion(type); PTypeSet result = new PTypeSet(question.assistantFactory);