< prev index next >

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

Print this page
rev 60024 : imported patch 8248641


 137     }
 138 
 139     @DefinedBy(Api.COMPILER_TREE)
 140     public JCTree visitBreak(BreakTree node, P p) {
 141         JCBreak t = (JCBreak) node;
 142         return M.at(t.pos).Break(t.label);
 143     }
 144 
 145     @DefinedBy(Api.COMPILER_TREE)
 146     public JCTree visitYield(YieldTree node, P p) {
 147         JCYield t = (JCYield) node;
 148         JCExpression value = copy(t.value, p);
 149         return M.at(t.pos).Yield(value);
 150     }
 151 
 152     @DefinedBy(Api.COMPILER_TREE)
 153     public JCTree visitCase(CaseTree node, P p) {
 154         JCCase t = (JCCase) node;
 155         List<JCExpression> pats = copy(t.pats, p);
 156         List<JCStatement> stats = copy(t.stats, p);
 157         JCTree body = copy(t.body, p);

 158         return M.at(t.pos).Case(t.caseKind, pats, stats, body);
 159     }
 160 
 161     @DefinedBy(Api.COMPILER_TREE)
 162     public JCTree visitCatch(CatchTree node, P p) {
 163         JCCatch t = (JCCatch) node;
 164         JCVariableDecl param = copy(t.param, p);
 165         JCBlock body = copy(t.body, p);
 166         return M.at(t.pos).Catch(param, body);
 167     }
 168 
 169     @DefinedBy(Api.COMPILER_TREE)
 170     public JCTree visitClass(ClassTree node, P p) {
 171         JCClassDecl t = (JCClassDecl) node;
 172         JCModifiers mods = copy(t.mods, p);
 173         List<JCTypeParameter> typarams = copy(t.typarams, p);
 174         JCExpression extending = copy(t.extending, p);
 175         List<JCExpression> implementing = copy(t.implementing, p);
 176         List<JCTree> defs = copy(t.defs, p);
 177         return M.at(t.pos).ClassDef(mods, t.name, typarams, extending, implementing, defs);




 137     }
 138 
 139     @DefinedBy(Api.COMPILER_TREE)
 140     public JCTree visitBreak(BreakTree node, P p) {
 141         JCBreak t = (JCBreak) node;
 142         return M.at(t.pos).Break(t.label);
 143     }
 144 
 145     @DefinedBy(Api.COMPILER_TREE)
 146     public JCTree visitYield(YieldTree node, P p) {
 147         JCYield t = (JCYield) node;
 148         JCExpression value = copy(t.value, p);
 149         return M.at(t.pos).Yield(value);
 150     }
 151 
 152     @DefinedBy(Api.COMPILER_TREE)
 153     public JCTree visitCase(CaseTree node, P p) {
 154         JCCase t = (JCCase) node;
 155         List<JCExpression> pats = copy(t.pats, p);
 156         List<JCStatement> stats = copy(t.stats, p);
 157         JCTree body = t.body instanceof JCExpression && t.stats.head.hasTag(Tag.YIELD)
 158                 ? ((JCYield) t.stats.head).value : t.stats.head;
 159         return M.at(t.pos).Case(t.caseKind, pats, stats, body);
 160     }
 161 
 162     @DefinedBy(Api.COMPILER_TREE)
 163     public JCTree visitCatch(CatchTree node, P p) {
 164         JCCatch t = (JCCatch) node;
 165         JCVariableDecl param = copy(t.param, p);
 166         JCBlock body = copy(t.body, p);
 167         return M.at(t.pos).Catch(param, body);
 168     }
 169 
 170     @DefinedBy(Api.COMPILER_TREE)
 171     public JCTree visitClass(ClassTree node, P p) {
 172         JCClassDecl t = (JCClassDecl) node;
 173         JCModifiers mods = copy(t.mods, p);
 174         List<JCTypeParameter> typarams = copy(t.typarams, p);
 175         JCExpression extending = copy(t.extending, p);
 176         List<JCExpression> implementing = copy(t.implementing, p);
 177         List<JCTree> defs = copy(t.defs, p);
 178         return M.at(t.pos).ClassDef(mods, t.name, typarams, extending, implementing, defs);


< prev index next >