/** * Called by the {@link ATypeBind} node from {@link ATypeBind#apply(IPOFAnalysis)}. * @param node the calling {@link ATypeBind} node */ public void caseATypeBind(ATypeBind node) throws AnalysisException { _visitedNodes.add(node); inATypeBind(node); if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { node.getPattern().apply(this); } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } outATypeBind(node); }
public static ATypeBind newATypeBind(PPattern pattern, PType readType) { ATypeBind result = new ATypeBind(); result.setLocation(pattern.getLocation()); result.setPattern(pattern); result.setType(readType); return result; }
mbinds.addAll(tb.apply(question.assistantFactory.getMultipleBindLister())); paramDefinitions.addAll(question.assistantFactory.createPPatternAssistant().getDefinitions(tb.getPattern(), tb.getType(), NameScope.LOCAL)); paramPatterns.add(tb.getPattern()); tb.setType(question.assistantFactory.createPTypeAssistant().typeResolve(tb.getType(), null, THIS, question)); ptypes.add(tb.getType());
ATypeBind typebind = node.getTypebind(); if (!question.assistantFactory.getTypeComparator().compatible(typebind.getType(), node.getExpType())) TypeCheckerErrors.report(3014, "Expression is not compatible with type bind", typebind.getLocation(), typebind); node.setDefType(typebind.getType()); // Effectively a cast node.setDefs(question.assistantFactory.createPPatternAssistant().getDefinitions(typebind.getPattern(), node.getDefType(), question.scope));
@Override public LexNameSet caseALambdaExp(ALambdaExp node, FreeVarInfo info) throws AnalysisException { LexNameSet names = new LexNameSet(); for (ATypeBind mb: node.getBindList()) { names.addAll(mb.apply(this, info)); } return names; }
@Override public LexNameSet caseATypeBind(ATypeBind node, FreeVarInfo info) throws AnalysisException { return node.getType().apply(this, info); }
/** * Creates a new complete constructor {@code ATypeBind} 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 type_ the {@link PType} <b>graph</a> node for the {@code type} child of this {@link ATypeBind} node. * <i>The parent of this {@code type } will not be changed by adding it to this node.</i> */ public ATypeBind(ILexLocation location_, PPattern pattern_, PType type_) { super(location_,pattern_); this.setType(type_); }
/** * Returns a deep clone of this {@link ATypeBind} node. * @return a deep clone of this {@link ATypeBind} node */ public ATypeBind clone() { return new ATypeBind( _location, _pattern, _type ); }
e.apply(this, question);
@Override public ValueList caseATypeBind(ATypeBind bind, BindState state) throws AnalysisException { return af.createPTypeAssistant().getAllValues(bind.getType(), state.ctxt); }
/** * Creates a deep clone of this {@link ATypeBind} 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 ATypeBind} node */ public ATypeBind clone(Map<INode,INode> oldToNewMap) { ATypeBind node = new ATypeBind( _location, _pattern, _type ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link ATypeBind} node from {@link ATypeBind#apply(IAnalysis)}. * @param node the calling {@link ATypeBind} node */ public void caseATypeBind(ATypeBind node) throws AnalysisException { _visitedNodes.add(node); inATypeBind(node); if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { node.getPattern().apply(this); } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } outATypeBind(node); }
e.apply(this);
/** * Called by the {@link ATypeBind} node from {@link ATypeBind#apply(IAnalysis)}. * @param node the calling {@link ATypeBind} node */ public void caseATypeBind(ATypeBind node, Q question) throws AnalysisException { _visitedNodes.add(node); inATypeBind(node, question); if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { node.getPattern().apply(this, question); } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } outATypeBind(node, question); }
e.apply(this);
rt = tb.getType();
@Override public List<PMultipleBind> caseATypeBind(ATypeBind bind) throws AnalysisException { List<PPattern> plist = new Vector<PPattern>(); plist.add(bind.getPattern().clone()); List<PMultipleBind> mblist = new Vector<PMultipleBind>(); mblist.add(AstFactory.newATypeMultipleBind(plist, bind.getType().clone())); return mblist; }