/** * Creates a new complete constructor {@code AApplyExpIR} 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 root_ the {@link SExpIR} node for the {@code root} child of this {@link AApplyExpIR} node * @param args_ the {@link NodeList} node for the {@code args} child of this {@link AApplyExpIR} node */ public AApplyExpIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, STypeIR type_, SExpIR root_, List<? extends SExpIR> args_) { super(sourceNode_,tag_,metaData_,type_); this.setRoot(root_); this.setArgs(args_); }
/** * Creates a new tree field only constructor {@code AApplyExpIR TAG=apply} 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 root_ the {@link SExpIR} node for the {@code root} child of this {@link AApplyExpIR} node * @param args_ the {@link NodeList} node for the {@code args} child of this {@link AApplyExpIR} node */ public AApplyExpIR(STypeIR type_, SExpIR root_, List<? extends SExpIR> args_) { super(null,null,null,type_); this.setRoot(root_); this.setArgs(args_); }
@SuppressWarnings("unchecked") @Override public SExpIR caseAApplyObjectDesignatorIR(AApplyObjectDesignatorIR node) throws AnalysisException { SObjectDesignatorIR object = node.getObject(); SourceNode sourceNode = node.getSourceNode(); LinkedList<SExpIR> args = node.getArgs(); SExpIR root = object.apply(this); STypeIR rootType = root.getType(); STypeIR applyType = null; if (rootType instanceof SSeqTypeIR) { applyType = ((SSeqTypeIR) rootType).getSeqOf(); } else if (rootType instanceof SMapTypeIR) { applyType = ((SMapTypeIR) rootType).getTo(); } else if (rootType instanceof AMethodTypeIR) { applyType = ((AMethodTypeIR) rootType).getResult(); } applyType = applyType.clone(); AApplyExpIR applyExp = new AApplyExpIR(); applyExp.setArgs((List<? extends SExpIR>) args.clone()); applyExp.setRoot(root); applyExp.setType(applyType); applyExp.setSourceNode(sourceNode); return applyExp; }