@Override public PType caseARealPattern(ARealPattern pattern) throws AnalysisException { return AstFactory.newARealNumericBasicType(pattern.getLocation()); }
/** * Returns a deep clone of this {@link ARealPattern} node. * @return a deep clone of this {@link ARealPattern} node */ public ARealPattern clone() { return new ARealPattern( _location, cloneList(_definitions), _resolved, cloneNode(_value) ); }
public static ARealPattern newARealPattern(LexRealToken token) { ARealPattern result = new ARealPattern(); initPattern(result, token.location); result.setValue(token); return result; }
/** * Called by the {@link ARealPattern} node from {@link ARealPattern#apply(IPOFAnalysis)}. * @param node the calling {@link ARealPattern} node */ public void caseARealPattern(ARealPattern node) throws AnalysisException { _visitedNodes.add(node); inARealPattern(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); } outARealPattern(node); }
@Override public List<NameValuePairList> caseARealPattern(ARealPattern pattern, Newquestion question) throws AnalysisException { List<NameValuePairList> result = new Vector<NameValuePairList>(); try { if (question.expval.realValue(question.ctxt) != pattern.getValue().getValue()) { VdmRuntimeError.patternFail(4113, "Real pattern match failed", pattern.getLocation()); } } catch (ValueException e) { VdmRuntimeError.patternFail(e, pattern.getLocation()); } result.add(new NameValuePairList()); return result; }
@Override public SPatternIR caseARealPattern(ARealPattern node, IRInfo question) throws AnalysisException { double value = node.getValue().getValue(); ARealPatternIR realPatternCg = new ARealPatternIR(); realPatternCg.setValue(value); return realPatternCg; }
/** * Creates a new complete constructor {@code ARealPattern} 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 ILexRealToken} node for the {@code value} child of this {@link ARealPattern} node */ public ARealPattern(ILexLocation location_, List<? extends PDefinition> definitions_, Boolean resolved_, ILexRealToken value_) { super(location_,definitions_,resolved_); this.setValue(value_); }
/** * Called by the {@link ARealPattern} node from {@link ARealPattern#apply(IAnalysis)}. * @param node the calling {@link ARealPattern} node */ public void caseARealPattern(ARealPattern node, Q question) throws AnalysisException { _visitedNodes.add(node); inARealPattern(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); } outARealPattern(node, question); }
public PExp caseARealPattern(ARealPattern node) throws AnalysisException { ARealLiteralExp exp = new ARealLiteralExp(); exp.setValue(node.getValue().clone()); addPossibleType(exp, node); return exp; }
/** * Called by the {@link ARealPattern} node from {@link ARealPattern#apply(IAnalysis)}. * @param node the calling {@link ARealPattern} node */ public void caseARealPattern(ARealPattern node) throws AnalysisException { _visitedNodes.add(node); inARealPattern(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); } outARealPattern(node); }
/** * Creates a deep clone of this {@link ARealPattern} 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 ARealPattern} node */ public ARealPattern clone(Map<INode,INode> oldToNewMap) { ARealPattern node = new ARealPattern( _location, cloneList(_definitions, oldToNewMap), _resolved, cloneNode(_value, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link ARealPattern} node from {@link ARealPattern#apply(IAnalysis)}. * @param node the calling {@link ARealPattern} node */ public A caseARealPattern(ARealPattern node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inARealPattern(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,outARealPattern(node)); return retVal; }
/** * Called by the {@link ARealPattern} node from {@link ARealPattern#apply(IAnalysis)}. * @param node the calling {@link ARealPattern} node */ public A caseARealPattern(ARealPattern node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inARealPattern(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,outARealPattern(node, question)); return retVal; }