/** * 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) ); }
/** * Creates a new tree field only constructor {@code AMkBasicExpIR TAG=mkBasic} 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 arg_ the {@link SExpIR} node for the {@code arg} child of this {@link AMkBasicExpIR} node */ public AMkBasicExpIR(STypeIR type_, SExpIR arg_) { super(null,null,null,type_); this.setArg(arg_); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof AMkBasicExpIR) { return toString().equals(o.toString()); } return false; }
/** * Called by the {@link AMkBasicExpIR} node from {@link AMkBasicExpIR#apply(IAnalysis)}. * @param node the calling {@link AMkBasicExpIR} node */ public void caseAMkBasicExpIR(AMkBasicExpIR node) throws AnalysisException { _visitedNodes.add(node); inAMkBasicExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getArg() != null && !_visitedNodes.contains(node.getArg())) { node.getArg().apply(this); } outAMkBasicExpIR(node); }
@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; }
/** * Called by the {@link AMkBasicExpIR} node from {@link AMkBasicExpIR#apply(IAnalysis)}. * @param node the calling {@link AMkBasicExpIR} node */ public void caseAMkBasicExpIR(AMkBasicExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAMkBasicExpIR(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getArg() != null && !_visitedNodes.contains(node.getArg())) { node.getArg().apply(this, question); } outAMkBasicExpIR(node, question); }
/** * Called by the {@link AMkBasicExpIR} node from {@link AMkBasicExpIR#apply(IIsaAnalysis)}. * @param node the calling {@link AMkBasicExpIR} node */ public void caseAMkBasicExpIR(AMkBasicExpIR node) throws AnalysisException { _visitedNodes.add(node); inAMkBasicExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getArg() != null && !_visitedNodes.contains(node.getArg())) { node.getArg().apply(this); } outAMkBasicExpIR(node); }
/** * 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; }
/** * Creates a new complete constructor {@code AMkBasicExpIR} 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 arg_ the {@link SExpIR} node for the {@code arg} child of this {@link AMkBasicExpIR} node */ public AMkBasicExpIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, STypeIR type_, SExpIR arg_) { super(sourceNode_,tag_,metaData_,type_); this.setArg(arg_); }
/** * Called by the {@link AMkBasicExpIR} node from {@link AMkBasicExpIR#apply(IAnalysis)}. * @param node the calling {@link AMkBasicExpIR} node */ public A caseAMkBasicExpIR(AMkBasicExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAMkBasicExpIR(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getArg() != null && !_visitedNodes.contains(node.getArg())) { mergeReturns(retVal,node.getArg().apply(this, question)); } mergeReturns(retVal,outAMkBasicExpIR(node, question)); return retVal; }
/** * Called by the {@link AMkBasicExpIR} node from {@link AMkBasicExpIR#apply(IAnalysis)}. * @param node the calling {@link AMkBasicExpIR} node */ public A caseAMkBasicExpIR(AMkBasicExpIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAMkBasicExpIR(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getArg() != null && !_visitedNodes.contains(node.getArg())) { mergeReturns(retVal,node.getArg().apply(this)); } mergeReturns(retVal,outAMkBasicExpIR(node)); return retVal; }