/** * Creates a new complete constructor {@code ACaseAltStmStmIR} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param pattern_ the {@link SPatternIR} node for the {@code pattern} child of this {@link ACaseAltStmStmIR} node * @param result_ the {@link SStmIR} node for the {@code result} child of this {@link ACaseAltStmStmIR} node * @param patternType_ the {@link STypeIR} node for the {@code patternType} child of this {@link ACaseAltStmStmIR} node */ public ACaseAltStmStmIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, SPatternIR pattern_, SStmIR result_, STypeIR patternType_) { super(sourceNode_,tag_,metaData_); this.setPattern(pattern_); this.setResult(result_); this.setPatternType(patternType_); }
@Override public SStmIR caseACaseAlternativeStm(ACaseAlternativeStm node, IRInfo question) throws AnalysisException { PPattern pattern = node.getPattern(); PStm result = node.getResult(); SPatternIR patternCg = pattern.apply(question.getPatternVisitor(), question); SStmIR resultCg = result.apply(question.getStmVisitor(), question); ACaseAltStmStmIR caseCg = new ACaseAltStmStmIR(); caseCg.setPattern(patternCg); caseCg.setResult(resultCg); return caseCg; }
/** * Creates a new tree field only constructor {@code ACaseAltStmStmIR TAG=case} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param pattern_ the {@link SPatternIR} node for the {@code pattern} child of this {@link ACaseAltStmStmIR} node * @param result_ the {@link SStmIR} node for the {@code result} child of this {@link ACaseAltStmStmIR} node * @param patternType_ the {@link STypeIR} node for the {@code patternType} child of this {@link ACaseAltStmStmIR} node */ public ACaseAltStmStmIR(SPatternIR pattern_, SStmIR result_, STypeIR patternType_) { super(null,null,null); this.setPattern(pattern_); this.setResult(result_); this.setPatternType(patternType_); }
altStm.setPattern(altExp.getPattern().clone()); altStm.setResult(assignToVar(resultVar, altExp.getResult())); altStm.setPatternType(altExp.getPatternType().clone());