public List<GrammarAST> getNodesWithType(IntervalSet types) { List<GrammarAST> nodes = new ArrayList<GrammarAST>(); List<GrammarAST> work = new LinkedList<GrammarAST>(); work.add(this); GrammarAST t; while ( !work.isEmpty() ) { t = work.remove(0); if ( types==null || types.contains(t.getType()) ) nodes.add(t); if ( t.children!=null ) { work.addAll(Arrays.asList(t.getChildrenAsArray())); } } return nodes; }
public List<GrammarAST> getNodesWithType(IntervalSet types) { List<GrammarAST> nodes = new ArrayList<GrammarAST>(); List<GrammarAST> work = new LinkedList<GrammarAST>(); work.add(this); GrammarAST t; while ( !work.isEmpty() ) { t = work.remove(0); if ( types==null || types.contains(t.getType()) ) nodes.add(t); if ( t.children!=null ) { work.addAll(Arrays.asList(t.getChildrenAsArray())); } } return nodes; }
public List<GrammarAST> getNodesWithType(IntervalSet types) { List<GrammarAST> nodes = new ArrayList<GrammarAST>(); List<GrammarAST> work = new LinkedList<GrammarAST>(); work.add(this); GrammarAST t; while ( !work.isEmpty() ) { t = work.remove(0); if ( types==null || types.contains(t.getType()) ) nodes.add(t); if ( t.children!=null ) { work.addAll(Arrays.asList(t.getChildrenAsArray())); } } return nodes; }
public List<GrammarAST> getNodesWithType(IntervalSet types) { List<GrammarAST> nodes = new ArrayList<GrammarAST>(); List<GrammarAST> work = new LinkedList<GrammarAST>(); work.add(this); GrammarAST t; while ( !work.isEmpty() ) { t = work.remove(0); if ( types==null || types.contains(t.getType()) ) nodes.add(t); if ( t.children!=null ) { work.addAll(Arrays.asList(t.getChildrenAsArray())); } } return nodes; }
public List<GrammarAST> getNodesWithType(IntervalSet types) { List<GrammarAST> nodes = new ArrayList<GrammarAST>(); List<GrammarAST> work = new LinkedList<GrammarAST>(); work.add(this); GrammarAST t; while ( !work.isEmpty() ) { t = work.remove(0); if ( types==null || types.contains(t.getType()) ) nodes.add(t); if ( t.children!=null ) { work.addAll(Arrays.asList(t.getChildrenAsArray())); } } return nodes; }