@Override public String caseAQuoteType(AQuoteType type) throws AnalysisException { return "<" + type.getValue() + ">"; }
/** * Returns a deep clone of this {@link AQuoteType} node. * @return a deep clone of this {@link AQuoteType} node */ public AQuoteType clone() { return new AQuoteType( _location, _resolved, _definitions, cloneNode(_value) ); }
/** * Creates a new tree field only constructor {@code AQuoteType TAG=quote} 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 value_ the {@link ILexQuoteToken} node for the {@code value} child of this {@link AQuoteType} node */ public AQuoteType(ILexLocation location_, Boolean resolved_, ILexQuoteToken value_) { super(location_,resolved_,null); this.setValue(value_); }
/** * 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); }
public static AQuoteType newAQuoteType(ILexQuoteToken token) { AQuoteType result = new AQuoteType(); initType(result, token.getLocation()); result.setValue(token); return result; }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof AQuoteType) { return toString().equals(o.toString()); } return false; }
/** * 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 public Integer caseAQuoteType(AQuoteType type) throws AnalysisException { return type.getValue().hashCode(); }
/** * Creates a deep clone of this {@link AQuoteType} 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 AQuoteType} node */ public AQuoteType clone(Map<INode,INode> oldToNewMap) { AQuoteType node = new AQuoteType( _location, _resolved, _definitions, cloneNode(_value, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Creates a new complete constructor {@code AQuoteType} 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 value_ the {@link ILexQuoteToken} node for the {@code value} child of this {@link AQuoteType} node */ public AQuoteType(ILexLocation location_, Boolean resolved_, List<? extends PDefinition> definitions_, ILexQuoteToken value_) { super(location_,resolved_,definitions_); this.setValue(value_); }
/** * 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; }
/** * 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; }
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); } }
@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 ValueList caseAQuoteType(AQuoteType type, Context ctxt) throws AnalysisException { ValueList v = new ValueList(); v.add(new QuoteValue(type.getValue().getValue())); return v; }
@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; }