/** * Prints the text constructed by this visitor. * * @param pw the print writer to be used. */ public void print(final PrintWriter pw) { printList(pw, text); }
/** * Prints the given string tree. * * @param pw the writer to be used to print the tree. * @param l a string tree, i.e., a string list that can contain other string * lists, and so on recursively. */ static void printList(final PrintWriter pw, final List l) { for (int i = 0; i < l.size(); ++i) { Object o = l.get(i); if (o instanceof List) { printList(pw, (List) o); } else { pw.print(o.toString()); } } }
/** * Prints the text constructed by this visitor. * * @param pw the print writer to be used. */ public void print(final PrintWriter pw) { printList(pw, text); }
/** * Prints the given string tree. * * @param pw the writer to be used to print the tree. * @param l a string tree, i.e., a string list that can contain other string * lists, and so on recursively. */ static void printList(final PrintWriter pw, final List l) { for (int i = 0; i < l.size(); ++i) { Object o = l.get(i); if (o instanceof List) { printList(pw, (List) o); } else { pw.print(o.toString()); } } }