@Override public PType caseALetBeStExp(ALetBeStExp node, TypeCheckInfo question) throws AnalysisException { Entry<PType, AMultiBindListDefinition> res = typecheckLetBeSt(node, node.getLocation(), node.getBind(), node.getSuchThat(), node.getValue(), question); node.setDef(res.getValue()); node.setType(res.getKey()); return node.getType(); }
/** * Called by the {@link ALetBeStExp} node from {@link ALetBeStExp#apply(IPOFAnalysis)}. * @param node the calling {@link ALetBeStExp} node */ public void caseALetBeStExp(ALetBeStExp node) throws AnalysisException { _visitedNodes.add(node); inALetBeStExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getBind() != null && !_visitedNodes.contains(node.getBind())) { node.getBind().apply(this); } if(node.getSuchThat() != null && !_visitedNodes.contains(node.getSuchThat())) { node.getSuchThat().apply(this); } if(node.getValue() != null && !_visitedNodes.contains(node.getValue())) { node.getValue().apply(this); } if(node.getDef() != null && !_visitedNodes.contains(node.getDef())) { node.getDef().apply(this); } outALetBeStExp(node); }
/** * Called by the {@link ALetBeStExp} node from {@link ALetBeStExp#apply(IAnalysis)}. * @param node the calling {@link ALetBeStExp} node */ public void caseALetBeStExp(ALetBeStExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inALetBeStExp(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getBind() != null && !_visitedNodes.contains(node.getBind())) { node.getBind().apply(this, question); } if(node.getSuchThat() != null && !_visitedNodes.contains(node.getSuchThat())) { node.getSuchThat().apply(this, question); } if(node.getValue() != null && !_visitedNodes.contains(node.getValue())) { node.getValue().apply(this, question); } if(node.getDef() != null && !_visitedNodes.contains(node.getDef())) { node.getDef().apply(this, question); } outALetBeStExp(node, question); }
/** * Called by the {@link ALetBeStExp} node from {@link ALetBeStExp#apply(IAnalysis)}. * @param node the calling {@link ALetBeStExp} node */ public void caseALetBeStExp(ALetBeStExp node) throws AnalysisException { _visitedNodes.add(node); inALetBeStExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getBind() != null && !_visitedNodes.contains(node.getBind())) { node.getBind().apply(this); } if(node.getSuchThat() != null && !_visitedNodes.contains(node.getSuchThat())) { node.getSuchThat().apply(this); } if(node.getValue() != null && !_visitedNodes.contains(node.getValue())) { node.getValue().apply(this); } if(node.getDef() != null && !_visitedNodes.contains(node.getDef())) { node.getDef().apply(this); } outALetBeStExp(node); }
@Override public SExpIR caseALetBeStExp(ALetBeStExp node, IRInfo question) throws AnalysisException { PMultipleBind multipleBind = node.getBind(); SMultipleBindIR multipleBindCg = multipleBind.apply(question.getMultipleBindVisitor(), question); PType type = node.getType(); PExp suchThat = node.getSuchThat(); PExp value = node.getValue(); STypeIR typeCg = type.apply(question.getTypeVisitor(), question); SExpIR suchThatCg = suchThat != null ? suchThat.apply(question.getExpVisitor(), question) : null; SExpIR valueCg = value.apply(question.getExpVisitor(), question); ALetBeStExpIR letBeStExp = new ALetBeStExpIR(); AHeaderLetBeStIR header = question.getExpAssistant().consHeader(multipleBindCg, suchThatCg); letBeStExp.setType(typeCg); letBeStExp.setHeader(header); letBeStExp.setValue(valueCg); return letBeStExp; }