< prev index next >

nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/package-info.java

Print this page




  51  *         // Pass a diagnostic listener to print error messages.
  52  *         CompilationUnitTree cut = parser.parse(sourceFile,
  53  *             (d) -&gt; { System.out.println(d); });
  54  *
  55  *         if (cut != null) {
  56  *             // call Tree.accept method passing a SimpleTreeVisitor
  57  *             cut.accept(new SimpleTreeVisitor&lt;Void, Void&gt;() {
  58  *                 // visit method for 'with' statement
  59  *                 public Void visitWith(WithTree wt, Void v) {
  60  *                     // print warning on 'with' statement
  61  *                     System.out.println("Warning: using 'with' statement!");
  62  *                     return null;
  63  *                 }
  64  *             }, null);
  65  *         }
  66  *     }
  67  * }
  68  * </code>
  69  * </pre>
  70  *
  71  * @since 1.9
  72  */
  73 @jdk.Exported
  74 package jdk.nashorn.api.tree;
  75 


  51  *         // Pass a diagnostic listener to print error messages.
  52  *         CompilationUnitTree cut = parser.parse(sourceFile,
  53  *             (d) -&gt; { System.out.println(d); });
  54  *
  55  *         if (cut != null) {
  56  *             // call Tree.accept method passing a SimpleTreeVisitor
  57  *             cut.accept(new SimpleTreeVisitor&lt;Void, Void&gt;() {
  58  *                 // visit method for 'with' statement
  59  *                 public Void visitWith(WithTree wt, Void v) {
  60  *                     // print warning on 'with' statement
  61  *                     System.out.println("Warning: using 'with' statement!");
  62  *                     return null;
  63  *                 }
  64  *             }, null);
  65  *         }
  66  *     }
  67  * }
  68  * </code>
  69  * </pre>
  70  *
  71  * @since 9
  72  */
  73 @jdk.Exported
  74 package jdk.nashorn.api.tree;
  75 
< prev index next >