1/*
2 * Copyright (C) 2007-2010 Júlio Vilmar Gesser.
3 * Copyright (C) 2011, 2013-2016 The JavaParser Team.
4 *
5 * This file is part of JavaParser.
6 *
7 * JavaParser can be used either under the terms of
8 * a) the GNU Lesser General Public License as published by
9 *     the Free Software Foundation, either version 3 of the License, or
10 *     (at your option) any later version.
11 * b) the terms of the Apache License
12 *
13 * You should have received a copy of both licenses in LICENCE.LGPL and
14 * LICENCE.APACHE. Please refer to those files for details.
15 *
16 * JavaParser is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 * GNU Lesser General Public License for more details.
20 */
21package com.github.javaparser.ast.visitor;
22
23import com.github.javaparser.ast.*;
24import com.github.javaparser.ast.body.*;
25import com.github.javaparser.ast.comments.BlockComment;
26import com.github.javaparser.ast.comments.JavadocComment;
27import com.github.javaparser.ast.comments.LineComment;
28import com.github.javaparser.ast.expr.*;
29import com.github.javaparser.ast.modules.*;
30import com.github.javaparser.ast.stmt.*;
31import com.github.javaparser.ast.type.*;
32import javax.annotation.Generated;
33import java.util.ArrayList;
34import java.util.List;
35import java.util.Objects;
36import java.util.stream.Collectors;
37
38/**
39 * A visitor that has a return value of ({@link List List<R>}), and has a default implementation for all its visit
40 * methods that visits their children in an unspecified order, and all visit methods
41 * that returns a value be added to a flattened {@link List List<R>}.
42 *
43 * @author Enno Boland
44 */
45public abstract class GenericListVisitorAdapter<R, A> implements GenericVisitor<List<R>, A> {
46
47    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
48    public List<R> visit(final AnnotationDeclaration n, final A arg) {
49        List<R> result = new ArrayList<>();
50        List<R> tmp;
51        {
52            tmp = n.getMembers().accept(this, arg);
53            if (tmp != null)
54                result.addAll(tmp);
55        }
56        {
57            tmp = n.getName().accept(this, arg);
58            if (tmp != null)
59                result.addAll(tmp);
60        }
61        {
62            tmp = n.getAnnotations().accept(this, arg);
63            if (tmp != null)
64                result.addAll(tmp);
65        }
66        if (n.getComment().isPresent()) {
67            tmp = n.getComment().get().accept(this, arg);
68            if (tmp != null)
69                result.addAll(tmp);
70        }
71        return result;
72    }
73
74    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
75    public List<R> visit(final AnnotationMemberDeclaration n, final A arg) {
76        List<R> result = new ArrayList<>();
77        List<R> tmp;
78        if (n.getDefaultValue().isPresent()) {
79            tmp = n.getDefaultValue().get().accept(this, arg);
80            if (tmp != null)
81                result.addAll(tmp);
82        }
83        {
84            tmp = n.getName().accept(this, arg);
85            if (tmp != null)
86                result.addAll(tmp);
87        }
88        {
89            tmp = n.getType().accept(this, arg);
90            if (tmp != null)
91                result.addAll(tmp);
92        }
93        {
94            tmp = n.getAnnotations().accept(this, arg);
95            if (tmp != null)
96                result.addAll(tmp);
97        }
98        if (n.getComment().isPresent()) {
99            tmp = n.getComment().get().accept(this, arg);
100            if (tmp != null)
101                result.addAll(tmp);
102        }
103        return result;
104    }
105
106    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
107    public List<R> visit(final ArrayAccessExpr n, final A arg) {
108        List<R> result = new ArrayList<>();
109        List<R> tmp;
110        {
111            tmp = n.getIndex().accept(this, arg);
112            if (tmp != null)
113                result.addAll(tmp);
114        }
115        {
116            tmp = n.getName().accept(this, arg);
117            if (tmp != null)
118                result.addAll(tmp);
119        }
120        if (n.getComment().isPresent()) {
121            tmp = n.getComment().get().accept(this, arg);
122            if (tmp != null)
123                result.addAll(tmp);
124        }
125        return result;
126    }
127
128    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
129    public List<R> visit(final ArrayCreationExpr n, final A arg) {
130        List<R> result = new ArrayList<>();
131        List<R> tmp;
132        {
133            tmp = n.getElementType().accept(this, arg);
134            if (tmp != null)
135                result.addAll(tmp);
136        }
137        if (n.getInitializer().isPresent()) {
138            tmp = n.getInitializer().get().accept(this, arg);
139            if (tmp != null)
140                result.addAll(tmp);
141        }
142        {
143            tmp = n.getLevels().accept(this, arg);
144            if (tmp != null)
145                result.addAll(tmp);
146        }
147        if (n.getComment().isPresent()) {
148            tmp = n.getComment().get().accept(this, arg);
149            if (tmp != null)
150                result.addAll(tmp);
151        }
152        return result;
153    }
154
155    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
156    public List<R> visit(final ArrayCreationLevel n, final A arg) {
157        List<R> result = new ArrayList<>();
158        List<R> tmp;
159        {
160            tmp = n.getAnnotations().accept(this, arg);
161            if (tmp != null)
162                result.addAll(tmp);
163        }
164        if (n.getDimension().isPresent()) {
165            tmp = n.getDimension().get().accept(this, arg);
166            if (tmp != null)
167                result.addAll(tmp);
168        }
169        if (n.getComment().isPresent()) {
170            tmp = n.getComment().get().accept(this, arg);
171            if (tmp != null)
172                result.addAll(tmp);
173        }
174        return result;
175    }
176
177    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
178    public List<R> visit(final ArrayInitializerExpr n, final A arg) {
179        List<R> result = new ArrayList<>();
180        List<R> tmp;
181        {
182            tmp = n.getValues().accept(this, arg);
183            if (tmp != null)
184                result.addAll(tmp);
185        }
186        if (n.getComment().isPresent()) {
187            tmp = n.getComment().get().accept(this, arg);
188            if (tmp != null)
189                result.addAll(tmp);
190        }
191        return result;
192    }
193
194    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
195    public List<R> visit(final ArrayType n, final A arg) {
196        List<R> result = new ArrayList<>();
197        List<R> tmp;
198        {
199            tmp = n.getComponentType().accept(this, arg);
200            if (tmp != null)
201                result.addAll(tmp);
202        }
203        {
204            tmp = n.getAnnotations().accept(this, arg);
205            if (tmp != null)
206                result.addAll(tmp);
207        }
208        if (n.getComment().isPresent()) {
209            tmp = n.getComment().get().accept(this, arg);
210            if (tmp != null)
211                result.addAll(tmp);
212        }
213        return result;
214    }
215
216    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
217    public List<R> visit(final AssertStmt n, final A arg) {
218        List<R> result = new ArrayList<>();
219        List<R> tmp;
220        {
221            tmp = n.getCheck().accept(this, arg);
222            if (tmp != null)
223                result.addAll(tmp);
224        }
225        if (n.getMessage().isPresent()) {
226            tmp = n.getMessage().get().accept(this, arg);
227            if (tmp != null)
228                result.addAll(tmp);
229        }
230        if (n.getComment().isPresent()) {
231            tmp = n.getComment().get().accept(this, arg);
232            if (tmp != null)
233                result.addAll(tmp);
234        }
235        return result;
236    }
237
238    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
239    public List<R> visit(final AssignExpr n, final A arg) {
240        List<R> result = new ArrayList<>();
241        List<R> tmp;
242        {
243            tmp = n.getTarget().accept(this, arg);
244            if (tmp != null)
245                result.addAll(tmp);
246        }
247        {
248            tmp = n.getValue().accept(this, arg);
249            if (tmp != null)
250                result.addAll(tmp);
251        }
252        if (n.getComment().isPresent()) {
253            tmp = n.getComment().get().accept(this, arg);
254            if (tmp != null)
255                result.addAll(tmp);
256        }
257        return result;
258    }
259
260    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
261    public List<R> visit(final BinaryExpr n, final A arg) {
262        List<R> result = new ArrayList<>();
263        List<R> tmp;
264        {
265            tmp = n.getLeft().accept(this, arg);
266            if (tmp != null)
267                result.addAll(tmp);
268        }
269        {
270            tmp = n.getRight().accept(this, arg);
271            if (tmp != null)
272                result.addAll(tmp);
273        }
274        if (n.getComment().isPresent()) {
275            tmp = n.getComment().get().accept(this, arg);
276            if (tmp != null)
277                result.addAll(tmp);
278        }
279        return result;
280    }
281
282    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
283    public List<R> visit(final BlockComment n, final A arg) {
284        List<R> result = new ArrayList<>();
285        List<R> tmp;
286        if (n.getComment().isPresent()) {
287            tmp = n.getComment().get().accept(this, arg);
288            if (tmp != null)
289                result.addAll(tmp);
290        }
291        return result;
292    }
293
294    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
295    public List<R> visit(final BlockStmt n, final A arg) {
296        List<R> result = new ArrayList<>();
297        List<R> tmp;
298        {
299            tmp = n.getStatements().accept(this, arg);
300            if (tmp != null)
301                result.addAll(tmp);
302        }
303        if (n.getComment().isPresent()) {
304            tmp = n.getComment().get().accept(this, arg);
305            if (tmp != null)
306                result.addAll(tmp);
307        }
308        return result;
309    }
310
311    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
312    public List<R> visit(final BooleanLiteralExpr n, final A arg) {
313        List<R> result = new ArrayList<>();
314        List<R> tmp;
315        if (n.getComment().isPresent()) {
316            tmp = n.getComment().get().accept(this, arg);
317            if (tmp != null)
318                result.addAll(tmp);
319        }
320        return result;
321    }
322
323    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
324    public List<R> visit(final BreakStmt n, final A arg) {
325        List<R> result = new ArrayList<>();
326        List<R> tmp;
327        if (n.getLabel().isPresent()) {
328            tmp = n.getLabel().get().accept(this, arg);
329            if (tmp != null)
330                result.addAll(tmp);
331        }
332        if (n.getComment().isPresent()) {
333            tmp = n.getComment().get().accept(this, arg);
334            if (tmp != null)
335                result.addAll(tmp);
336        }
337        return result;
338    }
339
340    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
341    public List<R> visit(final CastExpr n, final A arg) {
342        List<R> result = new ArrayList<>();
343        List<R> tmp;
344        {
345            tmp = n.getExpression().accept(this, arg);
346            if (tmp != null)
347                result.addAll(tmp);
348        }
349        {
350            tmp = n.getType().accept(this, arg);
351            if (tmp != null)
352                result.addAll(tmp);
353        }
354        if (n.getComment().isPresent()) {
355            tmp = n.getComment().get().accept(this, arg);
356            if (tmp != null)
357                result.addAll(tmp);
358        }
359        return result;
360    }
361
362    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
363    public List<R> visit(final CatchClause n, final A arg) {
364        List<R> result = new ArrayList<>();
365        List<R> tmp;
366        {
367            tmp = n.getBody().accept(this, arg);
368            if (tmp != null)
369                result.addAll(tmp);
370        }
371        {
372            tmp = n.getParameter().accept(this, arg);
373            if (tmp != null)
374                result.addAll(tmp);
375        }
376        if (n.getComment().isPresent()) {
377            tmp = n.getComment().get().accept(this, arg);
378            if (tmp != null)
379                result.addAll(tmp);
380        }
381        return result;
382    }
383
384    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
385    public List<R> visit(final CharLiteralExpr n, final A arg) {
386        List<R> result = new ArrayList<>();
387        List<R> tmp;
388        if (n.getComment().isPresent()) {
389            tmp = n.getComment().get().accept(this, arg);
390            if (tmp != null)
391                result.addAll(tmp);
392        }
393        return result;
394    }
395
396    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
397    public List<R> visit(final ClassExpr n, final A arg) {
398        List<R> result = new ArrayList<>();
399        List<R> tmp;
400        {
401            tmp = n.getType().accept(this, arg);
402            if (tmp != null)
403                result.addAll(tmp);
404        }
405        if (n.getComment().isPresent()) {
406            tmp = n.getComment().get().accept(this, arg);
407            if (tmp != null)
408                result.addAll(tmp);
409        }
410        return result;
411    }
412
413    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
414    public List<R> visit(final ClassOrInterfaceDeclaration n, final A arg) {
415        List<R> result = new ArrayList<>();
416        List<R> tmp;
417        {
418            tmp = n.getExtendedTypes().accept(this, arg);
419            if (tmp != null)
420                result.addAll(tmp);
421        }
422        {
423            tmp = n.getImplementedTypes().accept(this, arg);
424            if (tmp != null)
425                result.addAll(tmp);
426        }
427        {
428            tmp = n.getTypeParameters().accept(this, arg);
429            if (tmp != null)
430                result.addAll(tmp);
431        }
432        {
433            tmp = n.getMembers().accept(this, arg);
434            if (tmp != null)
435                result.addAll(tmp);
436        }
437        {
438            tmp = n.getName().accept(this, arg);
439            if (tmp != null)
440                result.addAll(tmp);
441        }
442        {
443            tmp = n.getAnnotations().accept(this, arg);
444            if (tmp != null)
445                result.addAll(tmp);
446        }
447        if (n.getComment().isPresent()) {
448            tmp = n.getComment().get().accept(this, arg);
449            if (tmp != null)
450                result.addAll(tmp);
451        }
452        return result;
453    }
454
455    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
456    public List<R> visit(final ClassOrInterfaceType n, final A arg) {
457        List<R> result = new ArrayList<>();
458        List<R> tmp;
459        {
460            tmp = n.getName().accept(this, arg);
461            if (tmp != null)
462                result.addAll(tmp);
463        }
464        if (n.getScope().isPresent()) {
465            tmp = n.getScope().get().accept(this, arg);
466            if (tmp != null)
467                result.addAll(tmp);
468        }
469        if (n.getTypeArguments().isPresent()) {
470            tmp = n.getTypeArguments().get().accept(this, arg);
471            if (tmp != null)
472                result.addAll(tmp);
473        }
474        {
475            tmp = n.getAnnotations().accept(this, arg);
476            if (tmp != null)
477                result.addAll(tmp);
478        }
479        if (n.getComment().isPresent()) {
480            tmp = n.getComment().get().accept(this, arg);
481            if (tmp != null)
482                result.addAll(tmp);
483        }
484        return result;
485    }
486
487    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
488    public List<R> visit(final CompilationUnit n, final A arg) {
489        List<R> result = new ArrayList<>();
490        List<R> tmp;
491        {
492            tmp = n.getImports().accept(this, arg);
493            if (tmp != null)
494                result.addAll(tmp);
495        }
496        if (n.getModule().isPresent()) {
497            tmp = n.getModule().get().accept(this, arg);
498            if (tmp != null)
499                result.addAll(tmp);
500        }
501        if (n.getPackageDeclaration().isPresent()) {
502            tmp = n.getPackageDeclaration().get().accept(this, arg);
503            if (tmp != null)
504                result.addAll(tmp);
505        }
506        {
507            tmp = n.getTypes().accept(this, arg);
508            if (tmp != null)
509                result.addAll(tmp);
510        }
511        if (n.getComment().isPresent()) {
512            tmp = n.getComment().get().accept(this, arg);
513            if (tmp != null)
514                result.addAll(tmp);
515        }
516        return result;
517    }
518
519    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
520    public List<R> visit(final ConditionalExpr n, final A arg) {
521        List<R> result = new ArrayList<>();
522        List<R> tmp;
523        {
524            tmp = n.getCondition().accept(this, arg);
525            if (tmp != null)
526                result.addAll(tmp);
527        }
528        {
529            tmp = n.getElseExpr().accept(this, arg);
530            if (tmp != null)
531                result.addAll(tmp);
532        }
533        {
534            tmp = n.getThenExpr().accept(this, arg);
535            if (tmp != null)
536                result.addAll(tmp);
537        }
538        if (n.getComment().isPresent()) {
539            tmp = n.getComment().get().accept(this, arg);
540            if (tmp != null)
541                result.addAll(tmp);
542        }
543        return result;
544    }
545
546    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
547    public List<R> visit(final ConstructorDeclaration n, final A arg) {
548        List<R> result = new ArrayList<>();
549        List<R> tmp;
550        {
551            tmp = n.getBody().accept(this, arg);
552            if (tmp != null)
553                result.addAll(tmp);
554        }
555        {
556            tmp = n.getName().accept(this, arg);
557            if (tmp != null)
558                result.addAll(tmp);
559        }
560        {
561            tmp = n.getParameters().accept(this, arg);
562            if (tmp != null)
563                result.addAll(tmp);
564        }
565        if (n.getReceiverParameter().isPresent()) {
566            tmp = n.getReceiverParameter().get().accept(this, arg);
567            if (tmp != null)
568                result.addAll(tmp);
569        }
570        {
571            tmp = n.getThrownExceptions().accept(this, arg);
572            if (tmp != null)
573                result.addAll(tmp);
574        }
575        {
576            tmp = n.getTypeParameters().accept(this, arg);
577            if (tmp != null)
578                result.addAll(tmp);
579        }
580        {
581            tmp = n.getAnnotations().accept(this, arg);
582            if (tmp != null)
583                result.addAll(tmp);
584        }
585        if (n.getComment().isPresent()) {
586            tmp = n.getComment().get().accept(this, arg);
587            if (tmp != null)
588                result.addAll(tmp);
589        }
590        return result;
591    }
592
593    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
594    public List<R> visit(final ContinueStmt n, final A arg) {
595        List<R> result = new ArrayList<>();
596        List<R> tmp;
597        if (n.getLabel().isPresent()) {
598            tmp = n.getLabel().get().accept(this, arg);
599            if (tmp != null)
600                result.addAll(tmp);
601        }
602        if (n.getComment().isPresent()) {
603            tmp = n.getComment().get().accept(this, arg);
604            if (tmp != null)
605                result.addAll(tmp);
606        }
607        return result;
608    }
609
610    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
611    public List<R> visit(final DoStmt n, final A arg) {
612        List<R> result = new ArrayList<>();
613        List<R> tmp;
614        {
615            tmp = n.getBody().accept(this, arg);
616            if (tmp != null)
617                result.addAll(tmp);
618        }
619        {
620            tmp = n.getCondition().accept(this, arg);
621            if (tmp != null)
622                result.addAll(tmp);
623        }
624        if (n.getComment().isPresent()) {
625            tmp = n.getComment().get().accept(this, arg);
626            if (tmp != null)
627                result.addAll(tmp);
628        }
629        return result;
630    }
631
632    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
633    public List<R> visit(final DoubleLiteralExpr n, final A arg) {
634        List<R> result = new ArrayList<>();
635        List<R> tmp;
636        if (n.getComment().isPresent()) {
637            tmp = n.getComment().get().accept(this, arg);
638            if (tmp != null)
639                result.addAll(tmp);
640        }
641        return result;
642    }
643
644    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
645    public List<R> visit(final EmptyStmt n, final A arg) {
646        List<R> result = new ArrayList<>();
647        List<R> tmp;
648        if (n.getComment().isPresent()) {
649            tmp = n.getComment().get().accept(this, arg);
650            if (tmp != null)
651                result.addAll(tmp);
652        }
653        return result;
654    }
655
656    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
657    public List<R> visit(final EnclosedExpr n, final A arg) {
658        List<R> result = new ArrayList<>();
659        List<R> tmp;
660        {
661            tmp = n.getInner().accept(this, arg);
662            if (tmp != null)
663                result.addAll(tmp);
664        }
665        if (n.getComment().isPresent()) {
666            tmp = n.getComment().get().accept(this, arg);
667            if (tmp != null)
668                result.addAll(tmp);
669        }
670        return result;
671    }
672
673    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
674    public List<R> visit(final EnumConstantDeclaration n, final A arg) {
675        List<R> result = new ArrayList<>();
676        List<R> tmp;
677        {
678            tmp = n.getArguments().accept(this, arg);
679            if (tmp != null)
680                result.addAll(tmp);
681        }
682        {
683            tmp = n.getClassBody().accept(this, arg);
684            if (tmp != null)
685                result.addAll(tmp);
686        }
687        {
688            tmp = n.getName().accept(this, arg);
689            if (tmp != null)
690                result.addAll(tmp);
691        }
692        {
693            tmp = n.getAnnotations().accept(this, arg);
694            if (tmp != null)
695                result.addAll(tmp);
696        }
697        if (n.getComment().isPresent()) {
698            tmp = n.getComment().get().accept(this, arg);
699            if (tmp != null)
700                result.addAll(tmp);
701        }
702        return result;
703    }
704
705    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
706    public List<R> visit(final EnumDeclaration n, final A arg) {
707        List<R> result = new ArrayList<>();
708        List<R> tmp;
709        {
710            tmp = n.getEntries().accept(this, arg);
711            if (tmp != null)
712                result.addAll(tmp);
713        }
714        {
715            tmp = n.getImplementedTypes().accept(this, arg);
716            if (tmp != null)
717                result.addAll(tmp);
718        }
719        {
720            tmp = n.getMembers().accept(this, arg);
721            if (tmp != null)
722                result.addAll(tmp);
723        }
724        {
725            tmp = n.getName().accept(this, arg);
726            if (tmp != null)
727                result.addAll(tmp);
728        }
729        {
730            tmp = n.getAnnotations().accept(this, arg);
731            if (tmp != null)
732                result.addAll(tmp);
733        }
734        if (n.getComment().isPresent()) {
735            tmp = n.getComment().get().accept(this, arg);
736            if (tmp != null)
737                result.addAll(tmp);
738        }
739        return result;
740    }
741
742    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
743    public List<R> visit(final ExplicitConstructorInvocationStmt n, final A arg) {
744        List<R> result = new ArrayList<>();
745        List<R> tmp;
746        {
747            tmp = n.getArguments().accept(this, arg);
748            if (tmp != null)
749                result.addAll(tmp);
750        }
751        if (n.getExpression().isPresent()) {
752            tmp = n.getExpression().get().accept(this, arg);
753            if (tmp != null)
754                result.addAll(tmp);
755        }
756        if (n.getTypeArguments().isPresent()) {
757            tmp = n.getTypeArguments().get().accept(this, arg);
758            if (tmp != null)
759                result.addAll(tmp);
760        }
761        if (n.getComment().isPresent()) {
762            tmp = n.getComment().get().accept(this, arg);
763            if (tmp != null)
764                result.addAll(tmp);
765        }
766        return result;
767    }
768
769    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
770    public List<R> visit(final ExpressionStmt n, final A arg) {
771        List<R> result = new ArrayList<>();
772        List<R> tmp;
773        {
774            tmp = n.getExpression().accept(this, arg);
775            if (tmp != null)
776                result.addAll(tmp);
777        }
778        if (n.getComment().isPresent()) {
779            tmp = n.getComment().get().accept(this, arg);
780            if (tmp != null)
781                result.addAll(tmp);
782        }
783        return result;
784    }
785
786    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
787    public List<R> visit(final FieldAccessExpr n, final A arg) {
788        List<R> result = new ArrayList<>();
789        List<R> tmp;
790        {
791            tmp = n.getName().accept(this, arg);
792            if (tmp != null)
793                result.addAll(tmp);
794        }
795        {
796            tmp = n.getScope().accept(this, arg);
797            if (tmp != null)
798                result.addAll(tmp);
799        }
800        if (n.getTypeArguments().isPresent()) {
801            tmp = n.getTypeArguments().get().accept(this, arg);
802            if (tmp != null)
803                result.addAll(tmp);
804        }
805        if (n.getComment().isPresent()) {
806            tmp = n.getComment().get().accept(this, arg);
807            if (tmp != null)
808                result.addAll(tmp);
809        }
810        return result;
811    }
812
813    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
814    public List<R> visit(final FieldDeclaration n, final A arg) {
815        List<R> result = new ArrayList<>();
816        List<R> tmp;
817        {
818            tmp = n.getVariables().accept(this, arg);
819            if (tmp != null)
820                result.addAll(tmp);
821        }
822        {
823            tmp = n.getAnnotations().accept(this, arg);
824            if (tmp != null)
825                result.addAll(tmp);
826        }
827        if (n.getComment().isPresent()) {
828            tmp = n.getComment().get().accept(this, arg);
829            if (tmp != null)
830                result.addAll(tmp);
831        }
832        return result;
833    }
834
835    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
836    public List<R> visit(final ForStmt n, final A arg) {
837        List<R> result = new ArrayList<>();
838        List<R> tmp;
839        {
840            tmp = n.getBody().accept(this, arg);
841            if (tmp != null)
842                result.addAll(tmp);
843        }
844        if (n.getCompare().isPresent()) {
845            tmp = n.getCompare().get().accept(this, arg);
846            if (tmp != null)
847                result.addAll(tmp);
848        }
849        {
850            tmp = n.getInitialization().accept(this, arg);
851            if (tmp != null)
852                result.addAll(tmp);
853        }
854        {
855            tmp = n.getUpdate().accept(this, arg);
856            if (tmp != null)
857                result.addAll(tmp);
858        }
859        if (n.getComment().isPresent()) {
860            tmp = n.getComment().get().accept(this, arg);
861            if (tmp != null)
862                result.addAll(tmp);
863        }
864        return result;
865    }
866
867    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
868    public List<R> visit(final ForeachStmt n, final A arg) {
869        List<R> result = new ArrayList<>();
870        List<R> tmp;
871        {
872            tmp = n.getBody().accept(this, arg);
873            if (tmp != null)
874                result.addAll(tmp);
875        }
876        {
877            tmp = n.getIterable().accept(this, arg);
878            if (tmp != null)
879                result.addAll(tmp);
880        }
881        {
882            tmp = n.getVariable().accept(this, arg);
883            if (tmp != null)
884                result.addAll(tmp);
885        }
886        if (n.getComment().isPresent()) {
887            tmp = n.getComment().get().accept(this, arg);
888            if (tmp != null)
889                result.addAll(tmp);
890        }
891        return result;
892    }
893
894    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
895    public List<R> visit(final IfStmt n, final A arg) {
896        List<R> result = new ArrayList<>();
897        List<R> tmp;
898        {
899            tmp = n.getCondition().accept(this, arg);
900            if (tmp != null)
901                result.addAll(tmp);
902        }
903        if (n.getElseStmt().isPresent()) {
904            tmp = n.getElseStmt().get().accept(this, arg);
905            if (tmp != null)
906                result.addAll(tmp);
907        }
908        {
909            tmp = n.getThenStmt().accept(this, arg);
910            if (tmp != null)
911                result.addAll(tmp);
912        }
913        if (n.getComment().isPresent()) {
914            tmp = n.getComment().get().accept(this, arg);
915            if (tmp != null)
916                result.addAll(tmp);
917        }
918        return result;
919    }
920
921    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
922    public List<R> visit(final ImportDeclaration n, final A arg) {
923        List<R> result = new ArrayList<>();
924        List<R> tmp;
925        {
926            tmp = n.getName().accept(this, arg);
927            if (tmp != null)
928                result.addAll(tmp);
929        }
930        if (n.getComment().isPresent()) {
931            tmp = n.getComment().get().accept(this, arg);
932            if (tmp != null)
933                result.addAll(tmp);
934        }
935        return result;
936    }
937
938    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
939    public List<R> visit(final InitializerDeclaration n, final A arg) {
940        List<R> result = new ArrayList<>();
941        List<R> tmp;
942        {
943            tmp = n.getBody().accept(this, arg);
944            if (tmp != null)
945                result.addAll(tmp);
946        }
947        {
948            tmp = n.getAnnotations().accept(this, arg);
949            if (tmp != null)
950                result.addAll(tmp);
951        }
952        if (n.getComment().isPresent()) {
953            tmp = n.getComment().get().accept(this, arg);
954            if (tmp != null)
955                result.addAll(tmp);
956        }
957        return result;
958    }
959
960    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
961    public List<R> visit(final InstanceOfExpr n, final A arg) {
962        List<R> result = new ArrayList<>();
963        List<R> tmp;
964        {
965            tmp = n.getExpression().accept(this, arg);
966            if (tmp != null)
967                result.addAll(tmp);
968        }
969        {
970            tmp = n.getType().accept(this, arg);
971            if (tmp != null)
972                result.addAll(tmp);
973        }
974        if (n.getComment().isPresent()) {
975            tmp = n.getComment().get().accept(this, arg);
976            if (tmp != null)
977                result.addAll(tmp);
978        }
979        return result;
980    }
981
982    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
983    public List<R> visit(final IntegerLiteralExpr n, final A arg) {
984        List<R> result = new ArrayList<>();
985        List<R> tmp;
986        if (n.getComment().isPresent()) {
987            tmp = n.getComment().get().accept(this, arg);
988            if (tmp != null)
989                result.addAll(tmp);
990        }
991        return result;
992    }
993
994    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
995    public List<R> visit(final IntersectionType n, final A arg) {
996        List<R> result = new ArrayList<>();
997        List<R> tmp;
998        {
999            tmp = n.getElements().accept(this, arg);
1000            if (tmp != null)
1001                result.addAll(tmp);
1002        }
1003        {
1004            tmp = n.getAnnotations().accept(this, arg);
1005            if (tmp != null)
1006                result.addAll(tmp);
1007        }
1008        if (n.getComment().isPresent()) {
1009            tmp = n.getComment().get().accept(this, arg);
1010            if (tmp != null)
1011                result.addAll(tmp);
1012        }
1013        return result;
1014    }
1015
1016    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1017    public List<R> visit(final JavadocComment n, final A arg) {
1018        List<R> result = new ArrayList<>();
1019        List<R> tmp;
1020        if (n.getComment().isPresent()) {
1021            tmp = n.getComment().get().accept(this, arg);
1022            if (tmp != null)
1023                result.addAll(tmp);
1024        }
1025        return result;
1026    }
1027
1028    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1029    public List<R> visit(final LabeledStmt n, final A arg) {
1030        List<R> result = new ArrayList<>();
1031        List<R> tmp;
1032        {
1033            tmp = n.getLabel().accept(this, arg);
1034            if (tmp != null)
1035                result.addAll(tmp);
1036        }
1037        {
1038            tmp = n.getStatement().accept(this, arg);
1039            if (tmp != null)
1040                result.addAll(tmp);
1041        }
1042        if (n.getComment().isPresent()) {
1043            tmp = n.getComment().get().accept(this, arg);
1044            if (tmp != null)
1045                result.addAll(tmp);
1046        }
1047        return result;
1048    }
1049
1050    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1051    public List<R> visit(final LambdaExpr n, final A arg) {
1052        List<R> result = new ArrayList<>();
1053        List<R> tmp;
1054        {
1055            tmp = n.getBody().accept(this, arg);
1056            if (tmp != null)
1057                result.addAll(tmp);
1058        }
1059        {
1060            tmp = n.getParameters().accept(this, arg);
1061            if (tmp != null)
1062                result.addAll(tmp);
1063        }
1064        if (n.getComment().isPresent()) {
1065            tmp = n.getComment().get().accept(this, arg);
1066            if (tmp != null)
1067                result.addAll(tmp);
1068        }
1069        return result;
1070    }
1071
1072    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1073    public List<R> visit(final LineComment n, final A arg) {
1074        List<R> result = new ArrayList<>();
1075        List<R> tmp;
1076        if (n.getComment().isPresent()) {
1077            tmp = n.getComment().get().accept(this, arg);
1078            if (tmp != null)
1079                result.addAll(tmp);
1080        }
1081        return result;
1082    }
1083
1084    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1085    public List<R> visit(final LocalClassDeclarationStmt n, final A arg) {
1086        List<R> result = new ArrayList<>();
1087        List<R> tmp;
1088        {
1089            tmp = n.getClassDeclaration().accept(this, arg);
1090            if (tmp != null)
1091                result.addAll(tmp);
1092        }
1093        if (n.getComment().isPresent()) {
1094            tmp = n.getComment().get().accept(this, arg);
1095            if (tmp != null)
1096                result.addAll(tmp);
1097        }
1098        return result;
1099    }
1100
1101    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1102    public List<R> visit(final LongLiteralExpr n, final A arg) {
1103        List<R> result = new ArrayList<>();
1104        List<R> tmp;
1105        if (n.getComment().isPresent()) {
1106            tmp = n.getComment().get().accept(this, arg);
1107            if (tmp != null)
1108                result.addAll(tmp);
1109        }
1110        return result;
1111    }
1112
1113    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1114    public List<R> visit(final MarkerAnnotationExpr n, final A arg) {
1115        List<R> result = new ArrayList<>();
1116        List<R> tmp;
1117        {
1118            tmp = n.getName().accept(this, arg);
1119            if (tmp != null)
1120                result.addAll(tmp);
1121        }
1122        if (n.getComment().isPresent()) {
1123            tmp = n.getComment().get().accept(this, arg);
1124            if (tmp != null)
1125                result.addAll(tmp);
1126        }
1127        return result;
1128    }
1129
1130    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1131    public List<R> visit(final MemberValuePair n, final A arg) {
1132        List<R> result = new ArrayList<>();
1133        List<R> tmp;
1134        {
1135            tmp = n.getName().accept(this, arg);
1136            if (tmp != null)
1137                result.addAll(tmp);
1138        }
1139        {
1140            tmp = n.getValue().accept(this, arg);
1141            if (tmp != null)
1142                result.addAll(tmp);
1143        }
1144        if (n.getComment().isPresent()) {
1145            tmp = n.getComment().get().accept(this, arg);
1146            if (tmp != null)
1147                result.addAll(tmp);
1148        }
1149        return result;
1150    }
1151
1152    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1153    public List<R> visit(final MethodCallExpr n, final A arg) {
1154        List<R> result = new ArrayList<>();
1155        List<R> tmp;
1156        {
1157            tmp = n.getArguments().accept(this, arg);
1158            if (tmp != null)
1159                result.addAll(tmp);
1160        }
1161        {
1162            tmp = n.getName().accept(this, arg);
1163            if (tmp != null)
1164                result.addAll(tmp);
1165        }
1166        if (n.getScope().isPresent()) {
1167            tmp = n.getScope().get().accept(this, arg);
1168            if (tmp != null)
1169                result.addAll(tmp);
1170        }
1171        if (n.getTypeArguments().isPresent()) {
1172            tmp = n.getTypeArguments().get().accept(this, arg);
1173            if (tmp != null)
1174                result.addAll(tmp);
1175        }
1176        if (n.getComment().isPresent()) {
1177            tmp = n.getComment().get().accept(this, arg);
1178            if (tmp != null)
1179                result.addAll(tmp);
1180        }
1181        return result;
1182    }
1183
1184    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1185    public List<R> visit(final MethodDeclaration n, final A arg) {
1186        List<R> result = new ArrayList<>();
1187        List<R> tmp;
1188        if (n.getBody().isPresent()) {
1189            tmp = n.getBody().get().accept(this, arg);
1190            if (tmp != null)
1191                result.addAll(tmp);
1192        }
1193        {
1194            tmp = n.getType().accept(this, arg);
1195            if (tmp != null)
1196                result.addAll(tmp);
1197        }
1198        {
1199            tmp = n.getName().accept(this, arg);
1200            if (tmp != null)
1201                result.addAll(tmp);
1202        }
1203        {
1204            tmp = n.getParameters().accept(this, arg);
1205            if (tmp != null)
1206                result.addAll(tmp);
1207        }
1208        if (n.getReceiverParameter().isPresent()) {
1209            tmp = n.getReceiverParameter().get().accept(this, arg);
1210            if (tmp != null)
1211                result.addAll(tmp);
1212        }
1213        {
1214            tmp = n.getThrownExceptions().accept(this, arg);
1215            if (tmp != null)
1216                result.addAll(tmp);
1217        }
1218        {
1219            tmp = n.getTypeParameters().accept(this, arg);
1220            if (tmp != null)
1221                result.addAll(tmp);
1222        }
1223        {
1224            tmp = n.getAnnotations().accept(this, arg);
1225            if (tmp != null)
1226                result.addAll(tmp);
1227        }
1228        if (n.getComment().isPresent()) {
1229            tmp = n.getComment().get().accept(this, arg);
1230            if (tmp != null)
1231                result.addAll(tmp);
1232        }
1233        return result;
1234    }
1235
1236    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1237    public List<R> visit(final MethodReferenceExpr n, final A arg) {
1238        List<R> result = new ArrayList<>();
1239        List<R> tmp;
1240        {
1241            tmp = n.getScope().accept(this, arg);
1242            if (tmp != null)
1243                result.addAll(tmp);
1244        }
1245        if (n.getTypeArguments().isPresent()) {
1246            tmp = n.getTypeArguments().get().accept(this, arg);
1247            if (tmp != null)
1248                result.addAll(tmp);
1249        }
1250        if (n.getComment().isPresent()) {
1251            tmp = n.getComment().get().accept(this, arg);
1252            if (tmp != null)
1253                result.addAll(tmp);
1254        }
1255        return result;
1256    }
1257
1258    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1259    public List<R> visit(final NameExpr n, final A arg) {
1260        List<R> result = new ArrayList<>();
1261        List<R> tmp;
1262        {
1263            tmp = n.getName().accept(this, arg);
1264            if (tmp != null)
1265                result.addAll(tmp);
1266        }
1267        if (n.getComment().isPresent()) {
1268            tmp = n.getComment().get().accept(this, arg);
1269            if (tmp != null)
1270                result.addAll(tmp);
1271        }
1272        return result;
1273    }
1274
1275    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1276    public List<R> visit(final Name n, final A arg) {
1277        List<R> result = new ArrayList<>();
1278        List<R> tmp;
1279        {
1280            tmp = n.getAnnotations().accept(this, arg);
1281            if (tmp != null)
1282                result.addAll(tmp);
1283        }
1284        if (n.getQualifier().isPresent()) {
1285            tmp = n.getQualifier().get().accept(this, arg);
1286            if (tmp != null)
1287                result.addAll(tmp);
1288        }
1289        if (n.getComment().isPresent()) {
1290            tmp = n.getComment().get().accept(this, arg);
1291            if (tmp != null)
1292                result.addAll(tmp);
1293        }
1294        return result;
1295    }
1296
1297    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1298    public List<R> visit(final NormalAnnotationExpr n, final A arg) {
1299        List<R> result = new ArrayList<>();
1300        List<R> tmp;
1301        {
1302            tmp = n.getPairs().accept(this, arg);
1303            if (tmp != null)
1304                result.addAll(tmp);
1305        }
1306        {
1307            tmp = n.getName().accept(this, arg);
1308            if (tmp != null)
1309                result.addAll(tmp);
1310        }
1311        if (n.getComment().isPresent()) {
1312            tmp = n.getComment().get().accept(this, arg);
1313            if (tmp != null)
1314                result.addAll(tmp);
1315        }
1316        return result;
1317    }
1318
1319    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1320    public List<R> visit(final NullLiteralExpr n, final A arg) {
1321        List<R> result = new ArrayList<>();
1322        List<R> tmp;
1323        if (n.getComment().isPresent()) {
1324            tmp = n.getComment().get().accept(this, arg);
1325            if (tmp != null)
1326                result.addAll(tmp);
1327        }
1328        return result;
1329    }
1330
1331    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1332    public List<R> visit(final ObjectCreationExpr n, final A arg) {
1333        List<R> result = new ArrayList<>();
1334        List<R> tmp;
1335        if (n.getAnonymousClassBody().isPresent()) {
1336            tmp = n.getAnonymousClassBody().get().accept(this, arg);
1337            if (tmp != null)
1338                result.addAll(tmp);
1339        }
1340        {
1341            tmp = n.getArguments().accept(this, arg);
1342            if (tmp != null)
1343                result.addAll(tmp);
1344        }
1345        if (n.getScope().isPresent()) {
1346            tmp = n.getScope().get().accept(this, arg);
1347            if (tmp != null)
1348                result.addAll(tmp);
1349        }
1350        {
1351            tmp = n.getType().accept(this, arg);
1352            if (tmp != null)
1353                result.addAll(tmp);
1354        }
1355        if (n.getTypeArguments().isPresent()) {
1356            tmp = n.getTypeArguments().get().accept(this, arg);
1357            if (tmp != null)
1358                result.addAll(tmp);
1359        }
1360        if (n.getComment().isPresent()) {
1361            tmp = n.getComment().get().accept(this, arg);
1362            if (tmp != null)
1363                result.addAll(tmp);
1364        }
1365        return result;
1366    }
1367
1368    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1369    public List<R> visit(final PackageDeclaration n, final A arg) {
1370        List<R> result = new ArrayList<>();
1371        List<R> tmp;
1372        {
1373            tmp = n.getAnnotations().accept(this, arg);
1374            if (tmp != null)
1375                result.addAll(tmp);
1376        }
1377        {
1378            tmp = n.getName().accept(this, arg);
1379            if (tmp != null)
1380                result.addAll(tmp);
1381        }
1382        if (n.getComment().isPresent()) {
1383            tmp = n.getComment().get().accept(this, arg);
1384            if (tmp != null)
1385                result.addAll(tmp);
1386        }
1387        return result;
1388    }
1389
1390    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1391    public List<R> visit(final Parameter n, final A arg) {
1392        List<R> result = new ArrayList<>();
1393        List<R> tmp;
1394        {
1395            tmp = n.getAnnotations().accept(this, arg);
1396            if (tmp != null)
1397                result.addAll(tmp);
1398        }
1399        {
1400            tmp = n.getName().accept(this, arg);
1401            if (tmp != null)
1402                result.addAll(tmp);
1403        }
1404        {
1405            tmp = n.getType().accept(this, arg);
1406            if (tmp != null)
1407                result.addAll(tmp);
1408        }
1409        {
1410            tmp = n.getVarArgsAnnotations().accept(this, arg);
1411            if (tmp != null)
1412                result.addAll(tmp);
1413        }
1414        if (n.getComment().isPresent()) {
1415            tmp = n.getComment().get().accept(this, arg);
1416            if (tmp != null)
1417                result.addAll(tmp);
1418        }
1419        return result;
1420    }
1421
1422    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1423    public List<R> visit(final PrimitiveType n, final A arg) {
1424        List<R> result = new ArrayList<>();
1425        List<R> tmp;
1426        {
1427            tmp = n.getAnnotations().accept(this, arg);
1428            if (tmp != null)
1429                result.addAll(tmp);
1430        }
1431        if (n.getComment().isPresent()) {
1432            tmp = n.getComment().get().accept(this, arg);
1433            if (tmp != null)
1434                result.addAll(tmp);
1435        }
1436        return result;
1437    }
1438
1439    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1440    public List<R> visit(final ReturnStmt n, final A arg) {
1441        List<R> result = new ArrayList<>();
1442        List<R> tmp;
1443        if (n.getExpression().isPresent()) {
1444            tmp = n.getExpression().get().accept(this, arg);
1445            if (tmp != null)
1446                result.addAll(tmp);
1447        }
1448        if (n.getComment().isPresent()) {
1449            tmp = n.getComment().get().accept(this, arg);
1450            if (tmp != null)
1451                result.addAll(tmp);
1452        }
1453        return result;
1454    }
1455
1456    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1457    public List<R> visit(final SimpleName n, final A arg) {
1458        List<R> result = new ArrayList<>();
1459        List<R> tmp;
1460        if (n.getComment().isPresent()) {
1461            tmp = n.getComment().get().accept(this, arg);
1462            if (tmp != null)
1463                result.addAll(tmp);
1464        }
1465        return result;
1466    }
1467
1468    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1469    public List<R> visit(final SingleMemberAnnotationExpr n, final A arg) {
1470        List<R> result = new ArrayList<>();
1471        List<R> tmp;
1472        {
1473            tmp = n.getMemberValue().accept(this, arg);
1474            if (tmp != null)
1475                result.addAll(tmp);
1476        }
1477        {
1478            tmp = n.getName().accept(this, arg);
1479            if (tmp != null)
1480                result.addAll(tmp);
1481        }
1482        if (n.getComment().isPresent()) {
1483            tmp = n.getComment().get().accept(this, arg);
1484            if (tmp != null)
1485                result.addAll(tmp);
1486        }
1487        return result;
1488    }
1489
1490    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1491    public List<R> visit(final StringLiteralExpr n, final A arg) {
1492        List<R> result = new ArrayList<>();
1493        List<R> tmp;
1494        if (n.getComment().isPresent()) {
1495            tmp = n.getComment().get().accept(this, arg);
1496            if (tmp != null)
1497                result.addAll(tmp);
1498        }
1499        return result;
1500    }
1501
1502    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1503    public List<R> visit(final SuperExpr n, final A arg) {
1504        List<R> result = new ArrayList<>();
1505        List<R> tmp;
1506        if (n.getClassExpr().isPresent()) {
1507            tmp = n.getClassExpr().get().accept(this, arg);
1508            if (tmp != null)
1509                result.addAll(tmp);
1510        }
1511        if (n.getComment().isPresent()) {
1512            tmp = n.getComment().get().accept(this, arg);
1513            if (tmp != null)
1514                result.addAll(tmp);
1515        }
1516        return result;
1517    }
1518
1519    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1520    public List<R> visit(final SwitchEntryStmt n, final A arg) {
1521        List<R> result = new ArrayList<>();
1522        List<R> tmp;
1523        if (n.getLabel().isPresent()) {
1524            tmp = n.getLabel().get().accept(this, arg);
1525            if (tmp != null)
1526                result.addAll(tmp);
1527        }
1528        {
1529            tmp = n.getStatements().accept(this, arg);
1530            if (tmp != null)
1531                result.addAll(tmp);
1532        }
1533        if (n.getComment().isPresent()) {
1534            tmp = n.getComment().get().accept(this, arg);
1535            if (tmp != null)
1536                result.addAll(tmp);
1537        }
1538        return result;
1539    }
1540
1541    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1542    public List<R> visit(final SwitchStmt n, final A arg) {
1543        List<R> result = new ArrayList<>();
1544        List<R> tmp;
1545        {
1546            tmp = n.getEntries().accept(this, arg);
1547            if (tmp != null)
1548                result.addAll(tmp);
1549        }
1550        {
1551            tmp = n.getSelector().accept(this, arg);
1552            if (tmp != null)
1553                result.addAll(tmp);
1554        }
1555        if (n.getComment().isPresent()) {
1556            tmp = n.getComment().get().accept(this, arg);
1557            if (tmp != null)
1558                result.addAll(tmp);
1559        }
1560        return result;
1561    }
1562
1563    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1564    public List<R> visit(final SynchronizedStmt n, final A arg) {
1565        List<R> result = new ArrayList<>();
1566        List<R> tmp;
1567        {
1568            tmp = n.getBody().accept(this, arg);
1569            if (tmp != null)
1570                result.addAll(tmp);
1571        }
1572        {
1573            tmp = n.getExpression().accept(this, arg);
1574            if (tmp != null)
1575                result.addAll(tmp);
1576        }
1577        if (n.getComment().isPresent()) {
1578            tmp = n.getComment().get().accept(this, arg);
1579            if (tmp != null)
1580                result.addAll(tmp);
1581        }
1582        return result;
1583    }
1584
1585    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1586    public List<R> visit(final ThisExpr n, final A arg) {
1587        List<R> result = new ArrayList<>();
1588        List<R> tmp;
1589        if (n.getClassExpr().isPresent()) {
1590            tmp = n.getClassExpr().get().accept(this, arg);
1591            if (tmp != null)
1592                result.addAll(tmp);
1593        }
1594        if (n.getComment().isPresent()) {
1595            tmp = n.getComment().get().accept(this, arg);
1596            if (tmp != null)
1597                result.addAll(tmp);
1598        }
1599        return result;
1600    }
1601
1602    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1603    public List<R> visit(final ThrowStmt n, final A arg) {
1604        List<R> result = new ArrayList<>();
1605        List<R> tmp;
1606        {
1607            tmp = n.getExpression().accept(this, arg);
1608            if (tmp != null)
1609                result.addAll(tmp);
1610        }
1611        if (n.getComment().isPresent()) {
1612            tmp = n.getComment().get().accept(this, arg);
1613            if (tmp != null)
1614                result.addAll(tmp);
1615        }
1616        return result;
1617    }
1618
1619    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1620    public List<R> visit(final TryStmt n, final A arg) {
1621        List<R> result = new ArrayList<>();
1622        List<R> tmp;
1623        {
1624            tmp = n.getCatchClauses().accept(this, arg);
1625            if (tmp != null)
1626                result.addAll(tmp);
1627        }
1628        if (n.getFinallyBlock().isPresent()) {
1629            tmp = n.getFinallyBlock().get().accept(this, arg);
1630            if (tmp != null)
1631                result.addAll(tmp);
1632        }
1633        {
1634            tmp = n.getResources().accept(this, arg);
1635            if (tmp != null)
1636                result.addAll(tmp);
1637        }
1638        {
1639            tmp = n.getTryBlock().accept(this, arg);
1640            if (tmp != null)
1641                result.addAll(tmp);
1642        }
1643        if (n.getComment().isPresent()) {
1644            tmp = n.getComment().get().accept(this, arg);
1645            if (tmp != null)
1646                result.addAll(tmp);
1647        }
1648        return result;
1649    }
1650
1651    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1652    public List<R> visit(final TypeExpr n, final A arg) {
1653        List<R> result = new ArrayList<>();
1654        List<R> tmp;
1655        {
1656            tmp = n.getType().accept(this, arg);
1657            if (tmp != null)
1658                result.addAll(tmp);
1659        }
1660        if (n.getComment().isPresent()) {
1661            tmp = n.getComment().get().accept(this, arg);
1662            if (tmp != null)
1663                result.addAll(tmp);
1664        }
1665        return result;
1666    }
1667
1668    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1669    public List<R> visit(final TypeParameter n, final A arg) {
1670        List<R> result = new ArrayList<>();
1671        List<R> tmp;
1672        {
1673            tmp = n.getName().accept(this, arg);
1674            if (tmp != null)
1675                result.addAll(tmp);
1676        }
1677        {
1678            tmp = n.getTypeBound().accept(this, arg);
1679            if (tmp != null)
1680                result.addAll(tmp);
1681        }
1682        {
1683            tmp = n.getAnnotations().accept(this, arg);
1684            if (tmp != null)
1685                result.addAll(tmp);
1686        }
1687        if (n.getComment().isPresent()) {
1688            tmp = n.getComment().get().accept(this, arg);
1689            if (tmp != null)
1690                result.addAll(tmp);
1691        }
1692        return result;
1693    }
1694
1695    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1696    public List<R> visit(final UnaryExpr n, final A arg) {
1697        List<R> result = new ArrayList<>();
1698        List<R> tmp;
1699        {
1700            tmp = n.getExpression().accept(this, arg);
1701            if (tmp != null)
1702                result.addAll(tmp);
1703        }
1704        if (n.getComment().isPresent()) {
1705            tmp = n.getComment().get().accept(this, arg);
1706            if (tmp != null)
1707                result.addAll(tmp);
1708        }
1709        return result;
1710    }
1711
1712    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1713    public List<R> visit(final UnionType n, final A arg) {
1714        List<R> result = new ArrayList<>();
1715        List<R> tmp;
1716        {
1717            tmp = n.getElements().accept(this, arg);
1718            if (tmp != null)
1719                result.addAll(tmp);
1720        }
1721        {
1722            tmp = n.getAnnotations().accept(this, arg);
1723            if (tmp != null)
1724                result.addAll(tmp);
1725        }
1726        if (n.getComment().isPresent()) {
1727            tmp = n.getComment().get().accept(this, arg);
1728            if (tmp != null)
1729                result.addAll(tmp);
1730        }
1731        return result;
1732    }
1733
1734    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1735    public List<R> visit(final UnknownType n, final A arg) {
1736        List<R> result = new ArrayList<>();
1737        List<R> tmp;
1738        {
1739            tmp = n.getAnnotations().accept(this, arg);
1740            if (tmp != null)
1741                result.addAll(tmp);
1742        }
1743        if (n.getComment().isPresent()) {
1744            tmp = n.getComment().get().accept(this, arg);
1745            if (tmp != null)
1746                result.addAll(tmp);
1747        }
1748        return result;
1749    }
1750
1751    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1752    public List<R> visit(final VariableDeclarationExpr n, final A arg) {
1753        List<R> result = new ArrayList<>();
1754        List<R> tmp;
1755        {
1756            tmp = n.getAnnotations().accept(this, arg);
1757            if (tmp != null)
1758                result.addAll(tmp);
1759        }
1760        {
1761            tmp = n.getVariables().accept(this, arg);
1762            if (tmp != null)
1763                result.addAll(tmp);
1764        }
1765        if (n.getComment().isPresent()) {
1766            tmp = n.getComment().get().accept(this, arg);
1767            if (tmp != null)
1768                result.addAll(tmp);
1769        }
1770        return result;
1771    }
1772
1773    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1774    public List<R> visit(final VariableDeclarator n, final A arg) {
1775        List<R> result = new ArrayList<>();
1776        List<R> tmp;
1777        if (n.getInitializer().isPresent()) {
1778            tmp = n.getInitializer().get().accept(this, arg);
1779            if (tmp != null)
1780                result.addAll(tmp);
1781        }
1782        {
1783            tmp = n.getName().accept(this, arg);
1784            if (tmp != null)
1785                result.addAll(tmp);
1786        }
1787        {
1788            tmp = n.getType().accept(this, arg);
1789            if (tmp != null)
1790                result.addAll(tmp);
1791        }
1792        if (n.getComment().isPresent()) {
1793            tmp = n.getComment().get().accept(this, arg);
1794            if (tmp != null)
1795                result.addAll(tmp);
1796        }
1797        return result;
1798    }
1799
1800    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1801    public List<R> visit(final VoidType n, final A arg) {
1802        List<R> result = new ArrayList<>();
1803        List<R> tmp;
1804        {
1805            tmp = n.getAnnotations().accept(this, arg);
1806            if (tmp != null)
1807                result.addAll(tmp);
1808        }
1809        if (n.getComment().isPresent()) {
1810            tmp = n.getComment().get().accept(this, arg);
1811            if (tmp != null)
1812                result.addAll(tmp);
1813        }
1814        return result;
1815    }
1816
1817    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1818    public List<R> visit(final WhileStmt n, final A arg) {
1819        List<R> result = new ArrayList<>();
1820        List<R> tmp;
1821        {
1822            tmp = n.getBody().accept(this, arg);
1823            if (tmp != null)
1824                result.addAll(tmp);
1825        }
1826        {
1827            tmp = n.getCondition().accept(this, arg);
1828            if (tmp != null)
1829                result.addAll(tmp);
1830        }
1831        if (n.getComment().isPresent()) {
1832            tmp = n.getComment().get().accept(this, arg);
1833            if (tmp != null)
1834                result.addAll(tmp);
1835        }
1836        return result;
1837    }
1838
1839    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1840    public List<R> visit(final WildcardType n, final A arg) {
1841        List<R> result = new ArrayList<>();
1842        List<R> tmp;
1843        if (n.getExtendedType().isPresent()) {
1844            tmp = n.getExtendedType().get().accept(this, arg);
1845            if (tmp != null)
1846                result.addAll(tmp);
1847        }
1848        if (n.getSuperType().isPresent()) {
1849            tmp = n.getSuperType().get().accept(this, arg);
1850            if (tmp != null)
1851                result.addAll(tmp);
1852        }
1853        {
1854            tmp = n.getAnnotations().accept(this, arg);
1855            if (tmp != null)
1856                result.addAll(tmp);
1857        }
1858        if (n.getComment().isPresent()) {
1859            tmp = n.getComment().get().accept(this, arg);
1860            if (tmp != null)
1861                result.addAll(tmp);
1862        }
1863        return result;
1864    }
1865
1866    @Override
1867    public List<R> visit(NodeList n, A arg) {
1868        return ((NodeList<? extends Node>) n).stream().filter(Objects::nonNull).flatMap(v -> v.accept(this, arg).stream()).collect(Collectors.toList());
1869    }
1870
1871    @Override
1872    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1873    public List<R> visit(final ModuleDeclaration n, final A arg) {
1874        List<R> result = new ArrayList<>();
1875        List<R> tmp;
1876        {
1877            tmp = n.getAnnotations().accept(this, arg);
1878            if (tmp != null)
1879                result.addAll(tmp);
1880        }
1881        {
1882            tmp = n.getModuleStmts().accept(this, arg);
1883            if (tmp != null)
1884                result.addAll(tmp);
1885        }
1886        {
1887            tmp = n.getName().accept(this, arg);
1888            if (tmp != null)
1889                result.addAll(tmp);
1890        }
1891        if (n.getComment().isPresent()) {
1892            tmp = n.getComment().get().accept(this, arg);
1893            if (tmp != null)
1894                result.addAll(tmp);
1895        }
1896        return result;
1897    }
1898
1899    @Override
1900    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1901    public List<R> visit(final ModuleExportsStmt n, final A arg) {
1902        List<R> result = new ArrayList<>();
1903        List<R> tmp;
1904        {
1905            tmp = n.getModuleNames().accept(this, arg);
1906            if (tmp != null)
1907                result.addAll(tmp);
1908        }
1909        {
1910            tmp = n.getName().accept(this, arg);
1911            if (tmp != null)
1912                result.addAll(tmp);
1913        }
1914        if (n.getComment().isPresent()) {
1915            tmp = n.getComment().get().accept(this, arg);
1916            if (tmp != null)
1917                result.addAll(tmp);
1918        }
1919        return result;
1920    }
1921
1922    @Override
1923    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1924    public List<R> visit(final ModuleOpensStmt n, final A arg) {
1925        List<R> result = new ArrayList<>();
1926        List<R> tmp;
1927        {
1928            tmp = n.getModuleNames().accept(this, arg);
1929            if (tmp != null)
1930                result.addAll(tmp);
1931        }
1932        {
1933            tmp = n.getName().accept(this, arg);
1934            if (tmp != null)
1935                result.addAll(tmp);
1936        }
1937        if (n.getComment().isPresent()) {
1938            tmp = n.getComment().get().accept(this, arg);
1939            if (tmp != null)
1940                result.addAll(tmp);
1941        }
1942        return result;
1943    }
1944
1945    @Override
1946    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1947    public List<R> visit(final ModuleProvidesStmt n, final A arg) {
1948        List<R> result = new ArrayList<>();
1949        List<R> tmp;
1950        {
1951            tmp = n.getType().accept(this, arg);
1952            if (tmp != null)
1953                result.addAll(tmp);
1954        }
1955        {
1956            tmp = n.getWithTypes().accept(this, arg);
1957            if (tmp != null)
1958                result.addAll(tmp);
1959        }
1960        if (n.getComment().isPresent()) {
1961            tmp = n.getComment().get().accept(this, arg);
1962            if (tmp != null)
1963                result.addAll(tmp);
1964        }
1965        return result;
1966    }
1967
1968    @Override
1969    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1970    public List<R> visit(final ModuleRequiresStmt n, final A arg) {
1971        List<R> result = new ArrayList<>();
1972        List<R> tmp;
1973        {
1974            tmp = n.getName().accept(this, arg);
1975            if (tmp != null)
1976                result.addAll(tmp);
1977        }
1978        if (n.getComment().isPresent()) {
1979            tmp = n.getComment().get().accept(this, arg);
1980            if (tmp != null)
1981                result.addAll(tmp);
1982        }
1983        return result;
1984    }
1985
1986    @Override
1987    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
1988    public List<R> visit(final ModuleUsesStmt n, final A arg) {
1989        List<R> result = new ArrayList<>();
1990        List<R> tmp;
1991        {
1992            tmp = n.getType().accept(this, arg);
1993            if (tmp != null)
1994                result.addAll(tmp);
1995        }
1996        if (n.getComment().isPresent()) {
1997            tmp = n.getComment().get().accept(this, arg);
1998            if (tmp != null)
1999                result.addAll(tmp);
2000        }
2001        return result;
2002    }
2003
2004    @Override
2005    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
2006    public List<R> visit(final UnparsableStmt n, final A arg) {
2007        List<R> result = new ArrayList<>();
2008        List<R> tmp;
2009        if (n.getComment().isPresent()) {
2010            tmp = n.getComment().get().accept(this, arg);
2011            if (tmp != null)
2012                result.addAll(tmp);
2013        }
2014        return result;
2015    }
2016
2017    @Override
2018    @Generated("com.github.javaparser.generator.core.visitor.GenericListVisitorAdapterGenerator")
2019    public List<R> visit(final ReceiverParameter n, final A arg) {
2020        List<R> result = new ArrayList<>();
2021        List<R> tmp;
2022        {
2023            tmp = n.getAnnotations().accept(this, arg);
2024            if (tmp != null)
2025                result.addAll(tmp);
2026        }
2027        {
2028            tmp = n.getName().accept(this, arg);
2029            if (tmp != null)
2030                result.addAll(tmp);
2031        }
2032        {
2033            tmp = n.getType().accept(this, arg);
2034            if (tmp != null)
2035                result.addAll(tmp);
2036        }
2037        if (n.getComment().isPresent()) {
2038            tmp = n.getComment().get().accept(this, arg);
2039            if (tmp != null)
2040                result.addAll(tmp);
2041        }
2042        return result;
2043    }
2044
2045    @Override
2046    public List<R> visit(final VarType n, final A arg) {
2047        List<R> result = new ArrayList<>();
2048        List<R> tmp;
2049        {
2050            tmp = n.getAnnotations().accept(this, arg);
2051            if (tmp != null)
2052                result.addAll(tmp);
2053        }
2054        if (n.getComment().isPresent()) {
2055            tmp = n.getComment().get().accept(this, arg);
2056            if (tmp != null)
2057                result.addAll(tmp);
2058        }
2059        return result;
2060    }
2061}
2062