1 2 29 package com.puppycrawl.tools.checkstyle.checks.usage.transmogrify; 30 31 32 public abstract class ReferenceTool { 33 protected SymTabAST _tree = null; 34 35 public ReferenceTool(SymTabAST tree) { 36 _tree = tree; 37 } 38 39 protected void walkChildren( SymTabAST node ) { 40 if ( node.getFirstChild() != null ) { 41 walkSelfAndSiblings( (SymTabAST)node.getFirstChild() ); 42 } 43 } 44 45 private void walkSelfAndSiblings( SymTabAST node ) { 46 handleNode( node ); 47 SymTabAST sibling = (SymTabAST)node.getNextSibling(); 48 while ( sibling != null ) { 49 handleNode( sibling ); 50 sibling = (SymTabAST)sibling.getNextSibling(); 51 } 52 } 53 54 protected abstract void handleNode(SymTabAST node); 55 } | Popular Tags |