/** * Returns a deep clone of this {@link AQuotePattern} node. * @return a deep clone of this {@link AQuotePattern} node */ public AQuotePattern clone() { return new AQuotePattern( _location, cloneList(_definitions), _resolved, cloneNode(_value) ); }
public static AQuotePattern newAQuotePattern(LexQuoteToken token) { AQuotePattern result = new AQuotePattern(); initPattern(result, token.location); result.setValue(token); return result; }
/** * 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 PType caseAQuotePattern(AQuotePattern pattern) throws AnalysisException { return AstFactory.newAQuoteType(((AQuotePattern) pattern).getValue().clone()); }
@Override public List<NameValuePairList> caseAQuotePattern(AQuotePattern pattern, Newquestion question) throws AnalysisException { List<NameValuePairList> result = new Vector<NameValuePairList>(); try { if (!question.expval.quoteValue(question.ctxt).equals(pattern.getValue().getValue())) { VdmRuntimeError.patternFail(4112, "Quote pattern match failed", pattern.getLocation()); } } catch (ValueException e) { VdmRuntimeError.patternFail(e, pattern.getLocation()); } result.add(new NameValuePairList()); 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); }
@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; }
/** * 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; }
/** * Creates a deep clone of this {@link AQuotePattern} 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 AQuotePattern} node */ public AQuotePattern clone(Map<INode,INode> oldToNewMap) { AQuotePattern node = new AQuotePattern( _location, cloneList(_definitions, oldToNewMap), _resolved, cloneNode(_value, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link AQuotePattern} node from {@link AQuotePattern#apply(IAnalysis)}. * @param node the calling {@link AQuotePattern} node */ public A caseAQuotePattern(AQuotePattern node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAQuotePattern(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,outAQuotePattern(node)); return retVal; }
/** * Called by the {@link AQuotePattern} node from {@link AQuotePattern#apply(IAnalysis)}. * @param node the calling {@link AQuotePattern} node */ public A caseAQuotePattern(AQuotePattern node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAQuotePattern(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,outAQuotePattern(node, question)); return retVal; }