/** * Creates a deep clone of this {@link AMkBasicExpIR} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link AMkBasicExpIR} node */ public AMkBasicExpIR clone(Map<INode,INode> oldToNewMap) { AMkBasicExpIR node = new AMkBasicExpIR( _sourceNode, _tag, _metaData, cloneNode(_type, oldToNewMap), cloneNode(_arg, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Returns a deep clone of this {@link AMkBasicExpIR} node. * @return a deep clone of this {@link AMkBasicExpIR} node */ public AMkBasicExpIR clone() { return new AMkBasicExpIR( _sourceNode, _tag, _metaData, cloneNode(_type), cloneNode(_arg) ); }
@Override public SExpIR caseAMkBasicExp(AMkBasicExp node, IRInfo question) throws AnalysisException { PType type = node.getType(); if (!(type instanceof ATokenBasicType)) { question.addUnsupportedNode(node, "Expected token type for mk basic expression. Got: " + type); return null; } PExp arg = node.getArg(); STypeIR typeCg = type.apply(question.getTypeVisitor(), question); SExpIR argCg = arg.apply(question.getExpVisitor(), question); AMkBasicExpIR mkBasicExp = new AMkBasicExpIR(); mkBasicExp.setType(typeCg); mkBasicExp.setArg(argCg); return mkBasicExp; }