< prev index next >

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

Print this page

181         List<JCExpression> implementing = copy(t.implementing, p);
182         List<JCTree> defs = copy(t.defs, p);
183         return M.at(t.pos).ClassDef(mods, t.name, typarams, extending, implementing, defs);
184     }
185 
186     @DefinedBy(Api.COMPILER_TREE)
187     public JCTree visitConditionalExpression(ConditionalExpressionTree node, P p) {
188         JCConditional t = (JCConditional) node;
189         JCExpression cond = copy(t.cond, p);
190         JCExpression truepart = copy(t.truepart, p);
191         JCExpression falsepart = copy(t.falsepart, p);
192         return M.at(t.pos).Conditional(cond, truepart, falsepart);
193     }
194 
195     @DefinedBy(Api.COMPILER_TREE)
196     public JCTree visitContinue(ContinueTree node, P p) {
197         JCContinue t = (JCContinue) node;
198         return M.at(t.pos).Continue(t.label);
199     }
200 







201     @DefinedBy(Api.COMPILER_TREE)
202     public JCTree visitDoWhileLoop(DoWhileLoopTree node, P p) {
203         JCDoWhileLoop t = (JCDoWhileLoop) node;
204         JCStatement body = copy(t.body, p);
205         JCExpression cond = copy(t.cond, p);
206         return M.at(t.pos).DoLoop(body, cond);
207     }
208 
209     @DefinedBy(Api.COMPILER_TREE)
210     public JCTree visitErroneous(ErroneousTree node, P p) {
211         JCErroneous t = (JCErroneous) node;
212         List<? extends JCTree> errs = copy(t.errs, p);
213         return M.at(t.pos).Erroneous(errs);
214     }
215 
216     @DefinedBy(Api.COMPILER_TREE)
217     public JCTree visitExpressionStatement(ExpressionStatementTree node, P p) {
218         JCExpressionStatement t = (JCExpressionStatement) node;
219         JCExpression expr = copy(t.expr, p);
220         return M.at(t.pos).Exec(expr);

225         JCEnhancedForLoop t = (JCEnhancedForLoop) node;
226         JCVariableDecl var = copy(t.var, p);
227         JCExpression expr = copy(t.expr, p);
228         JCStatement body = copy(t.body, p);
229         return M.at(t.pos).ForeachLoop(var, expr, body);
230     }
231 
232     @DefinedBy(Api.COMPILER_TREE)
233     public JCTree visitForLoop(ForLoopTree node, P p) {
234         JCForLoop t = (JCForLoop) node;
235         List<JCStatement> init = copy(t.init, p);
236         JCExpression cond = copy(t.cond, p);
237         List<JCExpressionStatement> step = copy(t.step, p);
238         JCStatement body = copy(t.body, p);
239         return M.at(t.pos).ForLoop(init, cond, step, body);
240     }
241 
242     @DefinedBy(Api.COMPILER_TREE)
243     public JCTree visitIdentifier(IdentifierTree node, P p) {
244         JCIdent t = (JCIdent) node;
245         return M.at(t.pos).Ident(t.name);

246     }
247 
248     @DefinedBy(Api.COMPILER_TREE)
249     public JCTree visitIf(IfTree node, P p) {
250         JCIf t = (JCIf) node;
251         JCExpression cond = copy(t.cond, p);
252         JCStatement thenpart = copy(t.thenpart, p);
253         JCStatement elsepart = copy(t.elsepart, p);
254         return M.at(t.pos).If(cond, thenpart, elsepart);
255     }
256 
257     @DefinedBy(Api.COMPILER_TREE)
258     public JCTree visitImport(ImportTree node, P p) {
259         JCImport t = (JCImport) node;
260         JCTree qualid = copy(t.qualid, p);
261         return M.at(t.pos).Import(qualid, t.staticImport);
262     }
263 
264     @DefinedBy(Api.COMPILER_TREE)
265     public JCTree visitArrayAccess(ArrayAccessTree node, P p) {

341     }
342 
343     @DefinedBy(Api.COMPILER_TREE)
344     public JCTree visitParenthesized(ParenthesizedTree node, P p) {
345         JCParens t = (JCParens) node;
346         JCExpression expr = copy(t.expr, p);
347         return M.at(t.pos).Parens(expr);
348     }
349 
350     @DefinedBy(Api.COMPILER_TREE)
351     public JCTree visitReturn(ReturnTree node, P p) {
352         JCReturn t = (JCReturn) node;
353         JCExpression expr = copy(t.expr, p);
354         return M.at(t.pos).Return(expr);
355     }
356 
357     @DefinedBy(Api.COMPILER_TREE)
358     public JCTree visitMemberSelect(MemberSelectTree node, P p) {
359         JCFieldAccess t = (JCFieldAccess) node;
360         JCExpression selected = copy(t.selected, p);
361         return M.at(t.pos).Select(selected, t.name);

362     }
363 
364     @DefinedBy(Api.COMPILER_TREE)
365     public JCTree visitMemberReference(MemberReferenceTree node, P p) {
366         JCMemberReference t = (JCMemberReference) node;
367         JCExpression expr = copy(t.expr, p);
368         List<JCExpression> typeargs = copy(t.typeargs, p);
369         return M.at(t.pos).Reference(t.mode, t.name, expr, typeargs);
370     }
371 
372     @DefinedBy(Api.COMPILER_TREE)
373     public JCTree visitEmptyStatement(EmptyStatementTree node, P p) {
374         JCSkip t = (JCSkip) node;
375         return M.at(t.pos).Skip();
376     }
377 
378     @DefinedBy(Api.COMPILER_TREE)
379     public JCTree visitSwitch(SwitchTree node, P p) {
380         JCSwitch t = (JCSwitch) node;
381         JCExpression selector = copy(t.selector, p);

530         JCVariableDecl t = (JCVariableDecl) node;
531         JCModifiers mods = copy(t.mods, p);
532         JCExpression vartype = copy(t.vartype, p);
533         if (t.nameexpr == null) {
534             JCExpression init = copy(t.init, p);
535             return M.at(t.pos).VarDef(mods, t.name, vartype, init);
536         } else {
537             JCExpression nameexpr = copy(t.nameexpr, p);
538             return M.at(t.pos).ReceiverVarDef(mods, nameexpr, vartype);
539         }
540     }
541 
542     @DefinedBy(Api.COMPILER_TREE)
543     public JCTree visitWhileLoop(WhileLoopTree node, P p) {
544         JCWhileLoop t = (JCWhileLoop) node;
545         JCStatement body = copy(t.body, p);
546         JCExpression cond = copy(t.cond, p);
547         return M.at(t.pos).WhileLoop(cond, body);
548     }
549 








550     @DefinedBy(Api.COMPILER_TREE)
551     public JCTree visitWildcard(WildcardTree node, P p) {
552         JCWildcard t = (JCWildcard) node;
553         TypeBoundKind kind = M.at(t.kind.pos).TypeBoundKind(t.kind.kind);
554         JCTree inner = copy(t.inner, p);
555         return M.at(t.pos).Wildcard(kind, inner);
556     }
557 
558     @Override @DefinedBy(Api.COMPILER_TREE)
559     public JCTree visitModule(ModuleTree node, P p) {
560         JCModuleDecl t = (JCModuleDecl) node;
561         JCModifiers mods = copy(t.mods, p);
562         JCExpression qualId = copy(t.qualId);
563         List<JCDirective> directives = copy(t.directives);
564         return M.at(t.pos).ModuleDef(mods, t.getModuleType(), qualId, directives);
565     }
566 
567     @Override @DefinedBy(Api.COMPILER_TREE)
568     public JCExports visitExports(ExportsTree node, P p) {
569         JCExports t = (JCExports) node;

181         List<JCExpression> implementing = copy(t.implementing, p);
182         List<JCTree> defs = copy(t.defs, p);
183         return M.at(t.pos).ClassDef(mods, t.name, typarams, extending, implementing, defs);
184     }
185 
186     @DefinedBy(Api.COMPILER_TREE)
187     public JCTree visitConditionalExpression(ConditionalExpressionTree node, P p) {
188         JCConditional t = (JCConditional) node;
189         JCExpression cond = copy(t.cond, p);
190         JCExpression truepart = copy(t.truepart, p);
191         JCExpression falsepart = copy(t.falsepart, p);
192         return M.at(t.pos).Conditional(cond, truepart, falsepart);
193     }
194 
195     @DefinedBy(Api.COMPILER_TREE)
196     public JCTree visitContinue(ContinueTree node, P p) {
197         JCContinue t = (JCContinue) node;
198         return M.at(t.pos).Continue(t.label);
199     }
200 
201     @DefinedBy(Api.COMPILER_TREE)
202     public JCTree visitDefaultValue(DefaultValueTree node, P p) {
203         JCDefaultValue t = (JCDefaultValue) node;
204         JCExpression clazz = copy(t.clazz, p);
205         return M.at(t.pos).DefaultValue(clazz);
206     }
207 
208     @DefinedBy(Api.COMPILER_TREE)
209     public JCTree visitDoWhileLoop(DoWhileLoopTree node, P p) {
210         JCDoWhileLoop t = (JCDoWhileLoop) node;
211         JCStatement body = copy(t.body, p);
212         JCExpression cond = copy(t.cond, p);
213         return M.at(t.pos).DoLoop(body, cond);
214     }
215 
216     @DefinedBy(Api.COMPILER_TREE)
217     public JCTree visitErroneous(ErroneousTree node, P p) {
218         JCErroneous t = (JCErroneous) node;
219         List<? extends JCTree> errs = copy(t.errs, p);
220         return M.at(t.pos).Erroneous(errs);
221     }
222 
223     @DefinedBy(Api.COMPILER_TREE)
224     public JCTree visitExpressionStatement(ExpressionStatementTree node, P p) {
225         JCExpressionStatement t = (JCExpressionStatement) node;
226         JCExpression expr = copy(t.expr, p);
227         return M.at(t.pos).Exec(expr);

232         JCEnhancedForLoop t = (JCEnhancedForLoop) node;
233         JCVariableDecl var = copy(t.var, p);
234         JCExpression expr = copy(t.expr, p);
235         JCStatement body = copy(t.body, p);
236         return M.at(t.pos).ForeachLoop(var, expr, body);
237     }
238 
239     @DefinedBy(Api.COMPILER_TREE)
240     public JCTree visitForLoop(ForLoopTree node, P p) {
241         JCForLoop t = (JCForLoop) node;
242         List<JCStatement> init = copy(t.init, p);
243         JCExpression cond = copy(t.cond, p);
244         List<JCExpressionStatement> step = copy(t.step, p);
245         JCStatement body = copy(t.body, p);
246         return M.at(t.pos).ForLoop(init, cond, step, body);
247     }
248 
249     @DefinedBy(Api.COMPILER_TREE)
250     public JCTree visitIdentifier(IdentifierTree node, P p) {
251         JCIdent t = (JCIdent) node;
252         JCIdent ident = M.at(t.pos).Ident(t.name);
253         return ident;
254     }
255 
256     @DefinedBy(Api.COMPILER_TREE)
257     public JCTree visitIf(IfTree node, P p) {
258         JCIf t = (JCIf) node;
259         JCExpression cond = copy(t.cond, p);
260         JCStatement thenpart = copy(t.thenpart, p);
261         JCStatement elsepart = copy(t.elsepart, p);
262         return M.at(t.pos).If(cond, thenpart, elsepart);
263     }
264 
265     @DefinedBy(Api.COMPILER_TREE)
266     public JCTree visitImport(ImportTree node, P p) {
267         JCImport t = (JCImport) node;
268         JCTree qualid = copy(t.qualid, p);
269         return M.at(t.pos).Import(qualid, t.staticImport);
270     }
271 
272     @DefinedBy(Api.COMPILER_TREE)
273     public JCTree visitArrayAccess(ArrayAccessTree node, P p) {

349     }
350 
351     @DefinedBy(Api.COMPILER_TREE)
352     public JCTree visitParenthesized(ParenthesizedTree node, P p) {
353         JCParens t = (JCParens) node;
354         JCExpression expr = copy(t.expr, p);
355         return M.at(t.pos).Parens(expr);
356     }
357 
358     @DefinedBy(Api.COMPILER_TREE)
359     public JCTree visitReturn(ReturnTree node, P p) {
360         JCReturn t = (JCReturn) node;
361         JCExpression expr = copy(t.expr, p);
362         return M.at(t.pos).Return(expr);
363     }
364 
365     @DefinedBy(Api.COMPILER_TREE)
366     public JCTree visitMemberSelect(MemberSelectTree node, P p) {
367         JCFieldAccess t = (JCFieldAccess) node;
368         JCExpression selected = copy(t.selected, p);
369         JCFieldAccess select = M.at(t.pos).Select(selected, t.name);
370         return select;
371     }
372 
373     @DefinedBy(Api.COMPILER_TREE)
374     public JCTree visitMemberReference(MemberReferenceTree node, P p) {
375         JCMemberReference t = (JCMemberReference) node;
376         JCExpression expr = copy(t.expr, p);
377         List<JCExpression> typeargs = copy(t.typeargs, p);
378         return M.at(t.pos).Reference(t.mode, t.name, expr, typeargs);
379     }
380 
381     @DefinedBy(Api.COMPILER_TREE)
382     public JCTree visitEmptyStatement(EmptyStatementTree node, P p) {
383         JCSkip t = (JCSkip) node;
384         return M.at(t.pos).Skip();
385     }
386 
387     @DefinedBy(Api.COMPILER_TREE)
388     public JCTree visitSwitch(SwitchTree node, P p) {
389         JCSwitch t = (JCSwitch) node;
390         JCExpression selector = copy(t.selector, p);

539         JCVariableDecl t = (JCVariableDecl) node;
540         JCModifiers mods = copy(t.mods, p);
541         JCExpression vartype = copy(t.vartype, p);
542         if (t.nameexpr == null) {
543             JCExpression init = copy(t.init, p);
544             return M.at(t.pos).VarDef(mods, t.name, vartype, init);
545         } else {
546             JCExpression nameexpr = copy(t.nameexpr, p);
547             return M.at(t.pos).ReceiverVarDef(mods, nameexpr, vartype);
548         }
549     }
550 
551     @DefinedBy(Api.COMPILER_TREE)
552     public JCTree visitWhileLoop(WhileLoopTree node, P p) {
553         JCWhileLoop t = (JCWhileLoop) node;
554         JCStatement body = copy(t.body, p);
555         JCExpression cond = copy(t.cond, p);
556         return M.at(t.pos).WhileLoop(cond, body);
557     }
558 
559     @DefinedBy(Api.COMPILER_TREE)
560     public JCTree visitWithField(WithFieldTree node, P p) {
561         JCWithField t = (JCWithField) node;
562         JCExpression field = copy(t.field, p);
563         JCExpression value = copy(t.value, p);
564         return M.at(t.pos).WithField(field, value);
565     }
566 
567     @DefinedBy(Api.COMPILER_TREE)
568     public JCTree visitWildcard(WildcardTree node, P p) {
569         JCWildcard t = (JCWildcard) node;
570         TypeBoundKind kind = M.at(t.kind.pos).TypeBoundKind(t.kind.kind);
571         JCTree inner = copy(t.inner, p);
572         return M.at(t.pos).Wildcard(kind, inner);
573     }
574 
575     @Override @DefinedBy(Api.COMPILER_TREE)
576     public JCTree visitModule(ModuleTree node, P p) {
577         JCModuleDecl t = (JCModuleDecl) node;
578         JCModifiers mods = copy(t.mods, p);
579         JCExpression qualId = copy(t.qualId);
580         List<JCDirective> directives = copy(t.directives);
581         return M.at(t.pos).ModuleDef(mods, t.getModuleType(), qualId, directives);
582     }
583 
584     @Override @DefinedBy(Api.COMPILER_TREE)
585     public JCExports visitExports(ExportsTree node, P p) {
586         JCExports t = (JCExports) node;
< prev index next >