@Override public Boolean caseAEnumMapExpIR(AEnumMapExpIR node) throws AnalysisException { for (AMapletExpIR m : node.getMembers()) { if (!m.apply(this)) { return false; } } return true; }
/** * Called by the {@link AMapletExpIR} node from {@link AMapletExpIR#apply(IIsaAnalysis)}. * @param node the calling {@link AMapletExpIR} node */ public void caseAMapletExpIR(AMapletExpIR node) throws AnalysisException { _visitedNodes.add(node); inAMapletExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outAMapletExpIR(node); }
/** * Returns a deep clone of this {@link AMapletExpIR} node. * @return a deep clone of this {@link AMapletExpIR} node */ public AMapletExpIR clone() { return new AMapletExpIR( _sourceNode, _tag, _metaData, cloneNode(_type), cloneNode(_left), cloneNode(_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; }
@Override protected List<SStmIR> getConditionalAdd(AIdentifierVarExpIR setVar, List<SPatternIR> patterns, SPatternIR pattern) { AIdentifierVarExpIR mapCompResult = new AIdentifierVarExpIR(); mapCompResult.setType(compType.clone()); mapCompResult.setName(idPattern.getName()); mapCompResult.setIsLambda(false); mapCompResult.setIsLocal(true); AMapCompAddStmIR add = new AMapCompAddStmIR(); add.setMap(mapCompResult); add.setElement(first.clone()); return consConditionalAdd(mapCompResult, add); } }
/** * 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_); }
/** * Called by the {@link AMapletExpIR} node from {@link AMapletExpIR#apply(IAnalysis)}. * @param node the calling {@link AMapletExpIR} node */ public void caseAMapletExpIR(AMapletExpIR node) throws AnalysisException { _visitedNodes.add(node); inAMapletExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outAMapletExpIR(node); }
/** * Called by the {@link AEnumMapExpIR} node from {@link AEnumMapExpIR#apply(IIsaAnalysis)}. * @param node the calling {@link AEnumMapExpIR} node */ public void caseAEnumMapExpIR(AEnumMapExpIR node) throws AnalysisException { _visitedNodes.add(node); inAEnumMapExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } { List<AMapletExpIR> copy = new ArrayList<AMapletExpIR>(node.getMembers()); for( AMapletExpIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outAEnumMapExpIR(node); }
/** * Creates a deep clone of this {@link AMapletExpIR} 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 AMapletExpIR} node */ public AMapletExpIR clone(Map<INode,INode> oldToNewMap) { AMapletExpIR node = new AMapletExpIR( _sourceNode, _tag, _metaData, cloneNode(_type, oldToNewMap), cloneNode(_left, oldToNewMap), cloneNode(_right, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link AMapletExpIR} node from {@link AMapletExpIR#apply(IAnalysis)}. * @param node the calling {@link AMapletExpIR} node */ public void caseAMapletExpIR(AMapletExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAMapletExpIR(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this, question); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this, question); } outAMapletExpIR(node, question); }
/** * Called by the {@link AEnumMapExpIR} node from {@link AEnumMapExpIR#apply(IAnalysis)}. * @param node the calling {@link AEnumMapExpIR} node */ public void caseAEnumMapExpIR(AEnumMapExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAEnumMapExpIR(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } { List<AMapletExpIR> copy = new ArrayList<AMapletExpIR>(node.getMembers()); for( AMapletExpIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } outAEnumMapExpIR(node, question); }
/** * Called by the {@link AMapletExpIR} node from {@link AMapletExpIR#apply(IAnalysis)}. * @param node the calling {@link AMapletExpIR} node */ public A caseAMapletExpIR(AMapletExpIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAMapletExpIR(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { mergeReturns(retVal,node.getLeft().apply(this)); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { mergeReturns(retVal,node.getRight().apply(this)); } mergeReturns(retVal,outAMapletExpIR(node)); return retVal; }
/** * Called by the {@link AEnumMapExpIR} node from {@link AEnumMapExpIR#apply(IAnalysis)}. * @param node the calling {@link AEnumMapExpIR} node */ public void caseAEnumMapExpIR(AEnumMapExpIR node) throws AnalysisException { _visitedNodes.add(node); inAEnumMapExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } { List<AMapletExpIR> copy = new ArrayList<AMapletExpIR>(node.getMembers()); for( AMapletExpIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outAEnumMapExpIR(node); }
/** * Called by the {@link AMapletExpIR} node from {@link AMapletExpIR#apply(IAnalysis)}. * @param node the calling {@link AMapletExpIR} node */ public A caseAMapletExpIR(AMapletExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAMapletExpIR(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { mergeReturns(retVal,node.getLeft().apply(this, question)); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { mergeReturns(retVal,node.getRight().apply(this, question)); } mergeReturns(retVal,outAMapletExpIR(node, question)); return retVal; }
/** * Called by the {@link AEnumMapExpIR} node from {@link AEnumMapExpIR#apply(IAnalysis)}. * @param node the calling {@link AEnumMapExpIR} node */ public A caseAEnumMapExpIR(AEnumMapExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAEnumMapExpIR(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } { List<AMapletExpIR> copy = new ArrayList<AMapletExpIR>(node.getMembers()); for( AMapletExpIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } mergeReturns(retVal,outAEnumMapExpIR(node, question)); return retVal; }
/** * Called by the {@link AEnumMapExpIR} node from {@link AEnumMapExpIR#apply(IAnalysis)}. * @param node the calling {@link AEnumMapExpIR} node */ public A caseAEnumMapExpIR(AEnumMapExpIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAEnumMapExpIR(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } { List<AMapletExpIR> copy = new ArrayList<AMapletExpIR>(node.getMembers()); for( AMapletExpIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } mergeReturns(retVal,outAEnumMapExpIR(node)); return retVal; }
node.getFirst().apply(this);
node.getFirst().apply(this);