Example #1
0
 /**
  * Visitor method: enter all classes in given tree, catching any completion failure exceptions.
  * Return the tree's type.
  *
  * @param tree The tree to be visited.
  * @param env The environment visitor argument.
  */
 Type classEnter(JCTree tree, Env<AttrContext> env) {
   Env<AttrContext> prevEnv = this.env;
   try {
     this.env = env;
     tree.accept(this);
     return result;
   } catch (CompletionFailure ex) {
     return chk.completionError(tree.pos(), ex);
   } finally {
     this.env = prevEnv;
   }
 }
Example #2
0
 /**
  * Visitor method: print expression tree.
  *
  * @param prec The current precedence level.
  */
 public void printExpr(JCTree tree, int prec) throws IOException {
   int prevPrec = this.prec;
   try {
     this.prec = prec;
     if (tree == null) print("/*missing*/");
     else {
       tree.accept(this);
     }
   } catch (UncheckedIOException ex) {
     IOException e = new IOException(ex.getMessage());
     e.initCause(ex);
     throw e;
   } finally {
     this.prec = prevPrec;
   }
 }
Example #3
0
 public void scan(JCTree tree) {
   if (tree != null && !result) tree.accept(this);
 }