src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeTranslator.java
author jlahoda
Wed, 27 Nov 2019 09:00:01 +0100
changeset 59285 7799a51dbe30
parent 55306 ea43db53de91
permissions -rw-r--r--
8231826: Implement javac changes for pattern matching for instanceof Reviewed-by: mcimadamore Contributed-by: brian.goetz@oracle.com, gavin.bierman@oracle.com, maurizio.cimadamore@oracle.com, srikanth.adayapalam@oracle.com, vicente.romero@oracle.com, jan.lahoda@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
55306
ea43db53de91 8223305: Compiler support for Switch Expressions
jlahoda
parents: 51563
diff changeset
     2
 * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 5492
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package com.sun.tools.javac.tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
import com.sun.tools.javac.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import com.sun.tools.javac.tree.JCTree.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
/** A subclass of Tree.Visitor, this class defines
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
 *  a general tree translator pattern. Translation proceeds recursively in
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
 *  left-to-right order down a tree, constructing translated nodes by
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
 *  overwriting existing ones. There is one visitor method in this class
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 *  for every possible kind of tree node.  To obtain a specific
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 *  translator, it suffices to override those visitor methods which
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 *  do some interesting work. The translator class itself takes care of all
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 *  navigational aspects.
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 *
5847
1908176fd6e3 6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5520
diff changeset
    40
 *  <p><b>This is NOT part of any supported API.
1908176fd6e3 6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents: 5520
diff changeset
    41
 *  If you write code that depends on this, you do so at your own risk.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 *  This code and its internal interfaces are subject to change or
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 *  deletion without notice.</b>
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
public class TreeTranslator extends JCTree.Visitor {
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
    /** Visitor result field: a tree
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
    protected JCTree result;
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
    /** Visitor method: Translate a single node.
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
    @SuppressWarnings("unchecked")
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
    public <T extends JCTree> T translate(T tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
        if (tree == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
            return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
            tree.accept(this);
24066
1dfb66929538 8029718: Should always use lambda body structure to disambiguate overload resolution
vromero
parents: 17578
diff changeset
    59
            JCTree tmpResult = this.result;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
            this.result = null;
24066
1dfb66929538 8029718: Should always use lambda body structure to disambiguate overload resolution
vromero
parents: 17578
diff changeset
    61
            return (T)tmpResult; // XXX cast
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
    /** Visitor method: translate a list of nodes.
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    public <T extends JCTree> List<T> translate(List<T> trees) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
        if (trees == null) return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
        for (List<T> l = trees; l.nonEmpty(); l = l.tail)
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
            l.head = translate(l.head);
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
        return trees;
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
    /**  Visitor method: translate a list of variable definitions.
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
    public List<JCVariableDecl> translateVarDefs(List<JCVariableDecl> trees) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
        for (List<JCVariableDecl> l = trees; l.nonEmpty(); l = l.tail)
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
            l.head = translate(l.head);
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
        return trees;
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
    /**  Visitor method: translate a list of type parameters.
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
    public List<JCTypeParameter> translateTypeParams(List<JCTypeParameter> trees) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
        for (List<JCTypeParameter> l = trees; l.nonEmpty(); l = l.tail)
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
            l.head = translate(l.head);
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
        return trees;
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
    /**  Visitor method: translate a list of case parts of switch statements.
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
    public List<JCCase> translateCases(List<JCCase> trees) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
        for (List<JCCase> l = trees; l.nonEmpty(); l = l.tail)
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
            l.head = translate(l.head);
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
        return trees;
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
    /**  Visitor method: translate a list of catch clauses in try statements.
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
    public List<JCCatch> translateCatchers(List<JCCatch> trees) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
        for (List<JCCatch> l = trees; l.nonEmpty(); l = l.tail)
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
            l.head = translate(l.head);
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
        return trees;
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
    /**  Visitor method: translate a list of catch clauses in try statements.
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
    public List<JCAnnotation> translateAnnotations(List<JCAnnotation> trees) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
        for (List<JCAnnotation> l = trees; l.nonEmpty(); l = l.tail)
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
            l.head = translate(l.head);
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
        return trees;
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
/* ***************************************************************************
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
 * Visitor methods
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
 ****************************************************************************/
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
    public void visitTopLevel(JCCompilationUnit tree) {
24069
dfb8f11542fc 8034245: Refactor TopLevel tree node.
pgovereau
parents: 24066
diff changeset
   119
        tree.defs = translate(tree.defs);
dfb8f11542fc 8034245: Refactor TopLevel tree node.
pgovereau
parents: 24066
diff changeset
   120
        result = tree;
dfb8f11542fc 8034245: Refactor TopLevel tree node.
pgovereau
parents: 24066
diff changeset
   121
    }
dfb8f11542fc 8034245: Refactor TopLevel tree node.
pgovereau
parents: 24066
diff changeset
   122
dfb8f11542fc 8034245: Refactor TopLevel tree node.
pgovereau
parents: 24066
diff changeset
   123
    public void visitPackageDef(JCPackageDecl tree) {
dfb8f11542fc 8034245: Refactor TopLevel tree node.
pgovereau
parents: 24066
diff changeset
   124
        tree.annotations = translate(tree.annotations);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
        tree.pid = translate(tree.pid);
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
    public void visitImport(JCImport tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
        tree.qualid = translate(tree.qualid);
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
    public void visitClassDef(JCClassDecl tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
        tree.mods = translate(tree.mods);
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
        tree.typarams = translateTypeParams(tree.typarams);
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
        tree.extending = translate(tree.extending);
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
        tree.implementing = translate(tree.implementing);
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
        tree.defs = translate(tree.defs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
    public void visitMethodDef(JCMethodDecl tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
        tree.mods = translate(tree.mods);
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
        tree.restype = translate(tree.restype);
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
        tree.typarams = translateTypeParams(tree.typarams);
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   147
        tree.recvparam = translate(tree.recvparam);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
        tree.params = translateVarDefs(tree.params);
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
        tree.thrown = translate(tree.thrown);
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
        tree.body = translate(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
    public void visitVarDef(JCVariableDecl tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
        tree.mods = translate(tree.mods);
17578
46ac954e4a84 8013852: update reference impl for type-annotations
jjg
parents: 15385
diff changeset
   156
        tree.nameexpr = translate(tree.nameexpr);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
        tree.vartype = translate(tree.vartype);
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
        tree.init = translate(tree.init);
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
    public void visitSkip(JCSkip tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
    public void visitBlock(JCBlock tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
        tree.stats = translate(tree.stats);
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
    public void visitDoLoop(JCDoWhileLoop tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
        tree.body = translate(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
        tree.cond = translate(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
    public void visitWhileLoop(JCWhileLoop tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
        tree.cond = translate(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
        tree.body = translate(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
    public void visitForLoop(JCForLoop tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
        tree.init = translate(tree.init);
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
        tree.cond = translate(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
        tree.step = translate(tree.step);
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
        tree.body = translate(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
    public void visitForeachLoop(JCEnhancedForLoop tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
        tree.var = translate(tree.var);
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
        tree.expr = translate(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
        tree.body = translate(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
    public void visitLabelled(JCLabeledStatement tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
        tree.body = translate(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
    public void visitSwitch(JCSwitch tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
        tree.selector = translate(tree.selector);
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
        tree.cases = translateCases(tree.cases);
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
    public void visitCase(JCCase tree) {
51563
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   210
        tree.pats = translate(tree.pats);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
        tree.stats = translate(tree.stats);
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
51563
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   215
    public void visitSwitchExpression(JCSwitchExpression tree) {
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   216
        tree.selector = translate(tree.selector);
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   217
        tree.cases = translateCases(tree.cases);
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   218
        result = tree;
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   219
    }
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   220
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
    public void visitSynchronized(JCSynchronized tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
        tree.lock = translate(tree.lock);
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
        tree.body = translate(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
    public void visitTry(JCTry tree) {
6148
3a8158299c51 6911256: Project Coin: Support Automatic Resource Management (ARM) blocks in the compiler
darcy
parents: 5847
diff changeset
   228
        tree.resources = translate(tree.resources);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
        tree.body = translate(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
        tree.catchers = translateCatchers(tree.catchers);
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
        tree.finalizer = translate(tree.finalizer);
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
    public void visitCatch(JCCatch tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
        tree.param = translate(tree.param);
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
        tree.body = translate(tree.body);
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
    public void visitConditional(JCConditional tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
        tree.cond = translate(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
        tree.truepart = translate(tree.truepart);
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
        tree.falsepart = translate(tree.falsepart);
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
    public void visitIf(JCIf tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
        tree.cond = translate(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
        tree.thenpart = translate(tree.thenpart);
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
        tree.elsepart = translate(tree.elsepart);
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
    public void visitExec(JCExpressionStatement tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
        tree.expr = translate(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
    public void visitBreak(JCBreak tree) {
55306
ea43db53de91 8223305: Compiler support for Switch Expressions
jlahoda
parents: 51563
diff changeset
   261
        result = tree;
ea43db53de91 8223305: Compiler support for Switch Expressions
jlahoda
parents: 51563
diff changeset
   262
    }
ea43db53de91 8223305: Compiler support for Switch Expressions
jlahoda
parents: 51563
diff changeset
   263
ea43db53de91 8223305: Compiler support for Switch Expressions
jlahoda
parents: 51563
diff changeset
   264
    public void visitYield(JCYield tree) {
ea43db53de91 8223305: Compiler support for Switch Expressions
jlahoda
parents: 51563
diff changeset
   265
        tree.value = translate(tree.value);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
    public void visitContinue(JCContinue tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
    public void visitReturn(JCReturn tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
        tree.expr = translate(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
    public void visitThrow(JCThrow tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
        tree.expr = translate(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
    public void visitAssert(JCAssert tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
        tree.cond = translate(tree.cond);
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
        tree.detail = translate(tree.detail);
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
    public void visitApply(JCMethodInvocation tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
        tree.meth = translate(tree.meth);
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
        tree.args = translate(tree.args);
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
    public void visitNewClass(JCNewClass tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
        tree.encl = translate(tree.encl);
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
        tree.clazz = translate(tree.clazz);
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
        tree.args = translate(tree.args);
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
        tree.def = translate(tree.def);
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
11141
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   303
    public void visitLambda(JCLambda tree) {
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   304
        tree.params = translate(tree.params);
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   305
        tree.body = translate(tree.body);
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   306
        result = tree;
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   307
    }
7d112a1ecd0f 7115046: Add AST node for lambda expressions
mcimadamore
parents: 9300
diff changeset
   308
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   309
    public void visitNewArray(JCNewArray tree) {
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   310
        tree.annotations = translate(tree.annotations);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   311
        List<List<JCAnnotation>> dimAnnos = List.nil();
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   312
        for (List<JCAnnotation> origDimAnnos : tree.dimAnnotations)
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   313
            dimAnnos = dimAnnos.append(translate(origDimAnnos));
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   314
        tree.dimAnnotations = dimAnnos;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
        tree.elemtype = translate(tree.elemtype);
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
        tree.dims = translate(tree.dims);
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
        tree.elems = translate(tree.elems);
06bc494ca11e Initial load
duke
parents:
diff changeset
   318
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   319
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   320
06bc494ca11e Initial load
duke
parents:
diff changeset
   321
    public void visitParens(JCParens tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
        tree.expr = translate(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   323
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   324
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   325
06bc494ca11e Initial load
duke
parents:
diff changeset
   326
    public void visitAssign(JCAssign tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   327
        tree.lhs = translate(tree.lhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   328
        tree.rhs = translate(tree.rhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   329
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   330
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   331
06bc494ca11e Initial load
duke
parents:
diff changeset
   332
    public void visitAssignop(JCAssignOp tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   333
        tree.lhs = translate(tree.lhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   334
        tree.rhs = translate(tree.rhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   335
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   336
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   337
06bc494ca11e Initial load
duke
parents:
diff changeset
   338
    public void visitUnary(JCUnary tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   339
        tree.arg = translate(tree.arg);
06bc494ca11e Initial load
duke
parents:
diff changeset
   340
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   341
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   342
06bc494ca11e Initial load
duke
parents:
diff changeset
   343
    public void visitBinary(JCBinary tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   344
        tree.lhs = translate(tree.lhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   345
        tree.rhs = translate(tree.rhs);
06bc494ca11e Initial load
duke
parents:
diff changeset
   346
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
    public void visitTypeCast(JCTypeCast tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   350
        tree.clazz = translate(tree.clazz);
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
        tree.expr = translate(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   353
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   354
06bc494ca11e Initial load
duke
parents:
diff changeset
   355
    public void visitTypeTest(JCInstanceOf tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   356
        tree.expr = translate(tree.expr);
59285
7799a51dbe30 8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents: 55306
diff changeset
   357
        tree.pattern = translate(tree.pattern);
7799a51dbe30 8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents: 55306
diff changeset
   358
        result = tree;
7799a51dbe30 8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents: 55306
diff changeset
   359
    }
7799a51dbe30 8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents: 55306
diff changeset
   360
7799a51dbe30 8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents: 55306
diff changeset
   361
    public void visitBindingPattern(JCBindingPattern tree) {
7799a51dbe30 8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents: 55306
diff changeset
   362
        tree.vartype = translate(tree.vartype);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   363
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   364
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   365
06bc494ca11e Initial load
duke
parents:
diff changeset
   366
    public void visitIndexed(JCArrayAccess tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   367
        tree.indexed = translate(tree.indexed);
06bc494ca11e Initial load
duke
parents:
diff changeset
   368
        tree.index = translate(tree.index);
06bc494ca11e Initial load
duke
parents:
diff changeset
   369
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   370
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   371
06bc494ca11e Initial load
duke
parents:
diff changeset
   372
    public void visitSelect(JCFieldAccess tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   373
        tree.selected = translate(tree.selected);
06bc494ca11e Initial load
duke
parents:
diff changeset
   374
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   375
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   376
11142
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents: 11141
diff changeset
   377
    public void visitReference(JCMemberReference tree) {
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents: 11141
diff changeset
   378
        tree.expr = translate(tree.expr);
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents: 11141
diff changeset
   379
        result = tree;
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents: 11141
diff changeset
   380
    }
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents: 11141
diff changeset
   381
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   382
    public void visitIdent(JCIdent tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   383
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   384
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   385
06bc494ca11e Initial load
duke
parents:
diff changeset
   386
    public void visitLiteral(JCLiteral tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   387
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   388
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   389
06bc494ca11e Initial load
duke
parents:
diff changeset
   390
    public void visitTypeIdent(JCPrimitiveTypeTree tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   391
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   392
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   393
06bc494ca11e Initial load
duke
parents:
diff changeset
   394
    public void visitTypeArray(JCArrayTypeTree tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   395
        tree.elemtype = translate(tree.elemtype);
06bc494ca11e Initial load
duke
parents:
diff changeset
   396
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   397
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   398
06bc494ca11e Initial load
duke
parents:
diff changeset
   399
    public void visitTypeApply(JCTypeApply tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   400
        tree.clazz = translate(tree.clazz);
06bc494ca11e Initial load
duke
parents:
diff changeset
   401
        tree.arguments = translate(tree.arguments);
06bc494ca11e Initial load
duke
parents:
diff changeset
   402
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   403
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   404
9300
c2de4dd9853b 7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents: 8031
diff changeset
   405
    public void visitTypeUnion(JCTypeUnion tree) {
7074
0183c3f9614e 6949587: rename "DisjointType" to "DisjunctType"
jjg
parents: 6148
diff changeset
   406
        tree.alternatives = translate(tree.alternatives);
5492
515e4b33b335 6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents: 3149
diff changeset
   407
        result = tree;
515e4b33b335 6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents: 3149
diff changeset
   408
    }
515e4b33b335 6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents: 3149
diff changeset
   409
14725
65836e833f59 8002099: Add support for intersection types in cast expression
mcimadamore
parents: 11142
diff changeset
   410
    public void visitTypeIntersection(JCTypeIntersection tree) {
65836e833f59 8002099: Add support for intersection types in cast expression
mcimadamore
parents: 11142
diff changeset
   411
        tree.bounds = translate(tree.bounds);
65836e833f59 8002099: Add support for intersection types in cast expression
mcimadamore
parents: 11142
diff changeset
   412
        result = tree;
65836e833f59 8002099: Add support for intersection types in cast expression
mcimadamore
parents: 11142
diff changeset
   413
    }
65836e833f59 8002099: Add support for intersection types in cast expression
mcimadamore
parents: 11142
diff changeset
   414
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   415
    public void visitTypeParameter(JCTypeParameter tree) {
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   416
        tree.annotations = translate(tree.annotations);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   417
        tree.bounds = translate(tree.bounds);
06bc494ca11e Initial load
duke
parents:
diff changeset
   418
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   419
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   420
06bc494ca11e Initial load
duke
parents:
diff changeset
   421
    @Override
06bc494ca11e Initial load
duke
parents:
diff changeset
   422
    public void visitWildcard(JCWildcard tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   423
        tree.kind = translate(tree.kind);
06bc494ca11e Initial load
duke
parents:
diff changeset
   424
        tree.inner = translate(tree.inner);
06bc494ca11e Initial load
duke
parents:
diff changeset
   425
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   426
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   427
06bc494ca11e Initial load
duke
parents:
diff changeset
   428
    @Override
06bc494ca11e Initial load
duke
parents:
diff changeset
   429
    public void visitTypeBoundKind(TypeBoundKind tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   430
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   431
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   432
06bc494ca11e Initial load
duke
parents:
diff changeset
   433
    public void visitErroneous(JCErroneous tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   434
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   435
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   436
06bc494ca11e Initial load
duke
parents:
diff changeset
   437
    public void visitLetExpr(LetExpr tree) {
51563
de411d537aae 8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents: 47216
diff changeset
   438
        tree.defs = translate(tree.defs);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   439
        tree.expr = translate(tree.expr);
06bc494ca11e Initial load
duke
parents:
diff changeset
   440
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   441
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   442
06bc494ca11e Initial load
duke
parents:
diff changeset
   443
    public void visitModifiers(JCModifiers tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   444
        tree.annotations = translateAnnotations(tree.annotations);
06bc494ca11e Initial load
duke
parents:
diff changeset
   445
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   446
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   447
06bc494ca11e Initial load
duke
parents:
diff changeset
   448
    public void visitAnnotation(JCAnnotation tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   449
        tree.annotationType = translate(tree.annotationType);
06bc494ca11e Initial load
duke
parents:
diff changeset
   450
        tree.args = translate(tree.args);
06bc494ca11e Initial load
duke
parents:
diff changeset
   451
        result = tree;
06bc494ca11e Initial load
duke
parents:
diff changeset
   452
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   453
15385
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   454
    public void visitAnnotatedType(JCAnnotatedType tree) {
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   455
        tree.annotations = translate(tree.annotations);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   456
        tree.underlyingType = translate(tree.underlyingType);
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   457
        result = tree;
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   458
    }
ee1eebe7e210 8006775: JSR 308: Compiler changes in JDK8
jjg
parents: 14725
diff changeset
   459
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   460
    public void visitTree(JCTree tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   461
        throw new AssertionError(tree);
06bc494ca11e Initial load
duke
parents:
diff changeset
   462
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   463
}