/** * Visits the given AST node prior to the type-specific visit (before <code>visit</code>). * <p> * The default implementation calls {@link #preVisit(ASTNode)} and then * returns true. Subclasses may reimplement. * </p> * * @param node the node to visit * @return <code>true</code> if <code>visit(node)</code> should be called, * and <code>false</code> otherwise. * @see #preVisit(ASTNode) * @since 3.5 */ public boolean preVisit2(ASTNode node) { preVisit(node); return true; }
/** * Visits the given AST node prior to the type-specific visit (before <code>visit</code>). * <p> * The default implementation calls {@link #preVisit(ASTNode)} and then * returns true. Subclasses may reimplement. * </p> * * @param node the node to visit * @return <code>true</code> if <code>visit(node)</code> should be called, * and <code>false</code> otherwise. * @see #preVisit(ASTNode) * @since 3.5 */ public boolean preVisit2(ASTNode node) { preVisit(node); return true; }
/** * Visits the given AST node prior to the type-specific visit (before <code>visit</code>). * <p> * The default implementation calls {@link #preVisit(ASTNode)} and then * returns true. Subclasses may reimplement. * </p> * * @param node the node to visit * @return <code>true</code> if <code>visit(node)</code> should be called, * and <code>false</code> otherwise. * @see #preVisit(ASTNode) * @since 3.5 */ public boolean preVisit2(ASTNode node) { preVisit(node); return true; }
/** * Visits the given AST node prior to the type-specific visit (before <code>visit</code>). * <p> * The default implementation calls {@link #preVisit(ASTNode)} and then * returns true. Subclasses may reimplement. * </p> * * @param node the node to visit * @return <code>true</code> if <code>visit(node)</code> should be called, * and <code>false</code> otherwise. * @see #preVisit(ASTNode) * @since 3.5 */ public boolean preVisit2(ASTNode node) { preVisit(node); return true; }
/** * Visits the given AST node prior to the type-specific visit (before <code>visit</code>). * <p> * The default implementation calls {@link #preVisit(ASTNode)} and then * returns true. Subclasses may reimplement. * </p> * * @param node the node to visit * @return <code>true</code> if <code>visit(node)</code> should be called, * and <code>false</code> otherwise. * @see #preVisit(ASTNode) * @since 3.5 */ public boolean preVisit2(ASTNode node) { preVisit(node); return true; }
/** * Visits the given AST node prior to the type-specific visit (before <code>visit</code>). * <p> * The default implementation calls {@link #preVisit(ASTNode)} and then * returns true. Subclasses may reimplement. * </p> * * @param node the node to visit * @return <code>true</code> if <code>visit(node)</code> should be called, * and <code>false</code> otherwise. * @see #preVisit(ASTNode) * @since 3.5 */ public boolean preVisit2(ASTNode node) { preVisit(node); return true; }
@Override public void preVisit(ASTNode node) { for (Iterator<ASTVisitor> iter = preVisitors.iterator(); iter.hasNext();) { final ASTVisitor v = iter.next(); try { v.preVisit(node); } catch (Exception e) { logFaultyVisitor(v, node, e); iter.remove(); } } }
@Override public void preVisit(final ASTNode node) { if (node.getParent() != null) { variables.putAll(node, variables.get(node.getParent())); } variables.putAll(node, variableDeclarations.get(node)); super.preVisit(node); }
@Override public void preVisit(final ASTNode node) { final ASTNode parent = node.getParent(); if (parent != null && variableNames.containsKey(parent)) { // inherit all variables in parent scope final Map<String, Integer> bindingsCopy = Maps.newTreeMap(); for (final Entry<String, Integer> binding : variableNames.get(parent).entrySet()) { bindingsCopy.put(binding.getKey(), binding.getValue()); } variableNames.put(node, bindingsCopy); } else { // Start from scratch variableNames.put(node, Maps.<String, Integer> newTreeMap()); } super.preVisit(node); }
@Override public void preVisit(final ASTNode node) { final ASTNode parent = node.getParent(); if (parent != null && variableNames.containsKey(parent)) { // inherit all variables in parent scope final Map<String, Integer> bindingsCopy = Maps.newTreeMap(); for (final Entry<String, Integer> binding : variableNames.get( parent).entrySet()) { bindingsCopy.put(binding.getKey(), binding.getValue()); } variableNames.put(node, bindingsCopy); } else { // Start from scratch variableNames.put(node, Maps.<String, Integer> newTreeMap()); } super.preVisit(node); }
@Override public void preVisit(final ASTNode node) { final ASTNode parent = node.getParent(); if (parent != null && variableNames.containsKey(parent)) { // inherit all variables in parent scope final Map<String, Integer> bindingsCopy = Maps.newTreeMap(); for (final Entry<String, Integer> binding : variableNames.get( parent).entrySet()) { bindingsCopy.put(binding.getKey(), binding.getValue()); } variableNames.put(node, bindingsCopy); } else { // Start from scratch variableNames.put(node, Maps.<String, Integer> newTreeMap()); } super.preVisit(node); }
super.preVisit(node);
@Override public void preVisit(ASTNode node) { Object property= node.getProperty(PROPERTY_KEY); if (property == REMOVED) { if (fRemovingStart == -1) { fRemovingStart= node.getStartPosition(); } else { /* * Bug in client code: REMOVED node should not be nested inside another REMOVED node without * an intermediate RETAINED node. * Drop REMOVED property to prevent problems later (premature end of REMOVED section). */ node.setProperty(PROPERTY_KEY, null); } } else if (property == RETAINED) { if (fRemovingStart != -1) { removedStartsEnds.add(new int[] { fRemovingStart, node.getStartPosition() }); fRemovingStart= -1; } else { /* * Bug in client code: RETAINED node should not be nested inside another RETAINED node without * an intermediate REMOVED node and must have an enclosing REMOVED node. * Drop RETAINED property to prevent problems later (premature restart of REMOVED section). */ node.setProperty(PROPERTY_KEY, null); } } super.preVisit(node); } @Override
@Override public void preVisit(ASTNode node) { Object property= node.getProperty(PROPERTY_KEY); if (property == REMOVED) { if (fRemovingStart == -1) { fRemovingStart= node.getStartPosition(); } else { /* * Bug in client code: REMOVED node should not be nested inside another REMOVED node without * an intermediate RETAINED node. * Drop REMOVED property to prevent problems later (premature end of REMOVED section). */ node.setProperty(PROPERTY_KEY, null); } } else if (property == RETAINED) { if (fRemovingStart != -1) { removedStartsEnds.add(new int[] { fRemovingStart, node.getStartPosition() }); fRemovingStart= -1; } else { /* * Bug in client code: RETAINED node should not be nested inside another RETAINED node without * an intermediate REMOVED node and must have an enclosing REMOVED node. * Drop RETAINED property to prevent problems later (premature restart of REMOVED section). */ node.setProperty(PROPERTY_KEY, null); } } super.preVisit(node); } @Override