/** * Called by the {@link ASystemClassDeclIR} node from {@link ASystemClassDeclIR#apply(IAnalysis)}. * @param node the calling {@link ASystemClassDeclIR} node */ public void inASystemClassDeclIR(ASystemClassDeclIR node) throws AnalysisException { defaultInSClassDeclIR(node); }
/** * Called by the {@link PIR} node from {@link PIR#apply(IAnalysis)}. * @param node the calling {@link PIR} node */ public void defaultPIR(PIR node) throws AnalysisException { defaultINode(node); }
/** * Called by the {@link PExternalType} node from {@link PExternalType#apply(IAnalysis)}. * @param node the calling {@link PExternalType} node */ public void inPExternalType(PExternalType node) throws AnalysisException { defaultInINode(node); }
@Override public void caseAApplyExpIR(AApplyExpIR node) throws AnalysisException { super.caseAApplyExpIR(node);
@Override public void caseAGeneralIsExpIR(AGeneralIsExpIR node) throws AnalysisException { super.caseAGeneralIsExpIR(node); SExpIR isExp = consIsExp(node.getExp(), node.getCheckedType()); if (isExp == null) { assist.getInfo().addTransformationWarning(node, "The 'is' expression is not supported for type: " + node.getCheckedType().getClass().getName()); return; } else { assist.replaceNodeWith(node, isExp); } }
@Override public void caseAMethodDeclIR(AMethodDeclIR node) throws AnalysisException { super.caseAMethodDeclIR(node); String name = node.getName(); if(node.getIsConstructor() && mustRename(name)) { node.setName(consNewName(name)); } }
@Override public void caseANonDeterministicBlockStmIR(ANonDeterministicBlockStmIR node) throws AnalysisException { super.caseANonDeterministicBlockStmIR(node); ABlockStmIR block = new ABlockStmIR(); block.setScoped(false); block.setTag(node.getTag()); block.setSourceNode(node.getSourceNode()); if(!node.getStatements().isEmpty()) { // Just use the first statement block.getStatements().add(node.getStatements().getFirst().clone()); } else { log.error("nondeterministic statement block did not contain any statements: " + node); } assist.replaceNodeWith(node, block); } }
imp.apply(new DepthFirstAnalysisAdaptor()
@Override public void caseAFuncDeclIR(AFuncDeclIR node) throws AnalysisException { super.caseAFuncDeclIR(node); if (!node.getTemplateTypes().isEmpty()) { for(ATemplateTypeIR t : node.getTemplateTypes()) { AFormalParamLocalParamIR param = new AFormalParamLocalParamIR(); param.setType(new AUnknownTypeIR()); param.setPattern(assist.getInfo().getPatternAssistant().consIdPattern(toTypeArgName(t))); node.getFormalParams().add(param); } } }
@Override public void caseAPlainCallStmIR(APlainCallStmIR node) throws AnalysisException { super.caseAPlainCallStmIR(node);
@Override public void caseAApplyExpIR(AApplyExpIR node) throws AnalysisException { super.caseAApplyExpIR(node);
/** * Called by the {@link ACpuClassDeclIR} node from {@link ACpuClassDeclIR#apply(IAnalysis)}. * @param node the calling {@link ACpuClassDeclIR} node */ public void inACpuClassDeclIR(ACpuClassDeclIR node) throws AnalysisException { defaultInSClassDeclIR(node); }
/** * Called by the {@link PIR} node from {@link PIR#apply(IAnalysis)}. * @param node the calling {@link PIR} node */ public void inPIR(PIR node) throws AnalysisException { defaultInINode(node); }
/** * Called by the {@link PExternalType} node from {@link PExternalType#apply(IAnalysis)}. * @param node the calling {@link PExternalType} node */ public void defaultPExternalType(PExternalType node) throws AnalysisException { defaultINode(node); }
/** * Called by the {@link ADefaultClassDeclIR} node from {@link ADefaultClassDeclIR#apply(IAnalysis)}. * @param node the calling {@link ADefaultClassDeclIR} node */ public void inADefaultClassDeclIR(ADefaultClassDeclIR node) throws AnalysisException { defaultInSClassDeclIR(node); }
/** * Called by the {@link PExternalType} node from {@link PExternalType#apply(IAnalysis)}. * @param node the calling {@link PExternalType} node */ public void defaultInPExternalType(PExternalType node) throws AnalysisException { defaultInINode(node); }
/** * Called by the {@link ABusClassDeclIR} node from {@link ABusClassDeclIR#apply(IAnalysis)}. * @param node the calling {@link ABusClassDeclIR} node */ public void inABusClassDeclIR(ABusClassDeclIR node) throws AnalysisException { defaultInSClassDeclIR(node); }
/** * Called by the {@link PIR} node from {@link PIR#apply(IAnalysis)}. * @param node the calling {@link PIR} node */ public void defaultInPIR(PIR node) throws AnalysisException { defaultInINode(node); }
@Override public void defaultInSClassDeclIR(SClassDeclIR node) throws AnalysisException { if(Settings.dialect != Dialect.VDM_SL) { return; } init(); super.defaultInSClassDeclIR(node); String name = node.getName(); if(mustRename(name)) { node.setName(consNewName(name)); } }