< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java

Print this page

        

*** 233,242 **** --- 233,250 ---- */ public <T extends JCTree> void printExprs(List<T> trees) throws IOException { printExprs(trees, ", "); } + + /** Derived visitor method: print pattern. + */ + + public void printPattern(JCTree tree) throws IOException { + printExpr(tree); + } + /** Derived visitor method: print list of statements, each on a separate line. */ public void printStats(List<? extends JCTree> trees) throws IOException { for (List<? extends JCTree> l = trees; l.nonEmpty(); l = l.tail) { align();
*** 876,885 **** --- 884,908 ---- } catch (IOException e) { throw new UncheckedIOException(e); } } + public void visitBindingPattern(JCBindingPattern patt) { + try { + if (patt.vartype == null) { + print("var "); + print(patt.name); + } else { + printExpr(patt.vartype); + print(" "); + print(patt.name); + } + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + public void visitSynchronized(JCSynchronized tree) { try { print("synchronized "); if (tree.lock.hasTag(PARENS)) { printExpr(tree.lock);
*** 1282,1292 **** public void visitTypeTest(JCInstanceOf tree) { try { open(prec, TreeInfo.ordPrec); printExpr(tree.expr, TreeInfo.ordPrec); print(" instanceof "); ! printExpr(tree.clazz, TreeInfo.ordPrec + 1); close(prec, TreeInfo.ordPrec); } catch (IOException e) { throw new UncheckedIOException(e); } } --- 1305,1319 ---- public void visitTypeTest(JCInstanceOf tree) { try { open(prec, TreeInfo.ordPrec); printExpr(tree.expr, TreeInfo.ordPrec); print(" instanceof "); ! if (tree.pattern instanceof JCPattern) { ! printPattern(tree.pattern); ! } else { ! printExpr(tree.getType(), TreeInfo.ordPrec + 1); ! } close(prec, TreeInfo.ordPrec); } catch (IOException e) { throw new UncheckedIOException(e); } }
< prev index next >