@Override public PType caseAQuotePattern(AQuotePattern pattern) throws AnalysisException { return AstFactory.newAQuoteType(((AQuotePattern) pattern).getValue().clone()); }
public static AQuoteType newAQuoteType(ILexQuoteToken token) { AQuoteType result = new AQuoteType(); initType(result, token.getLocation()); result.setValue(token); return result; }
/** * Called by the {@link AQuotePattern} node from {@link AQuotePattern#apply(IPOFAnalysis)}. * @param node the calling {@link AQuotePattern} node */ public void caseAQuotePattern(AQuotePattern node) throws AnalysisException { _visitedNodes.add(node); inAQuotePattern(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); } outAQuotePattern(node); }
/** * Sets the {@code _value} child of this {@link AQuoteLiteralExp} node. * @param value the new {@code _value} child of this {@link AQuoteLiteralExp} node */ public void setValue(ILexQuoteToken value) { if (this._value != null) { this._value.parent(null); } if (value != null) { if (value.parent() != null) { value.parent().removeChild(value); } value.parent(this); } this._value = 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); }
/** * Sets the {@code _value} child of this {@link AQuoteType} node. * @param value the new {@code _value} child of this {@link AQuoteType} node */ public void setValue(ILexQuoteToken value) { if (this._value != null) { this._value.parent(null); } if (value != null) { if (value.parent() != null) { value.parent().removeChild(value); } value.parent(this); } this._value = value; }
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 AQuotePattern} node from {@link AQuotePattern#apply(IAnalysis)}. * @param node the calling {@link AQuotePattern} node */ public void caseAQuotePattern(AQuotePattern node, Q question) throws AnalysisException { _visitedNodes.add(node); inAQuotePattern(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); } outAQuotePattern(node, question); }
public PExp caseAQuotePattern(AQuotePattern node) throws AnalysisException { AQuoteLiteralExp quote = new AQuoteLiteralExp(); quote.setValue(node.getValue().clone()); addPossibleType(quote, node); return quote; }
/** * Sets the {@code _value} child of this {@link AQuotePattern} node. * @param value the new {@code _value} child of this {@link AQuotePattern} node */ public void setValue(ILexQuoteToken value) { if (this._value != null) { this._value.parent(null); } if (value != null) { if (value.parent() != null) { value.parent().removeChild(value); } value.parent(this); } this._value = value; }
public static AQuoteLiteralExp newAQuoteLiteralExp(ILexQuoteToken value) { AQuoteLiteralExp result = new AQuoteLiteralExp(); initExpression(result, value.getLocation()); result.setValue(value); return result; }
@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); } }
/** * 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); }
@Override public PType caseAQuoteLiteralExp(AQuoteLiteralExp node, TypeCheckInfo question) { node.setType(AstFactory.newAQuoteType(node.getValue().clone())); return question.assistantFactory.createPTypeAssistant().checkConstraint(question.constraint, node.getType(), node.getLocation()); }
@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; }
/** * Called by the {@link AQuotePattern} node from {@link AQuotePattern#apply(IAnalysis)}. * @param node the calling {@link AQuotePattern} node */ public void caseAQuotePattern(AQuotePattern node) throws AnalysisException { _visitedNodes.add(node); inAQuotePattern(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); } outAQuotePattern(node); }
@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(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 SPatternIR caseAQuotePattern(AQuotePattern node, IRInfo question) throws AnalysisException { String value = node.getValue().getValue(); AQuotePatternIR quotePatternCg = new AQuotePatternIR(); quotePatternCg.setValue(value); question.registerQuoteValue(value); return quotePatternCg; }