@Override public String caseAQuoteType(AQuoteType type) throws AnalysisException { return "<" + type.getValue() + ">"; }
@Override public Integer caseAQuoteType(AQuoteType type) throws AnalysisException { return type.getValue().hashCode(); }
public void removeIllegalQuoteTypes(List<PType> types) { List<Integer> illegalIndices = new LinkedList<>(); for (int i = 0; i < types.size(); i++) { PType t = types.get(i); if (t instanceof AQuoteType && ((AQuoteType) t).getValue().getValue().equals(IRConstants.ILLEGAL_QUOTE_VALUE)) { illegalIndices.add(i); } } for (int i = illegalIndices.size() - 1; i >= 0; i--) { types.remove(i); } }
/** * Called by the {@link AQuoteType} node from {@link AQuoteType#apply(IAnalysis)}. * @param node the calling {@link AQuoteType} node */ public void caseAQuoteType(AQuoteType node, Q question) throws AnalysisException { _visitedNodes.add(node); inAQuoteType(node, question); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } if(node.getValue() != null ) { node.getValue().apply(this, question); } outAQuoteType(node, question); }
/** * Called by the {@link AQuoteType} node from {@link AQuoteType#apply(IAnalysis)}. * @param node the calling {@link AQuoteType} node */ public void caseAQuoteType(AQuoteType node) throws AnalysisException { _visitedNodes.add(node); inAQuoteType(node); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getValue() != null ) { node.getValue().apply(this); } outAQuoteType(node); }
/** * Called by the {@link AQuoteType} node from {@link AQuoteType#apply(IPOFAnalysis)}. * @param node the calling {@link AQuoteType} node */ public void caseAQuoteType(AQuoteType node) throws AnalysisException { _visitedNodes.add(node); inAQuoteType(node); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getValue() != null ) { node.getValue().apply(this); } outAQuoteType(node); }
@Override protected Value convertValueTo(PType to, Context ctxt, Set<PType> done) throws AnalysisException { if (to instanceof AQuoteType) { AQuoteType qto = (AQuoteType) to; if (!qto.getValue().getValue().equals(value)) { abort(4074, "Cannot convert " + this + " to " + to, ctxt); } return this; } else { return super.convertValueTo(to, ctxt, done); } }
@Override public STypeIR caseAQuoteType(AQuoteType node, IRInfo question) throws AnalysisException { String value = node.getValue().getValue(); AQuoteTypeIR quoteTypeCg = new AQuoteTypeIR(); quoteTypeCg.setValue(value); question.registerQuoteValue(value); return quoteTypeCg; }
@Override public ValueList caseAQuoteType(AQuoteType type, Context ctxt) throws AnalysisException { ValueList v = new ValueList(); v.add(new QuoteValue(type.getValue().getValue())); return v; }
/** * Called by the {@link AQuoteType} node from {@link AQuoteType#apply(IAnalysis)}. * @param node the calling {@link AQuoteType} node */ public A caseAQuoteType(AQuoteType node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAQuoteType(node)); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } if(node.getValue() != null ) { mergeReturns(retVal,node.getValue().apply(this)); } mergeReturns(retVal,outAQuoteType(node)); return retVal; }
/** * Called by the {@link AQuoteType} node from {@link AQuoteType#apply(IAnalysis)}. * @param node the calling {@link AQuoteType} node */ public A caseAQuoteType(AQuoteType node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAQuoteType(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.getValue() != null ) { mergeReturns(retVal,node.getValue().apply(this, question)); } mergeReturns(retVal,outAQuoteType(node, question)); return retVal; }