/** * Creates a new complete constructor {@code AMapletExpIR} 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 left_ the {@link SExpIR} node for the {@code left} child of this {@link AMapletExpIR} node * @param right_ the {@link SExpIR} node for the {@code right} child of this {@link AMapletExpIR} node */ public AMapletExpIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, STypeIR type_, SExpIR left_, SExpIR right_) { super(sourceNode_,tag_,metaData_,type_); this.setLeft(left_); this.setRight(right_); }
/** * Creates a new tree field only constructor {@code AMapletExpIR TAG=maplet} 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 left_ the {@link SExpIR} node for the {@code left} child of this {@link AMapletExpIR} node * @param right_ the {@link SExpIR} node for the {@code right} child of this {@link AMapletExpIR} node */ public AMapletExpIR(STypeIR type_, SExpIR left_, SExpIR right_) { super(null,null,null,type_); this.setLeft(left_); this.setRight(right_); }
@Override public SExpIR caseAMapletExp(AMapletExp node, IRInfo question) throws AnalysisException { PType type = node.getType(); PExp left = node.getLeft(); PExp right = node.getRight(); STypeIR typeCg = type.apply(question.getTypeVisitor(), question); SExpIR leftCg = left.apply(question.getExpVisitor(), question); SExpIR rightCg = right.apply(question.getExpVisitor(), question); AMapletExpIR maplet = new AMapletExpIR(); maplet.setType(typeCg); maplet.setLeft(leftCg); maplet.setRight(rightCg); return maplet; }