/** * Creates a new tree field only constructor {@code ATypeMultipleBindIR TAG=type} 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 type_ the {@link STypeIR} node for the {@code type} child of this {@link ATypeMultipleBindIR} node */ public ATypeMultipleBindIR(List<? extends SPatternIR> patterns_, STypeIR type_) { super(null,null,null,patterns_); this.setType(type_); }
/** * Creates a new complete constructor {@code ATypeMultipleBindIR} 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 type_ the {@link STypeIR} node for the {@code type} child of this {@link ATypeMultipleBindIR} node */ public ATypeMultipleBindIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, List<? extends SPatternIR> patterns_, STypeIR type_) { super(sourceNode_,tag_,metaData_,patterns_); this.setType(type_); }
@Override public SMultipleBindIR caseATypeMultipleBind(ATypeMultipleBind node, IRInfo question) throws AnalysisException { List<PPattern> patterns = node.getPlist(); PType boundType = node.getType(); List<SPatternIR> patternsCg = new LinkedList<SPatternIR>(); for (PPattern pattern : patterns) { SPatternIR patternTempCg = pattern.apply(question.getPatternVisitor(), question); if (patternTempCg != null) { patternsCg.add(patternTempCg); } else { return null; } } STypeIR boundTypeCg = boundType.apply(question.getTypeVisitor(), question); ATypeMultipleBindIR multipleSetBind = new ATypeMultipleBindIR(); multipleSetBind.setPatterns(patternsCg); multipleSetBind.setType(boundTypeCg); return multipleSetBind; }
multipleTypeBind.setType(typeBind.getType());