@Override public PType caseAIntegerPattern(AIntegerPattern pattern) throws AnalysisException { return typeOf(pattern.getValue().getValue(), pattern.getLocation()); }
/** * Returns a deep clone of this {@link AIntegerPattern} node. * @return a deep clone of this {@link AIntegerPattern} node */ public AIntegerPattern clone() { return new AIntegerPattern( _location, cloneList(_definitions), _resolved, cloneNode(_value) ); }
public static AIntegerPattern newAIntegerPattern(LexIntegerToken token) { AIntegerPattern result = new AIntegerPattern(); initPattern(result, token.location); result.setValue(token); return result; }
/** * Called by the {@link AIntegerPattern} node from {@link AIntegerPattern#apply(IPOFAnalysis)}. * @param node the calling {@link AIntegerPattern} node */ public void caseAIntegerPattern(AIntegerPattern node) throws AnalysisException { _visitedNodes.add(node); inAIntegerPattern(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); } outAIntegerPattern(node); }
@Override public SPatternIR caseAIntegerPattern(AIntegerPattern node, IRInfo question) throws AnalysisException { long value = node.getValue().getValue(); AIntPatternIR intPatternCg = new AIntPatternIR(); intPatternCg.setValue(value); return intPatternCg; }
/** * Called by the {@link AIntegerPattern} node from {@link AIntegerPattern#apply(IAnalysis)}. * @param node the calling {@link AIntegerPattern} node */ public void caseAIntegerPattern(AIntegerPattern node) throws AnalysisException { _visitedNodes.add(node); inAIntegerPattern(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); } outAIntegerPattern(node); }
public PExp caseAIntegerPattern(AIntegerPattern node) throws AnalysisException { AIntLiteralExp exp = new AIntLiteralExp(); exp.setValue(node.getValue().clone()); addPossibleType(exp, node); return exp; }
/** * Called by the {@link AIntegerPattern} node from {@link AIntegerPattern#apply(IAnalysis)}. * @param node the calling {@link AIntegerPattern} node */ public void caseAIntegerPattern(AIntegerPattern node, Q question) throws AnalysisException { _visitedNodes.add(node); inAIntegerPattern(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); } outAIntegerPattern(node, question); }
@Override public List<NameValuePairList> caseAIntegerPattern(AIntegerPattern pattern, Newquestion question) throws AnalysisException { List<NameValuePairList> result = new Vector<NameValuePairList>(); try { if (question.expval.intValue(question.ctxt) != pattern.getValue().getValue()) { VdmRuntimeError.patternFail(4111, "Integer pattern match failed", pattern.getLocation()); } } catch (ValueException e) { VdmRuntimeError.patternFail(e, pattern.getLocation()); } result.add(new NameValuePairList()); return result; }
/** * Creates a deep clone of this {@link AIntegerPattern} 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 AIntegerPattern} node */ public AIntegerPattern clone(Map<INode,INode> oldToNewMap) { AIntegerPattern node = new AIntegerPattern( _location, cloneList(_definitions, oldToNewMap), _resolved, cloneNode(_value, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link AIntegerPattern} node from {@link AIntegerPattern#apply(IAnalysis)}. * @param node the calling {@link AIntegerPattern} node */ public A caseAIntegerPattern(AIntegerPattern node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAIntegerPattern(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,outAIntegerPattern(node, question)); return retVal; }
/** * Called by the {@link AIntegerPattern} node from {@link AIntegerPattern#apply(IAnalysis)}. * @param node the calling {@link AIntegerPattern} node */ public A caseAIntegerPattern(AIntegerPattern node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAIntegerPattern(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,outAIntegerPattern(node)); return retVal; }