protected CAstNodeTypeMap copyTypes(Map<Pair<CAstNode, K>, CAstNode> nodeMap, CAstNodeTypeMap orig) { if (orig != null) { CAstNodeTypeMapRecorder newMap = new CAstNodeTypeMapRecorder(); for (Entry<Pair<CAstNode, K>, CAstNode> entry : nodeMap.entrySet()) { Pair<CAstNode, K> N = entry.getKey(); CAstNode oldNode = N.fst; CAstNode newNode = entry.getValue(); if (orig.getNodeType(oldNode) != null) { newMap.add(newNode, orig.getNodeType(oldNode)); } } return newMap; } else { return null; } }
protected CAstNodeTypeMap copyTypes(Map<Pair<CAstNode, K>, CAstNode> nodeMap, CAstNodeTypeMap orig) { if (orig != null) { CAstNodeTypeMapRecorder newMap = new CAstNodeTypeMapRecorder(); for (Entry<Pair<CAstNode, K>, CAstNode> entry : nodeMap.entrySet()) { Pair<CAstNode, K> N = entry.getKey(); CAstNode oldNode = N.fst; CAstNode newNode = entry.getValue(); if (orig.getNodeType(oldNode) != null) { newMap.add(newNode, orig.getNodeType(oldNode)); } } return newMap; } else { return null; } }
public void addAll(CAstNodeTypeMap other) { for(CAstNode o : other.getMappedNodes()) { put(o, other.getNodeType(o)); } } }
public void addAll(CAstNodeTypeMap other) { for(CAstNode o : other.getMappedNodes()) { put(o, other.getNodeType(o)); } } }
protected final static CAstType getTypeForNode(WalkContext context, CAstNode node) { if (context.top().getNodeTypeMap() != null) { return context.top().getNodeTypeMap().getNodeType(node); } else { return null; } }
protected final static CAstType getTypeForNode(WalkContext context, CAstNode node) { if (context.top().getNodeTypeMap() != null) { return context.top().getNodeTypeMap().getNodeType(node); } else { return null; } }