@Override public String caseASeqSeqType(ASeqSeqType type) throws AnalysisException { return type.getEmpty() ? "[]" : "seq of (" + type.getSeqof() + ")"; }
@Override public PTypeList caseASeqSeqType(ASeqSeqType node) throws AnalysisException { return node.getSeqof().apply(THIS); }
@Override public LexNameSet caseASeqSeqType(ASeqSeqType node, FreeVarInfo info) throws AnalysisException { return node.getSeqof().apply(this, info); }
@Override public String caseASeqSeqType(ASeqSeqType node, PrettyPrinterEnv question) throws AnalysisException { return "" + "" + (node.getEmpty() ? "[]" : "seq of (" + node.getSeqof().apply(this, question) + ")"); }
/** * Called by the {@link ASeqSeqType} node from {@link ASeqSeqType#apply(IPOFAnalysis)}. * @param node the calling {@link ASeqSeqType} node */ public void caseASeqSeqType(ASeqSeqType node) throws AnalysisException { _visitedNodes.add(node); inASeqSeqType(node); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getSeqof() != null && !_visitedNodes.contains(node.getSeqof())) { node.getSeqof().apply(this); } outASeqSeqType(node); }
/** * Called by the {@link ASeqSeqType} node from {@link ASeqSeqType#apply(IAnalysis)}. * @param node the calling {@link ASeqSeqType} node */ public void caseASeqSeqType(ASeqSeqType node) throws AnalysisException { _visitedNodes.add(node); inASeqSeqType(node); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getSeqof() != null && !_visitedNodes.contains(node.getSeqof())) { node.getSeqof().apply(this); } outASeqSeqType(node); }
/** * Called by the {@link ASeqSeqType} node from {@link ASeqSeqType#apply(IAnalysis)}. * @param node the calling {@link ASeqSeqType} node */ public void caseASeqSeqType(ASeqSeqType node, Q question) throws AnalysisException { _visitedNodes.add(node); inASeqSeqType(node, question); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } if(node.getSeqof() != null && !_visitedNodes.contains(node.getSeqof())) { node.getSeqof().apply(this, question); } outASeqSeqType(node, question); }
@Override public Boolean caseASeqSeqType(ASeqSeqType type, Object other) throws AnalysisException { other = deBracket((PType) other); if (other instanceof ASeqSeqType) { ASeqSeqType os = (ASeqSeqType) other; // NB. Empty sequence is the same type as any sequence return type.getEmpty() || os.getEmpty() || af.createPTypeAssistant().equals(type.getSeqof(), os.getSeqof()); } return false; }
/** * Called by the {@link ASeqSeqType} node from {@link ASeqSeqType#apply(IAnalysis)}. * @param node the calling {@link ASeqSeqType} node */ public A caseASeqSeqType(ASeqSeqType node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inASeqSeqType(node)); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } if(node.getSeqof() != null && !_visitedNodes.contains(node.getSeqof())) { mergeReturns(retVal,node.getSeqof().apply(this)); } mergeReturns(retVal,outASeqSeqType(node)); return retVal; }
/** * Called by the {@link ASeqSeqType} node from {@link ASeqSeqType#apply(IAnalysis)}. * @param node the calling {@link ASeqSeqType} node */ public A caseASeqSeqType(ASeqSeqType node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inASeqSeqType(node, question)); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } if(node.getSeqof() != null && !_visitedNodes.contains(node.getSeqof())) { mergeReturns(retVal,node.getSeqof().apply(this, question)); } mergeReturns(retVal,outASeqSeqType(node, question)); return retVal; }
ASeq1SeqType s1t = AstFactory.newASeq1SeqType(st.getLocation(), st.getSeqof());