From 2b7d2b05ddeea9970ce817f80645d91cb0106a69 Mon Sep 17 00:00:00 2001 From: Knut Wannheden Date: Wed, 11 Sep 2024 11:58:27 +0200 Subject: [PATCH] Declare namespaces for `Space`, `JContainer`, etc. These namespaces will contain the `Location` enums. To be verified if we want to keep it this way. --- openrewrite/src/java/support_types.ts | 493 ++++++++++++++------------ openrewrite/src/java/visitor.ts | 280 +++++++-------- 2 files changed, 398 insertions(+), 375 deletions(-) diff --git a/openrewrite/src/java/support_types.ts b/openrewrite/src/java/support_types.ts index 44b3ed68..65307244 100644 --- a/openrewrite/src/java/support_types.ts +++ b/openrewrite/src/java/support_types.ts @@ -39,215 +39,186 @@ export interface TypeTree extends NameTree { export interface JavaType { } +export namespace JavaType { + export abstract class FullyQualified implements JavaType { + } + export abstract class Class extends FullyQualified { + } + export abstract class Parameterized extends FullyQualified { + } + export class Primitive implements JavaType { + } + export class Variable implements JavaType { + } + export class Method implements JavaType { + } +} + export interface TypedTree extends Tree { get type(): JavaType | null; withType(type: JavaType | null): TypedTree; } -export enum SpaceLocation { - ANY, - ANNOTATED_TYPE_PREFIX, - ANNOTATION_ARGUMENTS, - ANNOTATION_ARGUMENT_SUFFIX, - ANNOTATIONS, - ANNOTATION_PREFIX, - ARRAY_ACCESS_PREFIX, - ARRAY_INDEX_SUFFIX, - ARRAY_TYPE_PREFIX, - ASSERT_PREFIX, - ASSERT_DETAIL, - ASSERT_DETAIL_PREFIX, - ASSIGNMENT, - ASSIGNMENT_OPERATION_PREFIX, - ASSIGNMENT_OPERATION_OPERATOR, - ASSIGNMENT_PREFIX, - BINARY_OPERATOR, - BINARY_PREFIX, - BLOCK_END, - BLOCK_PREFIX, - BLOCK_STATEMENT_SUFFIX, - BREAK_PREFIX, - CASE, - CASE_PREFIX, - CASE_BODY, - CASE_EXPRESSION, - CASE_SUFFIX, - CATCH_ALTERNATIVE_SUFFIX, - CATCH_PREFIX, - CLASS_DECLARATION_PREFIX, - CLASS_KIND, - COMPILATION_UNIT_EOF, - COMPILATION_UNIT_PREFIX, - CONTINUE_PREFIX, - CONTROL_PARENTHESES_PREFIX, - DIMENSION_PREFIX, - DIMENSION, - DIMENSION_SUFFIX, - DO_WHILE_PREFIX, - ELSE_PREFIX, - EMPTY_PREFIX, - ENUM_VALUE_PREFIX, - ENUM_VALUE_SET_PREFIX, - ENUM_VALUE_SUFFIX, - EXPRESSION_PREFIX, - EXTENDS, - FIELD_ACCESS_NAME, - FIELD_ACCESS_PREFIX, - FOREACH_ITERABLE_SUFFIX, - FOREACH_VARIABLE_SUFFIX, - FOR_BODY_SUFFIX, - FOR_CONDITION_SUFFIX, - FOR_CONTROL_PREFIX, - FOR_EACH_CONTROL_PREFIX, - FOR_EACH_LOOP_PREFIX, - FOR_INIT_SUFFIX, - FOR_PREFIX, - FOR_UPDATE_SUFFIX, - IDENTIFIER_PREFIX, - IF_ELSE_SUFFIX, - IF_PREFIX, - IF_THEN_SUFFIX, - IMPLEMENTS, - IMPORT_ALIAS_PREFIX, - PERMITS, - IMPLEMENTS_SUFFIX, - IMPORT_PREFIX, - IMPORT_SUFFIX, - INSTANCEOF_PREFIX, - INSTANCEOF_SUFFIX, - INTERSECTION_TYPE_PREFIX, - LABEL_PREFIX, - LABEL_SUFFIX, - LAMBDA_ARROW_PREFIX, - LAMBDA_PARAMETER, - LAMBDA_PARAMETERS_PREFIX, - LAMBDA_PREFIX, - LANGUAGE_EXTENSION, - LITERAL_PREFIX, - MEMBER_REFERENCE_CONTAINING, - MEMBER_REFERENCE_NAME, - MEMBER_REFERENCE_PREFIX, - METHOD_DECLARATION_PARAMETERS, - METHOD_DECLARATION_PARAMETER_SUFFIX, - METHOD_DECLARATION_DEFAULT_VALUE, - METHOD_DECLARATION_PREFIX, - METHOD_INVOCATION_ARGUMENTS, - METHOD_INVOCATION_ARGUMENT_SUFFIX, - METHOD_INVOCATION_NAME, - METHOD_INVOCATION_PREFIX, - METHOD_SELECT_SUFFIX, - MODIFIER_PREFIX, - MULTI_CATCH_PREFIX, - NAMED_VARIABLE_SUFFIX, - NEW_ARRAY_INITIALIZER, - NEW_ARRAY_INITIALIZER_SUFFIX, - NEW_ARRAY_PREFIX, - NEW_CLASS_ARGUMENTS, - NEW_CLASS_ARGUMENTS_SUFFIX, - NEW_CLASS_ENCLOSING_SUFFIX, - NEW_CLASS_PREFIX, - NEW_PREFIX, - NULLABLE_TYPE_PREFIX, - NULLABLE_TYPE_SUFFIX, - PACKAGE_PREFIX, - PACKAGE_SUFFIX, - PARAMETERIZED_TYPE_PREFIX, - PARENTHESES_PREFIX, - PARENTHESES_SUFFIX, - PERMITS_SUFFIX, - PRIMITIVE_PREFIX, - RECORD_STATE_VECTOR, - RECORD_STATE_VECTOR_SUFFIX, - RETURN_PREFIX, - STATEMENT_PREFIX, - STATIC_IMPORT, - STATIC_INIT_SUFFIX, - SWITCH_PREFIX, - SWITCH_EXPRESSION_PREFIX, - SYNCHRONIZED_PREFIX, - TERNARY_FALSE, - TERNARY_PREFIX, - TERNARY_TRUE, - THROWS, - THROWS_SUFFIX, - THROW_PREFIX, - TRY_FINALLY, - TRY_PREFIX, - TRY_RESOURCE, - TRY_RESOURCES, - TRY_RESOURCE_SUFFIX, - TYPE_BOUNDS, - TYPE_BOUND_SUFFIX, - TYPE_CAST_PREFIX, - TYPE_PARAMETERS, - TYPE_PARAMETERS_PREFIX, - TYPE_PARAMETER_SUFFIX, - UNARY_OPERATOR, - UNARY_PREFIX, - UNKNOWN_PREFIX, - UNKNOWN_SOURCE_PREFIX, - VARARGS, - VARIABLE_DECLARATIONS_PREFIX, - VARIABLE_INITIALIZER, - VARIABLE_PREFIX, - WHILE_BODY_SUFFIX, - WHILE_CONDITION, - WHILE_PREFIX, - WILDCARD_BOUND, - WILDCARD_PREFIX, - YIELD_PREFIX, -} - export class Space { } -export class Comment { +export namespace Space { + export enum Location { + ANY, + ANNOTATED_TYPE_PREFIX, + ANNOTATION_ARGUMENTS, + ANNOTATION_ARGUMENT_SUFFIX, + ANNOTATIONS, + ANNOTATION_PREFIX, + ARRAY_ACCESS_PREFIX, + ARRAY_INDEX_SUFFIX, + ARRAY_TYPE_PREFIX, + ASSERT_PREFIX, + ASSERT_DETAIL, + ASSERT_DETAIL_PREFIX, + ASSIGNMENT, + ASSIGNMENT_OPERATION_PREFIX, + ASSIGNMENT_OPERATION_OPERATOR, + ASSIGNMENT_PREFIX, + BINARY_OPERATOR, + BINARY_PREFIX, + BLOCK_END, + BLOCK_PREFIX, + BLOCK_STATEMENT_SUFFIX, + BREAK_PREFIX, + CASE, + CASE_PREFIX, + CASE_BODY, + CASE_EXPRESSION, + CASE_SUFFIX, + CATCH_ALTERNATIVE_SUFFIX, + CATCH_PREFIX, + CLASS_DECLARATION_PREFIX, + CLASS_KIND, + COMPILATION_UNIT_EOF, + COMPILATION_UNIT_PREFIX, + CONTINUE_PREFIX, + CONTROL_PARENTHESES_PREFIX, + DIMENSION_PREFIX, + DIMENSION, + DIMENSION_SUFFIX, + DO_WHILE_PREFIX, + ELSE_PREFIX, + EMPTY_PREFIX, + ENUM_VALUE_PREFIX, + ENUM_VALUE_SET_PREFIX, + ENUM_VALUE_SUFFIX, + EXPRESSION_PREFIX, + EXTENDS, + FIELD_ACCESS_NAME, + FIELD_ACCESS_PREFIX, + FOREACH_ITERABLE_SUFFIX, + FOREACH_VARIABLE_SUFFIX, + FOR_BODY_SUFFIX, + FOR_CONDITION_SUFFIX, + FOR_CONTROL_PREFIX, + FOR_EACH_CONTROL_PREFIX, + FOR_EACH_LOOP_PREFIX, + FOR_INIT_SUFFIX, + FOR_PREFIX, + FOR_UPDATE_SUFFIX, + IDENTIFIER_PREFIX, + IF_ELSE_SUFFIX, + IF_PREFIX, + IF_THEN_SUFFIX, + IMPLEMENTS, + IMPORT_ALIAS_PREFIX, + PERMITS, + IMPLEMENTS_SUFFIX, + IMPORT_PREFIX, + IMPORT_SUFFIX, + INSTANCEOF_PREFIX, + INSTANCEOF_SUFFIX, + INTERSECTION_TYPE_PREFIX, + LABEL_PREFIX, + LABEL_SUFFIX, + LAMBDA_ARROW_PREFIX, + LAMBDA_PARAMETER, + LAMBDA_PARAMETERS_PREFIX, + LAMBDA_PREFIX, + LANGUAGE_EXTENSION, + LITERAL_PREFIX, + MEMBER_REFERENCE_CONTAINING, + MEMBER_REFERENCE_NAME, + MEMBER_REFERENCE_PREFIX, + METHOD_DECLARATION_PARAMETERS, + METHOD_DECLARATION_PARAMETER_SUFFIX, + METHOD_DECLARATION_DEFAULT_VALUE, + METHOD_DECLARATION_PREFIX, + METHOD_INVOCATION_ARGUMENTS, + METHOD_INVOCATION_ARGUMENT_SUFFIX, + METHOD_INVOCATION_NAME, + METHOD_INVOCATION_PREFIX, + METHOD_SELECT_SUFFIX, + MODIFIER_PREFIX, + MULTI_CATCH_PREFIX, + NAMED_VARIABLE_SUFFIX, + NEW_ARRAY_INITIALIZER, + NEW_ARRAY_INITIALIZER_SUFFIX, + NEW_ARRAY_PREFIX, + NEW_CLASS_ARGUMENTS, + NEW_CLASS_ARGUMENTS_SUFFIX, + NEW_CLASS_ENCLOSING_SUFFIX, + NEW_CLASS_PREFIX, + NEW_PREFIX, + NULLABLE_TYPE_PREFIX, + NULLABLE_TYPE_SUFFIX, + PACKAGE_PREFIX, + PACKAGE_SUFFIX, + PARAMETERIZED_TYPE_PREFIX, + PARENTHESES_PREFIX, + PARENTHESES_SUFFIX, + PERMITS_SUFFIX, + PRIMITIVE_PREFIX, + RECORD_STATE_VECTOR, + RECORD_STATE_VECTOR_SUFFIX, + RETURN_PREFIX, + STATEMENT_PREFIX, + STATIC_IMPORT, + STATIC_INIT_SUFFIX, + SWITCH_PREFIX, + SWITCH_EXPRESSION_PREFIX, + SYNCHRONIZED_PREFIX, + TERNARY_FALSE, + TERNARY_PREFIX, + TERNARY_TRUE, + THROWS, + THROWS_SUFFIX, + THROW_PREFIX, + TRY_FINALLY, + TRY_PREFIX, + TRY_RESOURCE, + TRY_RESOURCES, + TRY_RESOURCE_SUFFIX, + TYPE_BOUNDS, + TYPE_BOUND_SUFFIX, + TYPE_CAST_PREFIX, + TYPE_PARAMETERS, + TYPE_PARAMETERS_PREFIX, + TYPE_PARAMETER_SUFFIX, + UNARY_OPERATOR, + UNARY_PREFIX, + UNKNOWN_PREFIX, + UNKNOWN_SOURCE_PREFIX, + VARARGS, + VARIABLE_DECLARATIONS_PREFIX, + VARIABLE_INITIALIZER, + VARIABLE_PREFIX, + WHILE_BODY_SUFFIX, + WHILE_CONDITION, + WHILE_PREFIX, + WILDCARD_BOUND, + WILDCARD_PREFIX, + YIELD_PREFIX, + } } -export enum JRightPaddedLocation { - ANNOTATION_ARGUMENT, - ARRAY_INDEX, - BLOCK_STATEMENT, - CASE, - CASE_BODY, - CASE_EXPRESSION, - CATCH_ALTERNATIVE, - CONTROL_PARENTHESES_TREE, - DIMENSION, - ENUM_VALUE, - FOREACH_ITERABLE, - FOREACH_VARIABLE, - FOR_BODY, - FOR_CONDITION, - FOR_INIT, - FOR_UPDATE, - IF_ELSE, - IF_THEN, - IMPLEMENTS, - IMPORT, - INSTANCEOF, - LABEL, - LAMBDA_PARAM, - LANGUAGE_EXTENSION, - MEMBER_REFERENCE_CONTAINING, - METHOD_DECLARATION_PARAMETER, - METHOD_INVOCATION_ARGUMENT, - METHOD_SELECT, - NAMED_VARIABLE, - NEW_ARRAY_INITIALIZER, - NEW_CLASS_ARGUMENTS, - NEW_CLASS_ENCLOSING, - NULLABLE, - PACKAGE, - PARENTHESES, - PERMITS, - RECORD_STATE_VECTOR, - STATIC_INIT, - THROWS, - TRY_RESOURCE, - TYPE_BOUND, - TYPE_PARAMETER, - WHILE_BODY, +export class Comment { } export class JRightPadded { @@ -274,48 +245,100 @@ export class JRightPadded { } } -export enum JLeftPaddedLocation { - ASSERT_DETAIL, - ASSIGNMENT, - ASSIGNMENT_OPERATION_OPERATOR, - BINARY_OPERATOR, - CLASS_KIND, - EXTENDS, - FIELD_ACCESS_NAME, - IMPORT_ALIAS_PREFIX, - LANGUAGE_EXTENSION, - MEMBER_REFERENCE_NAME, - METHOD_DECLARATION_DEFAULT_VALUE, - STATIC_IMPORT, - TERNARY_TRUE, - TERNARY_FALSE, - TRY_FINALLY, - UNARY_OPERATOR, - VARIABLE_INITIALIZER, - WHILE_CONDITION, - WILDCARD_BOUND, +export namespace JRightPadded { + export enum Location { + ANNOTATION_ARGUMENT, + ARRAY_INDEX, + BLOCK_STATEMENT, + CASE, + CASE_BODY, + CASE_EXPRESSION, + CATCH_ALTERNATIVE, + CONTROL_PARENTHESES_TREE, + DIMENSION, + ENUM_VALUE, + FOREACH_ITERABLE, + FOREACH_VARIABLE, + FOR_BODY, + FOR_CONDITION, + FOR_INIT, + FOR_UPDATE, + IF_ELSE, + IF_THEN, + IMPLEMENTS, + IMPORT, + INSTANCEOF, + LABEL, + LAMBDA_PARAM, + LANGUAGE_EXTENSION, + MEMBER_REFERENCE_CONTAINING, + METHOD_DECLARATION_PARAMETER, + METHOD_INVOCATION_ARGUMENT, + METHOD_SELECT, + NAMED_VARIABLE, + NEW_ARRAY_INITIALIZER, + NEW_CLASS_ARGUMENTS, + NEW_CLASS_ENCLOSING, + NULLABLE, + PACKAGE, + PARENTHESES, + PERMITS, + RECORD_STATE_VECTOR, + STATIC_INIT, + THROWS, + TRY_RESOURCE, + TYPE_BOUND, + TYPE_PARAMETER, + WHILE_BODY, + } } export class JLeftPadded { } -export enum JContainerLocation { - ANNOTATION_ARGUMENTS, - CASE, - CASE_EXPRESSION, - IMPLEMENTS, - PERMITS, - LANGUAGE_EXTENSION, - METHOD_DECLARATION_PARAMETERS, - METHOD_INVOCATION_ARGUMENTS, - NEW_ARRAY_INITIALIZER, - NEW_CLASS_ARGUMENTS, - RECORD_STATE_VECTOR, - THROWS, - TRY_RESOURCES, - TYPE_BOUNDS, - TYPE_PARAMETERS, +export namespace JLeftPadded { + export enum Location { + ASSERT_DETAIL, + ASSIGNMENT, + ASSIGNMENT_OPERATION_OPERATOR, + BINARY_OPERATOR, + CLASS_KIND, + EXTENDS, + FIELD_ACCESS_NAME, + IMPORT_ALIAS_PREFIX, + LANGUAGE_EXTENSION, + MEMBER_REFERENCE_NAME, + METHOD_DECLARATION_DEFAULT_VALUE, + STATIC_IMPORT, + TERNARY_TRUE, + TERNARY_FALSE, + TRY_FINALLY, + UNARY_OPERATOR, + VARIABLE_INITIALIZER, + WHILE_CONDITION, + WILDCARD_BOUND, + } } export class JContainer { } + +export namespace JContainer { + export enum Location { + ANNOTATION_ARGUMENTS, + CASE, + CASE_EXPRESSION, + IMPLEMENTS, + PERMITS, + LANGUAGE_EXTENSION, + METHOD_DECLARATION_PARAMETERS, + METHOD_INVOCATION_ARGUMENTS, + NEW_ARRAY_INITIALIZER, + NEW_CLASS_ARGUMENTS, + RECORD_STATE_VECTOR, + THROWS, + TRY_RESOURCES, + TYPE_BOUNDS, + TYPE_PARAMETERS, + } +} \ No newline at end of file diff --git a/openrewrite/src/java/visitor.ts b/openrewrite/src/java/visitor.ts index c124a7d6..71a0085f 100644 --- a/openrewrite/src/java/visitor.ts +++ b/openrewrite/src/java/visitor.ts @@ -17,7 +17,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitAnnotatedType(annotatedType: java.AnnotatedType, p: P): J | null { - annotatedType = annotatedType.withPrefix(this.visitSpace(annotatedType.prefix, SpaceLocation.ANNOTATED_TYPE_PREFIX, p)!); + annotatedType = annotatedType.withPrefix(this.visitSpace(annotatedType.prefix, Space.Location.ANNOTATED_TYPE_PREFIX, p)!); let tempExpression = this.visitExpression(annotatedType, p) as Expression; if (!(tempExpression instanceof java.AnnotatedType)) { @@ -31,7 +31,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitAnnotation(annotation: java.Annotation, p: P): J | null { - annotation = annotation.withPrefix(this.visitSpace(annotation.prefix, SpaceLocation.ANNOTATION_PREFIX, p)!); + annotation = annotation.withPrefix(this.visitSpace(annotation.prefix, Space.Location.ANNOTATION_PREFIX, p)!); let tempExpression = this.visitExpression(annotation, p) as Expression; if (!(tempExpression instanceof java.Annotation)) { @@ -40,12 +40,12 @@ export class JavaVisitor

extends TreeVisitor { annotation = tempExpression as java.Annotation; annotation = annotation.withMarkers(this.visitMarkers(annotation.markers, p)); annotation = annotation.withAnnotationType(this.visitAndCast(annotation.annotationType, p)!); - annotation = annotation.padding.withArguments(this.visitContainer(annotation.padding.arguments, JContainerLocation.ANNOTATION_ARGUMENTS, p)); + annotation = annotation.padding.withArguments(this.visitContainer(annotation.padding.arguments, JContainer.Location.ANNOTATION_ARGUMENTS, p)); return annotation; } public visitArrayAccess(arrayAccess: java.ArrayAccess, p: P): J | null { - arrayAccess = arrayAccess.withPrefix(this.visitSpace(arrayAccess.prefix, SpaceLocation.ARRAY_ACCESS_PREFIX, p)!); + arrayAccess = arrayAccess.withPrefix(this.visitSpace(arrayAccess.prefix, Space.Location.ARRAY_ACCESS_PREFIX, p)!); let tempExpression = this.visitExpression(arrayAccess, p) as Expression; if (!(tempExpression instanceof java.ArrayAccess)) { @@ -59,7 +59,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitArrayType(arrayType: java.ArrayType, p: P): J | null { - arrayType = arrayType.withPrefix(this.visitSpace(arrayType.prefix, SpaceLocation.ARRAY_TYPE_PREFIX, p)!); + arrayType = arrayType.withPrefix(this.visitSpace(arrayType.prefix, Space.Location.ARRAY_TYPE_PREFIX, p)!); let tempExpression = this.visitExpression(arrayType, p) as Expression; if (!(tempExpression instanceof java.ArrayType)) { @@ -69,12 +69,12 @@ export class JavaVisitor

extends TreeVisitor { arrayType = arrayType.withMarkers(this.visitMarkers(arrayType.markers, p)); arrayType = arrayType.withElementType(this.visitAndCast(arrayType.elementType, p)!); arrayType = arrayType.withAnnotations(ListUtils.map(arrayType.annotations, el => this.visit(el, p) as java.Annotation)); - arrayType = arrayType.withDimension(this.visitLeftPadded(arrayType.dimension, JLeftPaddedLocation.ARRAY_TYPE_DIMENSION, p)); + arrayType = arrayType.withDimension(this.visitLeftPadded(arrayType.dimension, JLeftPadded.Location.ARRAY_TYPE_DIMENSION, p)); return arrayType; } public visitAssert(assert: java.Assert, p: P): J | null { - assert = assert.withPrefix(this.visitSpace(assert.prefix, SpaceLocation.ASSERT_PREFIX, p)!); + assert = assert.withPrefix(this.visitSpace(assert.prefix, Space.Location.ASSERT_PREFIX, p)!); let tempStatement = this.visitStatement(assert, p) as Statement; if (!(tempStatement instanceof java.Assert)) { @@ -83,12 +83,12 @@ export class JavaVisitor

extends TreeVisitor { assert = tempStatement as java.Assert; assert = assert.withMarkers(this.visitMarkers(assert.markers, p)); assert = assert.withCondition(this.visitAndCast(assert.condition, p)!); - assert = assert.withDetail(this.visitLeftPadded(assert.detail, JLeftPaddedLocation.ASSERT_DETAIL, p)); + assert = assert.withDetail(this.visitLeftPadded(assert.detail, JLeftPadded.Location.ASSERT_DETAIL, p)); return assert; } public visitAssignment(assignment: java.Assignment, p: P): J | null { - assignment = assignment.withPrefix(this.visitSpace(assignment.prefix, SpaceLocation.ASSIGNMENT_PREFIX, p)!); + assignment = assignment.withPrefix(this.visitSpace(assignment.prefix, Space.Location.ASSIGNMENT_PREFIX, p)!); let tempStatement = this.visitStatement(assignment, p) as Statement; if (!(tempStatement instanceof java.Assignment)) { @@ -103,12 +103,12 @@ export class JavaVisitor

extends TreeVisitor { assignment = tempExpression as java.Assignment; assignment = assignment.withMarkers(this.visitMarkers(assignment.markers, p)); assignment = assignment.withVariable(this.visitAndCast(assignment.variable, p)!); - assignment = assignment.padding.withAssignment(this.visitLeftPadded(assignment.padding.assignment, JLeftPaddedLocation.ASSIGNMENT, p)!); + assignment = assignment.padding.withAssignment(this.visitLeftPadded(assignment.padding.assignment, JLeftPadded.Location.ASSIGNMENT, p)!); return assignment; } public visitAssignmentOperation(assignmentOperation: java.AssignmentOperation, p: P): J | null { - assignmentOperation = assignmentOperation.withPrefix(this.visitSpace(assignmentOperation.prefix, SpaceLocation.ASSIGNMENT_OPERATION_PREFIX, p)!); + assignmentOperation = assignmentOperation.withPrefix(this.visitSpace(assignmentOperation.prefix, Space.Location.ASSIGNMENT_OPERATION_PREFIX, p)!); let tempStatement = this.visitStatement(assignmentOperation, p) as Statement; if (!(tempStatement instanceof java.AssignmentOperation)) { @@ -123,13 +123,13 @@ export class JavaVisitor

extends TreeVisitor { assignmentOperation = tempExpression as java.AssignmentOperation; assignmentOperation = assignmentOperation.withMarkers(this.visitMarkers(assignmentOperation.markers, p)); assignmentOperation = assignmentOperation.withVariable(this.visitAndCast(assignmentOperation.variable, p)!); - assignmentOperation = assignmentOperation.padding.withOperator(this.visitLeftPadded(assignmentOperation.padding.operator, JLeftPaddedLocation.ASSIGNMENT_OPERATION_OPERATOR, p)!); + assignmentOperation = assignmentOperation.padding.withOperator(this.visitLeftPadded(assignmentOperation.padding.operator, JLeftPadded.Location.ASSIGNMENT_OPERATION_OPERATOR, p)!); assignmentOperation = assignmentOperation.withAssignment(this.visitAndCast(assignmentOperation.assignment, p)!); return assignmentOperation; } public visitBinary(binary: java.Binary, p: P): J | null { - binary = binary.withPrefix(this.visitSpace(binary.prefix, SpaceLocation.BINARY_PREFIX, p)!); + binary = binary.withPrefix(this.visitSpace(binary.prefix, Space.Location.BINARY_PREFIX, p)!); let tempExpression = this.visitExpression(binary, p) as Expression; if (!(tempExpression instanceof java.Binary)) { @@ -138,13 +138,13 @@ export class JavaVisitor

extends TreeVisitor { binary = tempExpression as java.Binary; binary = binary.withMarkers(this.visitMarkers(binary.markers, p)); binary = binary.withLeft(this.visitAndCast(binary.left, p)!); - binary = binary.padding.withOperator(this.visitLeftPadded(binary.padding.operator, JLeftPaddedLocation.BINARY_OPERATOR, p)!); + binary = binary.padding.withOperator(this.visitLeftPadded(binary.padding.operator, JLeftPadded.Location.BINARY_OPERATOR, p)!); binary = binary.withRight(this.visitAndCast(binary.right, p)!); return binary; } public visitBlock(block: java.Block, p: P): J | null { - block = block.withPrefix(this.visitSpace(block.prefix, SpaceLocation.BLOCK_PREFIX, p)!); + block = block.withPrefix(this.visitSpace(block.prefix, Space.Location.BLOCK_PREFIX, p)!); let tempStatement = this.visitStatement(block, p) as Statement; if (!(tempStatement instanceof java.Block)) { @@ -152,14 +152,14 @@ export class JavaVisitor

extends TreeVisitor { } block = tempStatement as java.Block; block = block.withMarkers(this.visitMarkers(block.markers, p)); - block = block.padding.withStatic(this.visitRightPadded(block.padding.static, JRightPaddedLocation.STATIC_INIT, p)!); - block = block.padding.withStatements(ListUtils.map(block.padding.statements, el => this.visitRightPadded(el, JRightPaddedLocation.BLOCK_STATEMENT, p))); - block = block.withEnd(this.visitSpace(block.end, SpaceLocation.BLOCK_END, p)!); + block = block.padding.withStatic(this.visitRightPadded(block.padding.static, JRightPadded.Location.STATIC_INIT, p)!); + block = block.padding.withStatements(ListUtils.map(block.padding.statements, el => this.visitRightPadded(el, JRightPadded.Location.BLOCK_STATEMENT, p))); + block = block.withEnd(this.visitSpace(block.end, Space.Location.BLOCK_END, p)!); return block; } public visitBreak(_break: java.Break, p: P): J | null { - _break = _break.withPrefix(this.visitSpace(_break.prefix, SpaceLocation.BREAK_PREFIX, p)!); + _break = _break.withPrefix(this.visitSpace(_break.prefix, Space.Location.BREAK_PREFIX, p)!); let tempStatement = this.visitStatement(_break, p) as Statement; if (!(tempStatement instanceof java.Break)) { @@ -172,7 +172,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitCase(_case: java.Case, p: P): J | null { - _case = _case.withPrefix(this.visitSpace(_case.prefix, SpaceLocation.CASE_PREFIX, p)!); + _case = _case.withPrefix(this.visitSpace(_case.prefix, Space.Location.CASE_PREFIX, p)!); let tempStatement = this.visitStatement(_case, p) as Statement; if (!(tempStatement instanceof java.Case)) { @@ -180,14 +180,14 @@ export class JavaVisitor

extends TreeVisitor { } _case = tempStatement as java.Case; _case = _case.withMarkers(this.visitMarkers(_case.markers, p)); - _case = _case.padding.withExpressions(this.visitContainer(_case.padding.expressions, JContainerLocation.CASE_EXPRESSION, p)!); - _case = _case.padding.withStatements(this.visitContainer(_case.padding.statements, JContainerLocation.CASE, p)!); - _case = _case.padding.withBody(this.visitRightPadded(_case.padding.body, JRightPaddedLocation.CASE_BODY, p)); + _case = _case.padding.withExpressions(this.visitContainer(_case.padding.expressions, JContainer.Location.CASE_EXPRESSION, p)!); + _case = _case.padding.withStatements(this.visitContainer(_case.padding.statements, JContainer.Location.CASE, p)!); + _case = _case.padding.withBody(this.visitRightPadded(_case.padding.body, JRightPadded.Location.CASE_BODY, p)); return _case; } public visitClassDeclaration(classDeclaration: java.ClassDeclaration, p: P): J | null { - classDeclaration = classDeclaration.withPrefix(this.visitSpace(classDeclaration.prefix, SpaceLocation.CLASS_DECLARATION_PREFIX, p)!); + classDeclaration = classDeclaration.withPrefix(this.visitSpace(classDeclaration.prefix, Space.Location.CLASS_DECLARATION_PREFIX, p)!); let tempStatement = this.visitStatement(classDeclaration, p) as Statement; if (!(tempStatement instanceof java.ClassDeclaration)) { @@ -199,34 +199,34 @@ export class JavaVisitor

extends TreeVisitor { classDeclaration = classDeclaration.withModifiers(ListUtils.map(classDeclaration.modifiers, el => this.visit(el, p) as java.Modifier)); classDeclaration = classDeclaration.padding.withKind(this.visitAndCast(classDeclaration.padding.kind, p)!); classDeclaration = classDeclaration.withName(this.visitAndCast(classDeclaration.name, p)!); - classDeclaration = classDeclaration.padding.withTypeParameters(this.visitContainer(classDeclaration.padding.typeParameters, JContainerLocation.TYPE_PARAMETERS, p)); - classDeclaration = classDeclaration.padding.withPrimaryConstructor(this.visitContainer(classDeclaration.padding.primaryConstructor, JContainerLocation.RECORD_STATE_VECTOR, p)); - classDeclaration = classDeclaration.padding.withExtends(this.visitLeftPadded(classDeclaration.padding.extends, JLeftPaddedLocation.EXTENDS, p)); - classDeclaration = classDeclaration.padding.withImplements(this.visitContainer(classDeclaration.padding.implements, JContainerLocation.IMPLEMENTS, p)); - classDeclaration = classDeclaration.padding.withPermits(this.visitContainer(classDeclaration.padding.permits, JContainerLocation.PERMITS, p)); + classDeclaration = classDeclaration.padding.withTypeParameters(this.visitContainer(classDeclaration.padding.typeParameters, JContainer.Location.TYPE_PARAMETERS, p)); + classDeclaration = classDeclaration.padding.withPrimaryConstructor(this.visitContainer(classDeclaration.padding.primaryConstructor, JContainer.Location.RECORD_STATE_VECTOR, p)); + classDeclaration = classDeclaration.padding.withExtends(this.visitLeftPadded(classDeclaration.padding.extends, JLeftPadded.Location.EXTENDS, p)); + classDeclaration = classDeclaration.padding.withImplements(this.visitContainer(classDeclaration.padding.implements, JContainer.Location.IMPLEMENTS, p)); + classDeclaration = classDeclaration.padding.withPermits(this.visitContainer(classDeclaration.padding.permits, JContainer.Location.PERMITS, p)); classDeclaration = classDeclaration.withBody(this.visitAndCast(classDeclaration.body, p)!); return classDeclaration; } public visitClassDeclarationKind(classDeclarationKind: java.ClassDeclarationKind, p: P): J | null { - classDeclarationKind = classDeclarationKind.withPrefix(this.visitSpace(classDeclarationKind.prefix, SpaceLocation.CLASS_KIND, p)!); + classDeclarationKind = classDeclarationKind.withPrefix(this.visitSpace(classDeclarationKind.prefix, Space.Location.CLASS_KIND, p)!); classDeclarationKind = classDeclarationKind.withMarkers(this.visitMarkers(classDeclarationKind.markers, p)); classDeclarationKind = classDeclarationKind.withAnnotations(ListUtils.map(classDeclarationKind.annotations, el => this.visit(el, p) as java.Annotation)); return classDeclarationKind; } public visitCompilationUnit(compilationUnit: java.CompilationUnit, p: P): J | null { - compilationUnit = compilationUnit.withPrefix(this.visitSpace(compilationUnit.prefix, SpaceLocation.COMPILATION_UNIT_PREFIX, p)!); + compilationUnit = compilationUnit.withPrefix(this.visitSpace(compilationUnit.prefix, Space.Location.COMPILATION_UNIT_PREFIX, p)!); compilationUnit = compilationUnit.withMarkers(this.visitMarkers(compilationUnit.markers, p)); - compilationUnit = compilationUnit.padding.withPackageDeclaration(this.visitRightPadded(compilationUnit.padding.packageDeclaration, JRightPaddedLocation.PACKAGE, p)); - compilationUnit = compilationUnit.padding.withImports(ListUtils.map(compilationUnit.padding.imports, el => this.visitRightPadded(el, JRightPaddedLocation.IMPORT, p))); + compilationUnit = compilationUnit.padding.withPackageDeclaration(this.visitRightPadded(compilationUnit.padding.packageDeclaration, JRightPadded.Location.PACKAGE, p)); + compilationUnit = compilationUnit.padding.withImports(ListUtils.map(compilationUnit.padding.imports, el => this.visitRightPadded(el, JRightPadded.Location.IMPORT, p))); compilationUnit = compilationUnit.withClasses(ListUtils.map(compilationUnit.classes, el => this.visit(el, p) as java.ClassDeclaration)); - compilationUnit = compilationUnit.withEof(this.visitSpace(compilationUnit.eof, SpaceLocation.COMPILATION_UNIT_EOF, p)!); + compilationUnit = compilationUnit.withEof(this.visitSpace(compilationUnit.eof, Space.Location.COMPILATION_UNIT_EOF, p)!); return compilationUnit; } public visitContinue(_continue: java.Continue, p: P): J | null { - _continue = _continue.withPrefix(this.visitSpace(_continue.prefix, SpaceLocation.CONTINUE_PREFIX, p)!); + _continue = _continue.withPrefix(this.visitSpace(_continue.prefix, Space.Location.CONTINUE_PREFIX, p)!); let tempStatement = this.visitStatement(_continue, p) as Statement; if (!(tempStatement instanceof java.Continue)) { @@ -239,7 +239,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitDoWhileLoop(doWhileLoop: java.DoWhileLoop, p: P): J | null { - doWhileLoop = doWhileLoop.withPrefix(this.visitSpace(doWhileLoop.prefix, SpaceLocation.DO_WHILE_PREFIX, p)!); + doWhileLoop = doWhileLoop.withPrefix(this.visitSpace(doWhileLoop.prefix, Space.Location.DO_WHILE_PREFIX, p)!); let tempStatement = this.visitStatement(doWhileLoop, p) as Statement; if (!(tempStatement instanceof java.DoWhileLoop)) { @@ -247,13 +247,13 @@ export class JavaVisitor

extends TreeVisitor { } doWhileLoop = tempStatement as java.DoWhileLoop; doWhileLoop = doWhileLoop.withMarkers(this.visitMarkers(doWhileLoop.markers, p)); - doWhileLoop = doWhileLoop.padding.withBody(this.visitRightPadded(doWhileLoop.padding.body, JRightPaddedLocation.WHILE_BODY, p)!); - doWhileLoop = doWhileLoop.padding.withWhileCondition(this.visitLeftPadded(doWhileLoop.padding.whileCondition, JLeftPaddedLocation.WHILE_CONDITION, p)!); + doWhileLoop = doWhileLoop.padding.withBody(this.visitRightPadded(doWhileLoop.padding.body, JRightPadded.Location.WHILE_BODY, p)!); + doWhileLoop = doWhileLoop.padding.withWhileCondition(this.visitLeftPadded(doWhileLoop.padding.whileCondition, JLeftPadded.Location.WHILE_CONDITION, p)!); return doWhileLoop; } public visitEmpty(empty: java.Empty, p: P): J | null { - empty = empty.withPrefix(this.visitSpace(empty.prefix, SpaceLocation.EMPTY_PREFIX, p)!); + empty = empty.withPrefix(this.visitSpace(empty.prefix, Space.Location.EMPTY_PREFIX, p)!); let tempStatement = this.visitStatement(empty, p) as Statement; if (!(tempStatement instanceof java.Empty)) { @@ -271,7 +271,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitEnumValue(enumValue: java.EnumValue, p: P): J | null { - enumValue = enumValue.withPrefix(this.visitSpace(enumValue.prefix, SpaceLocation.ENUM_VALUE_PREFIX, p)!); + enumValue = enumValue.withPrefix(this.visitSpace(enumValue.prefix, Space.Location.ENUM_VALUE_PREFIX, p)!); enumValue = enumValue.withMarkers(this.visitMarkers(enumValue.markers, p)); enumValue = enumValue.withAnnotations(ListUtils.map(enumValue.annotations, el => this.visit(el, p) as java.Annotation)); enumValue = enumValue.withName(this.visitAndCast(enumValue.name, p)!); @@ -280,7 +280,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitEnumValueSet(enumValueSet: java.EnumValueSet, p: P): J | null { - enumValueSet = enumValueSet.withPrefix(this.visitSpace(enumValueSet.prefix, SpaceLocation.ENUM_VALUE_SET_PREFIX, p)!); + enumValueSet = enumValueSet.withPrefix(this.visitSpace(enumValueSet.prefix, Space.Location.ENUM_VALUE_SET_PREFIX, p)!); let tempStatement = this.visitStatement(enumValueSet, p) as Statement; if (!(tempStatement instanceof java.EnumValueSet)) { @@ -288,12 +288,12 @@ export class JavaVisitor

extends TreeVisitor { } enumValueSet = tempStatement as java.EnumValueSet; enumValueSet = enumValueSet.withMarkers(this.visitMarkers(enumValueSet.markers, p)); - enumValueSet = enumValueSet.padding.withEnums(ListUtils.map(enumValueSet.padding.enums, el => this.visitRightPadded(el, JRightPaddedLocation.ENUM_VALUE, p))); + enumValueSet = enumValueSet.padding.withEnums(ListUtils.map(enumValueSet.padding.enums, el => this.visitRightPadded(el, JRightPadded.Location.ENUM_VALUE, p))); return enumValueSet; } public visitFieldAccess(fieldAccess: java.FieldAccess, p: P): J | null { - fieldAccess = fieldAccess.withPrefix(this.visitSpace(fieldAccess.prefix, SpaceLocation.FIELD_ACCESS_PREFIX, p)!); + fieldAccess = fieldAccess.withPrefix(this.visitSpace(fieldAccess.prefix, Space.Location.FIELD_ACCESS_PREFIX, p)!); let tempStatement = this.visitStatement(fieldAccess, p) as Statement; if (!(tempStatement instanceof java.FieldAccess)) { @@ -308,12 +308,12 @@ export class JavaVisitor

extends TreeVisitor { fieldAccess = tempExpression as java.FieldAccess; fieldAccess = fieldAccess.withMarkers(this.visitMarkers(fieldAccess.markers, p)); fieldAccess = fieldAccess.withTarget(this.visitAndCast(fieldAccess.target, p)!); - fieldAccess = fieldAccess.padding.withName(this.visitLeftPadded(fieldAccess.padding.name, JLeftPaddedLocation.FIELD_ACCESS_NAME, p)!); + fieldAccess = fieldAccess.padding.withName(this.visitLeftPadded(fieldAccess.padding.name, JLeftPadded.Location.FIELD_ACCESS_NAME, p)!); return fieldAccess; } public visitForEachLoop(forEachLoop: java.ForEachLoop, p: P): J | null { - forEachLoop = forEachLoop.withPrefix(this.visitSpace(forEachLoop.prefix, SpaceLocation.FOR_EACH_LOOP_PREFIX, p)!); + forEachLoop = forEachLoop.withPrefix(this.visitSpace(forEachLoop.prefix, Space.Location.FOR_EACH_LOOP_PREFIX, p)!); let tempStatement = this.visitStatement(forEachLoop, p) as Statement; if (!(tempStatement instanceof java.ForEachLoop)) { @@ -322,20 +322,20 @@ export class JavaVisitor

extends TreeVisitor { forEachLoop = tempStatement as java.ForEachLoop; forEachLoop = forEachLoop.withMarkers(this.visitMarkers(forEachLoop.markers, p)); forEachLoop = forEachLoop.withControl(this.visitAndCast(forEachLoop.control, p)!); - forEachLoop = forEachLoop.padding.withBody(this.visitRightPadded(forEachLoop.padding.body, JRightPaddedLocation.FOR_BODY, p)!); + forEachLoop = forEachLoop.padding.withBody(this.visitRightPadded(forEachLoop.padding.body, JRightPadded.Location.FOR_BODY, p)!); return forEachLoop; } public visitForEachControl(forEachLoopControl: java.ForEachLoopControl, p: P): J | null { - forEachLoopControl = forEachLoopControl.withPrefix(this.visitSpace(forEachLoopControl.prefix, SpaceLocation.FOR_EACH_CONTROL_PREFIX, p)!); + forEachLoopControl = forEachLoopControl.withPrefix(this.visitSpace(forEachLoopControl.prefix, Space.Location.FOR_EACH_CONTROL_PREFIX, p)!); forEachLoopControl = forEachLoopControl.withMarkers(this.visitMarkers(forEachLoopControl.markers, p)); - forEachLoopControl = forEachLoopControl.padding.withVariable(this.visitRightPadded(forEachLoopControl.padding.variable, JRightPaddedLocation.FOREACH_VARIABLE, p)!); - forEachLoopControl = forEachLoopControl.padding.withIterable(this.visitRightPadded(forEachLoopControl.padding.iterable, JRightPaddedLocation.FOREACH_ITERABLE, p)!); + forEachLoopControl = forEachLoopControl.padding.withVariable(this.visitRightPadded(forEachLoopControl.padding.variable, JRightPadded.Location.FOREACH_VARIABLE, p)!); + forEachLoopControl = forEachLoopControl.padding.withIterable(this.visitRightPadded(forEachLoopControl.padding.iterable, JRightPadded.Location.FOREACH_ITERABLE, p)!); return forEachLoopControl; } public visitForLoop(forLoop: java.ForLoop, p: P): J | null { - forLoop = forLoop.withPrefix(this.visitSpace(forLoop.prefix, SpaceLocation.FOR_PREFIX, p)!); + forLoop = forLoop.withPrefix(this.visitSpace(forLoop.prefix, Space.Location.FOR_PREFIX, p)!); let tempStatement = this.visitStatement(forLoop, p) as Statement; if (!(tempStatement instanceof java.ForLoop)) { @@ -344,21 +344,21 @@ export class JavaVisitor

extends TreeVisitor { forLoop = tempStatement as java.ForLoop; forLoop = forLoop.withMarkers(this.visitMarkers(forLoop.markers, p)); forLoop = forLoop.withControl(this.visitAndCast(forLoop.control, p)!); - forLoop = forLoop.padding.withBody(this.visitRightPadded(forLoop.padding.body, JRightPaddedLocation.FOR_BODY, p)!); + forLoop = forLoop.padding.withBody(this.visitRightPadded(forLoop.padding.body, JRightPadded.Location.FOR_BODY, p)!); return forLoop; } public visitForControl(forLoopControl: java.ForLoopControl, p: P): J | null { - forLoopControl = forLoopControl.withPrefix(this.visitSpace(forLoopControl.prefix, SpaceLocation.FOR_CONTROL_PREFIX, p)!); + forLoopControl = forLoopControl.withPrefix(this.visitSpace(forLoopControl.prefix, Space.Location.FOR_CONTROL_PREFIX, p)!); forLoopControl = forLoopControl.withMarkers(this.visitMarkers(forLoopControl.markers, p)); - forLoopControl = forLoopControl.padding.withInit(ListUtils.map(forLoopControl.padding.init, el => this.visitRightPadded(el, JRightPaddedLocation.FOR_INIT, p))); - forLoopControl = forLoopControl.padding.withCondition(this.visitRightPadded(forLoopControl.padding.condition, JRightPaddedLocation.FOR_CONDITION, p)!); - forLoopControl = forLoopControl.padding.withUpdate(ListUtils.map(forLoopControl.padding.update, el => this.visitRightPadded(el, JRightPaddedLocation.FOR_UPDATE, p))); + forLoopControl = forLoopControl.padding.withInit(ListUtils.map(forLoopControl.padding.init, el => this.visitRightPadded(el, JRightPadded.Location.FOR_INIT, p))); + forLoopControl = forLoopControl.padding.withCondition(this.visitRightPadded(forLoopControl.padding.condition, JRightPadded.Location.FOR_CONDITION, p)!); + forLoopControl = forLoopControl.padding.withUpdate(ListUtils.map(forLoopControl.padding.update, el => this.visitRightPadded(el, JRightPadded.Location.FOR_UPDATE, p))); return forLoopControl; } public visitParenthesizedTypeTree(parenthesizedTypeTree: java.ParenthesizedTypeTree, p: P): J | null { - parenthesizedTypeTree = parenthesizedTypeTree.withPrefix(this.visitSpace(parenthesizedTypeTree.prefix, SpaceLocation.PARENTHESES_PREFIX, p)!); + parenthesizedTypeTree = parenthesizedTypeTree.withPrefix(this.visitSpace(parenthesizedTypeTree.prefix, Space.Location.PARENTHESES_PREFIX, p)!); let tempExpression = this.visitExpression(parenthesizedTypeTree, p) as Expression; if (!(tempExpression instanceof java.ParenthesizedTypeTree)) { @@ -372,7 +372,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitIdentifier(identifier: java.Identifier, p: P): J | null { - identifier = identifier.withPrefix(this.visitSpace(identifier.prefix, SpaceLocation.IDENTIFIER_PREFIX, p)!); + identifier = identifier.withPrefix(this.visitSpace(identifier.prefix, Space.Location.IDENTIFIER_PREFIX, p)!); let tempExpression = this.visitExpression(identifier, p) as Expression; if (!(tempExpression instanceof java.Identifier)) { @@ -385,7 +385,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitIf(_if: java.If, p: P): J | null { - _if = _if.withPrefix(this.visitSpace(_if.prefix, SpaceLocation.IF_PREFIX, p)!); + _if = _if.withPrefix(this.visitSpace(_if.prefix, Space.Location.IF_PREFIX, p)!); let tempStatement = this.visitStatement(_if, p) as Statement; if (!(tempStatement instanceof java.If)) { @@ -394,20 +394,20 @@ export class JavaVisitor

extends TreeVisitor { _if = tempStatement as java.If; _if = _if.withMarkers(this.visitMarkers(_if.markers, p)); _if = _if.withIfCondition(this.visitAndCast(_if.ifCondition, p)!); - _if = _if.padding.withThenPart(this.visitRightPadded(_if.padding.thenPart, JRightPaddedLocation.IF_THEN, p)!); + _if = _if.padding.withThenPart(this.visitRightPadded(_if.padding.thenPart, JRightPadded.Location.IF_THEN, p)!); _if = _if.withElsePart(this.visitAndCast(_if.elsePart, p)); return _if; } public visitElse(ifElse: java.IfElse, p: P): J | null { - ifElse = ifElse.withPrefix(this.visitSpace(ifElse.prefix, SpaceLocation.ELSE_PREFIX, p)!); + ifElse = ifElse.withPrefix(this.visitSpace(ifElse.prefix, Space.Location.ELSE_PREFIX, p)!); ifElse = ifElse.withMarkers(this.visitMarkers(ifElse.markers, p)); - ifElse = ifElse.padding.withBody(this.visitRightPadded(ifElse.padding.body, JRightPaddedLocation.IF_ELSE, p)!); + ifElse = ifElse.padding.withBody(this.visitRightPadded(ifElse.padding.body, JRightPadded.Location.IF_ELSE, p)!); return ifElse; } public visitImport(_import: java.Import, p: P): J | null { - _import = _import.withPrefix(this.visitSpace(_import.prefix, SpaceLocation.IMPORT_PREFIX, p)!); + _import = _import.withPrefix(this.visitSpace(_import.prefix, Space.Location.IMPORT_PREFIX, p)!); let tempStatement = this.visitStatement(_import, p) as Statement; if (!(tempStatement instanceof java.Import)) { @@ -415,14 +415,14 @@ export class JavaVisitor

extends TreeVisitor { } _import = tempStatement as java.Import; _import = _import.withMarkers(this.visitMarkers(_import.markers, p)); - _import = _import.padding.withStatic(this.visitLeftPadded(_import.padding.static, JLeftPaddedLocation.STATIC_IMPORT, p)!); + _import = _import.padding.withStatic(this.visitLeftPadded(_import.padding.static, JLeftPadded.Location.STATIC_IMPORT, p)!); _import = _import.withQualid(this.visitAndCast(_import.qualid, p)!); - _import = _import.padding.withAlias(this.visitLeftPadded(_import.padding.alias, JLeftPaddedLocation.IMPORT_ALIAS_PREFIX, p)); + _import = _import.padding.withAlias(this.visitLeftPadded(_import.padding.alias, JLeftPadded.Location.IMPORT_ALIAS_PREFIX, p)); return _import; } public visitInstanceOf(instanceOf: java.InstanceOf, p: P): J | null { - instanceOf = instanceOf.withPrefix(this.visitSpace(instanceOf.prefix, SpaceLocation.INSTANCEOF_PREFIX, p)!); + instanceOf = instanceOf.withPrefix(this.visitSpace(instanceOf.prefix, Space.Location.INSTANCEOF_PREFIX, p)!); let tempExpression = this.visitExpression(instanceOf, p) as Expression; if (!(tempExpression instanceof java.InstanceOf)) { @@ -430,14 +430,14 @@ export class JavaVisitor

extends TreeVisitor { } instanceOf = tempExpression as java.InstanceOf; instanceOf = instanceOf.withMarkers(this.visitMarkers(instanceOf.markers, p)); - instanceOf = instanceOf.padding.withExpression(this.visitRightPadded(instanceOf.padding.expression, JRightPaddedLocation.INSTANCEOF, p)!); + instanceOf = instanceOf.padding.withExpression(this.visitRightPadded(instanceOf.padding.expression, JRightPadded.Location.INSTANCEOF, p)!); instanceOf = instanceOf.withClazz(this.visitAndCast(instanceOf.clazz, p)!); instanceOf = instanceOf.withPattern(this.visitAndCast(instanceOf.pattern, p)); return instanceOf; } public visitIntersectionType(intersectionType: java.IntersectionType, p: P): J | null { - intersectionType = intersectionType.withPrefix(this.visitSpace(intersectionType.prefix, SpaceLocation.INTERSECTION_TYPE_PREFIX, p)!); + intersectionType = intersectionType.withPrefix(this.visitSpace(intersectionType.prefix, Space.Location.INTERSECTION_TYPE_PREFIX, p)!); let tempExpression = this.visitExpression(intersectionType, p) as Expression; if (!(tempExpression instanceof java.IntersectionType)) { @@ -445,12 +445,12 @@ export class JavaVisitor

extends TreeVisitor { } intersectionType = tempExpression as java.IntersectionType; intersectionType = intersectionType.withMarkers(this.visitMarkers(intersectionType.markers, p)); - intersectionType = intersectionType.padding.withBounds(this.visitContainer(intersectionType.padding.bounds, JContainerLocation.TYPE_BOUNDS, p)!); + intersectionType = intersectionType.padding.withBounds(this.visitContainer(intersectionType.padding.bounds, JContainer.Location.TYPE_BOUNDS, p)!); return intersectionType; } public visitLabel(label: java.Label, p: P): J | null { - label = label.withPrefix(this.visitSpace(label.prefix, SpaceLocation.LABEL_PREFIX, p)!); + label = label.withPrefix(this.visitSpace(label.prefix, Space.Location.LABEL_PREFIX, p)!); let tempStatement = this.visitStatement(label, p) as Statement; if (!(tempStatement instanceof java.Label)) { @@ -458,13 +458,13 @@ export class JavaVisitor

extends TreeVisitor { } label = tempStatement as java.Label; label = label.withMarkers(this.visitMarkers(label.markers, p)); - label = label.padding.withLabel(this.visitRightPadded(label.padding.label, JRightPaddedLocation.LABEL, p)!); + label = label.padding.withLabel(this.visitRightPadded(label.padding.label, JRightPadded.Location.LABEL, p)!); label = label.withStatement(this.visitAndCast(label.statement, p)!); return label; } public visitLambda(lambda: java.Lambda, p: P): J | null { - lambda = lambda.withPrefix(this.visitSpace(lambda.prefix, SpaceLocation.LAMBDA_PREFIX, p)!); + lambda = lambda.withPrefix(this.visitSpace(lambda.prefix, Space.Location.LAMBDA_PREFIX, p)!); let tempStatement = this.visitStatement(lambda, p) as Statement; if (!(tempStatement instanceof java.Lambda)) { @@ -479,20 +479,20 @@ export class JavaVisitor

extends TreeVisitor { lambda = tempExpression as java.Lambda; lambda = lambda.withMarkers(this.visitMarkers(lambda.markers, p)); lambda = lambda.withParameters(this.visitAndCast(lambda.parameters, p)!); - lambda = lambda.withArrow(this.visitSpace(lambda.arrow, SpaceLocation.LAMBDA_ARROW_PREFIX, p)!); + lambda = lambda.withArrow(this.visitSpace(lambda.arrow, Space.Location.LAMBDA_ARROW_PREFIX, p)!); lambda = lambda.withBody(this.visitAndCast(lambda.body, p)!); return lambda; } public visitLambdaParameters(lambdaParameters: java.LambdaParameters, p: P): J | null { - lambdaParameters = lambdaParameters.withPrefix(this.visitSpace(lambdaParameters.prefix, SpaceLocation.LAMBDA_PARAMETERS_PREFIX, p)!); + lambdaParameters = lambdaParameters.withPrefix(this.visitSpace(lambdaParameters.prefix, Space.Location.LAMBDA_PARAMETERS_PREFIX, p)!); lambdaParameters = lambdaParameters.withMarkers(this.visitMarkers(lambdaParameters.markers, p)); - lambdaParameters = lambdaParameters.padding.withParameters(ListUtils.map(lambdaParameters.padding.parameters, el => this.visitRightPadded(el, JRightPaddedLocation.LAMBDA_PARAM, p))); + lambdaParameters = lambdaParameters.padding.withParameters(ListUtils.map(lambdaParameters.padding.parameters, el => this.visitRightPadded(el, JRightPadded.Location.LAMBDA_PARAM, p))); return lambdaParameters; } public visitLiteral(literal: java.Literal, p: P): J | null { - literal = literal.withPrefix(this.visitSpace(literal.prefix, SpaceLocation.LITERAL_PREFIX, p)!); + literal = literal.withPrefix(this.visitSpace(literal.prefix, Space.Location.LITERAL_PREFIX, p)!); let tempExpression = this.visitExpression(literal, p) as Expression; if (!(tempExpression instanceof java.Literal)) { @@ -504,7 +504,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitMemberReference(memberReference: java.MemberReference, p: P): J | null { - memberReference = memberReference.withPrefix(this.visitSpace(memberReference.prefix, SpaceLocation.MEMBER_REFERENCE_PREFIX, p)!); + memberReference = memberReference.withPrefix(this.visitSpace(memberReference.prefix, Space.Location.MEMBER_REFERENCE_PREFIX, p)!); let tempExpression = this.visitExpression(memberReference, p) as Expression; if (!(tempExpression instanceof java.MemberReference)) { @@ -512,14 +512,14 @@ export class JavaVisitor

extends TreeVisitor { } memberReference = tempExpression as java.MemberReference; memberReference = memberReference.withMarkers(this.visitMarkers(memberReference.markers, p)); - memberReference = memberReference.padding.withContaining(this.visitRightPadded(memberReference.padding.containing, JRightPaddedLocation.MEMBER_REFERENCE_CONTAINING, p)!); - memberReference = memberReference.padding.withTypeParameters(this.visitContainer(memberReference.padding.typeParameters, JContainerLocation.TYPE_PARAMETERS, p)); - memberReference = memberReference.padding.withReference(this.visitLeftPadded(memberReference.padding.reference, JLeftPaddedLocation.MEMBER_REFERENCE_NAME, p)!); + memberReference = memberReference.padding.withContaining(this.visitRightPadded(memberReference.padding.containing, JRightPadded.Location.MEMBER_REFERENCE_CONTAINING, p)!); + memberReference = memberReference.padding.withTypeParameters(this.visitContainer(memberReference.padding.typeParameters, JContainer.Location.TYPE_PARAMETERS, p)); + memberReference = memberReference.padding.withReference(this.visitLeftPadded(memberReference.padding.reference, JLeftPadded.Location.MEMBER_REFERENCE_NAME, p)!); return memberReference; } public visitMethodDeclaration(methodDeclaration: java.MethodDeclaration, p: P): J | null { - methodDeclaration = methodDeclaration.withPrefix(this.visitSpace(methodDeclaration.prefix, SpaceLocation.METHOD_DECLARATION_PREFIX, p)!); + methodDeclaration = methodDeclaration.withPrefix(this.visitSpace(methodDeclaration.prefix, Space.Location.METHOD_DECLARATION_PREFIX, p)!); let tempStatement = this.visitStatement(methodDeclaration, p) as Statement; if (!(tempStatement instanceof java.MethodDeclaration)) { @@ -532,15 +532,15 @@ export class JavaVisitor

extends TreeVisitor { methodDeclaration = methodDeclaration.annotations.withTypeParameters(this.visitAndCast(methodDeclaration.annotations.typeParameters, p)); methodDeclaration = methodDeclaration.withReturnTypeExpression(this.visitAndCast(methodDeclaration.returnTypeExpression, p)); methodDeclaration = methodDeclaration.annotations.withName(methodDeclaration.annotations.name.withAnnotations(ListUtils.map(methodDeclaration.annotations.name.annotations, el => this.visit(el, p) as java.Annotation)).withIdentifier(this.visitAndCast(methodDeclaration.annotations.name.identifier, p)!)); - methodDeclaration = methodDeclaration.padding.withParameters(this.visitContainer(methodDeclaration.padding.parameters, JContainerLocation.METHOD_DECLARATION_PARAMETERS, p)!); - methodDeclaration = methodDeclaration.padding.withThrows(this.visitContainer(methodDeclaration.padding.throws, JContainerLocation.THROWS, p)); + methodDeclaration = methodDeclaration.padding.withParameters(this.visitContainer(methodDeclaration.padding.parameters, JContainer.Location.METHOD_DECLARATION_PARAMETERS, p)!); + methodDeclaration = methodDeclaration.padding.withThrows(this.visitContainer(methodDeclaration.padding.throws, JContainer.Location.THROWS, p)); methodDeclaration = methodDeclaration.withBody(this.visitAndCast(methodDeclaration.body, p)); - methodDeclaration = methodDeclaration.padding.withDefaultValue(this.visitLeftPadded(methodDeclaration.padding.defaultValue, JLeftPaddedLocation.METHOD_DECLARATION_DEFAULT_VALUE, p)); + methodDeclaration = methodDeclaration.padding.withDefaultValue(this.visitLeftPadded(methodDeclaration.padding.defaultValue, JLeftPadded.Location.METHOD_DECLARATION_DEFAULT_VALUE, p)); return methodDeclaration; } public visitMethodInvocation(methodInvocation: java.MethodInvocation, p: P): J | null { - methodInvocation = methodInvocation.withPrefix(this.visitSpace(methodInvocation.prefix, SpaceLocation.METHOD_INVOCATION_PREFIX, p)!); + methodInvocation = methodInvocation.withPrefix(this.visitSpace(methodInvocation.prefix, Space.Location.METHOD_INVOCATION_PREFIX, p)!); let tempStatement = this.visitStatement(methodInvocation, p) as Statement; if (!(tempStatement instanceof java.MethodInvocation)) { @@ -554,29 +554,29 @@ export class JavaVisitor

extends TreeVisitor { } methodInvocation = tempExpression as java.MethodInvocation; methodInvocation = methodInvocation.withMarkers(this.visitMarkers(methodInvocation.markers, p)); - methodInvocation = methodInvocation.padding.withSelect(this.visitRightPadded(methodInvocation.padding.select, JRightPaddedLocation.METHOD_SELECT, p)); - methodInvocation = methodInvocation.padding.withTypeParameters(this.visitContainer(methodInvocation.padding.typeParameters, JContainerLocation.TYPE_PARAMETERS, p)); + methodInvocation = methodInvocation.padding.withSelect(this.visitRightPadded(methodInvocation.padding.select, JRightPadded.Location.METHOD_SELECT, p)); + methodInvocation = methodInvocation.padding.withTypeParameters(this.visitContainer(methodInvocation.padding.typeParameters, JContainer.Location.TYPE_PARAMETERS, p)); methodInvocation = methodInvocation.withName(this.visitAndCast(methodInvocation.name, p)!); - methodInvocation = methodInvocation.padding.withArguments(this.visitContainer(methodInvocation.padding.arguments, JContainerLocation.METHOD_INVOCATION_ARGUMENTS, p)!); + methodInvocation = methodInvocation.padding.withArguments(this.visitContainer(methodInvocation.padding.arguments, JContainer.Location.METHOD_INVOCATION_ARGUMENTS, p)!); return methodInvocation; } public visitModifier(modifier: java.Modifier, p: P): J | null { - modifier = modifier.withPrefix(this.visitSpace(modifier.prefix, SpaceLocation.MODIFIER_PREFIX, p)!); + modifier = modifier.withPrefix(this.visitSpace(modifier.prefix, Space.Location.MODIFIER_PREFIX, p)!); modifier = modifier.withMarkers(this.visitMarkers(modifier.markers, p)); modifier = modifier.withAnnotations(ListUtils.map(modifier.annotations, el => this.visit(el, p) as java.Annotation)); return modifier; } public visitMultiCatch(multiCatch: java.MultiCatch, p: P): J | null { - multiCatch = multiCatch.withPrefix(this.visitSpace(multiCatch.prefix, SpaceLocation.MULTI_CATCH_PREFIX, p)!); + multiCatch = multiCatch.withPrefix(this.visitSpace(multiCatch.prefix, Space.Location.MULTI_CATCH_PREFIX, p)!); multiCatch = multiCatch.withMarkers(this.visitMarkers(multiCatch.markers, p)); - multiCatch = multiCatch.padding.withAlternatives(ListUtils.map(multiCatch.padding.alternatives, el => this.visitRightPadded(el, JRightPaddedLocation.CATCH_ALTERNATIVE, p))); + multiCatch = multiCatch.padding.withAlternatives(ListUtils.map(multiCatch.padding.alternatives, el => this.visitRightPadded(el, JRightPadded.Location.CATCH_ALTERNATIVE, p))); return multiCatch; } public visitNewArray(newArray: java.NewArray, p: P): J | null { - newArray = newArray.withPrefix(this.visitSpace(newArray.prefix, SpaceLocation.NEW_ARRAY_PREFIX, p)!); + newArray = newArray.withPrefix(this.visitSpace(newArray.prefix, Space.Location.NEW_ARRAY_PREFIX, p)!); let tempExpression = this.visitExpression(newArray, p) as Expression; if (!(tempExpression instanceof java.NewArray)) { @@ -586,19 +586,19 @@ export class JavaVisitor

extends TreeVisitor { newArray = newArray.withMarkers(this.visitMarkers(newArray.markers, p)); newArray = newArray.withTypeExpression(this.visitAndCast(newArray.typeExpression, p)); newArray = newArray.withDimensions(ListUtils.map(newArray.dimensions, el => this.visit(el, p) as java.ArrayDimension)); - newArray = newArray.padding.withInitializer(this.visitContainer(newArray.padding.initializer, JContainerLocation.NEW_ARRAY_INITIALIZER, p)); + newArray = newArray.padding.withInitializer(this.visitContainer(newArray.padding.initializer, JContainer.Location.NEW_ARRAY_INITIALIZER, p)); return newArray; } public visitArrayDimension(arrayDimension: java.ArrayDimension, p: P): J | null { - arrayDimension = arrayDimension.withPrefix(this.visitSpace(arrayDimension.prefix, SpaceLocation.DIMENSION_PREFIX, p)!); + arrayDimension = arrayDimension.withPrefix(this.visitSpace(arrayDimension.prefix, Space.Location.DIMENSION_PREFIX, p)!); arrayDimension = arrayDimension.withMarkers(this.visitMarkers(arrayDimension.markers, p)); - arrayDimension = arrayDimension.padding.withIndex(this.visitRightPadded(arrayDimension.padding.index, JRightPaddedLocation.ARRAY_INDEX, p)!); + arrayDimension = arrayDimension.padding.withIndex(this.visitRightPadded(arrayDimension.padding.index, JRightPadded.Location.ARRAY_INDEX, p)!); return arrayDimension; } public visitNewClass(newClass: java.NewClass, p: P): J | null { - newClass = newClass.withPrefix(this.visitSpace(newClass.prefix, SpaceLocation.NEW_CLASS_PREFIX, p)!); + newClass = newClass.withPrefix(this.visitSpace(newClass.prefix, Space.Location.NEW_CLASS_PREFIX, p)!); let tempStatement = this.visitStatement(newClass, p) as Statement; if (!(tempStatement instanceof java.NewClass)) { @@ -612,16 +612,16 @@ export class JavaVisitor

extends TreeVisitor { } newClass = tempExpression as java.NewClass; newClass = newClass.withMarkers(this.visitMarkers(newClass.markers, p)); - newClass = newClass.padding.withEnclosing(this.visitRightPadded(newClass.padding.enclosing, JRightPaddedLocation.NEW_CLASS_ENCLOSING, p)); - newClass = newClass.withNew(this.visitSpace(newClass.new, SpaceLocation.NEW_PREFIX, p)!); + newClass = newClass.padding.withEnclosing(this.visitRightPadded(newClass.padding.enclosing, JRightPadded.Location.NEW_CLASS_ENCLOSING, p)); + newClass = newClass.withNew(this.visitSpace(newClass.new, Space.Location.NEW_PREFIX, p)!); newClass = newClass.withClazz(this.visitAndCast(newClass.clazz, p)); - newClass = newClass.padding.withArguments(this.visitContainer(newClass.padding.arguments, JContainerLocation.NEW_CLASS_ARGUMENTS, p)!); + newClass = newClass.padding.withArguments(this.visitContainer(newClass.padding.arguments, JContainer.Location.NEW_CLASS_ARGUMENTS, p)!); newClass = newClass.withBody(this.visitAndCast(newClass.body, p)); return newClass; } public visitNullableType(nullableType: java.NullableType, p: P): J | null { - nullableType = nullableType.withPrefix(this.visitSpace(nullableType.prefix, SpaceLocation.NULLABLE_TYPE_PREFIX, p)!); + nullableType = nullableType.withPrefix(this.visitSpace(nullableType.prefix, Space.Location.NULLABLE_TYPE_PREFIX, p)!); let tempExpression = this.visitExpression(nullableType, p) as Expression; if (!(tempExpression instanceof java.NullableType)) { @@ -630,12 +630,12 @@ export class JavaVisitor

extends TreeVisitor { nullableType = tempExpression as java.NullableType; nullableType = nullableType.withMarkers(this.visitMarkers(nullableType.markers, p)); nullableType = nullableType.withAnnotations(ListUtils.map(nullableType.annotations, el => this.visit(el, p) as java.Annotation)); - nullableType = nullableType.padding.withTypeTree(this.visitRightPadded(nullableType.padding.typeTree, JRightPaddedLocation.NULLABLE, p)!); + nullableType = nullableType.padding.withTypeTree(this.visitRightPadded(nullableType.padding.typeTree, JRightPadded.Location.NULLABLE, p)!); return nullableType; } public visitPackage(_package: java.Package, p: P): J | null { - _package = _package.withPrefix(this.visitSpace(_package.prefix, SpaceLocation.PACKAGE_PREFIX, p)!); + _package = _package.withPrefix(this.visitSpace(_package.prefix, Space.Location.PACKAGE_PREFIX, p)!); let tempStatement = this.visitStatement(_package, p) as Statement; if (!(tempStatement instanceof java.Package)) { @@ -649,7 +649,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitParameterizedType(parameterizedType: java.ParameterizedType, p: P): J | null { - parameterizedType = parameterizedType.withPrefix(this.visitSpace(parameterizedType.prefix, SpaceLocation.PARAMETERIZED_TYPE_PREFIX, p)!); + parameterizedType = parameterizedType.withPrefix(this.visitSpace(parameterizedType.prefix, Space.Location.PARAMETERIZED_TYPE_PREFIX, p)!); let tempExpression = this.visitExpression(parameterizedType, p) as Expression; if (!(tempExpression instanceof java.ParameterizedType)) { @@ -658,12 +658,12 @@ export class JavaVisitor

extends TreeVisitor { parameterizedType = tempExpression as java.ParameterizedType; parameterizedType = parameterizedType.withMarkers(this.visitMarkers(parameterizedType.markers, p)); parameterizedType = parameterizedType.withClazz(this.visitAndCast(parameterizedType.clazz, p)!); - parameterizedType = parameterizedType.padding.withTypeParameters(this.visitContainer(parameterizedType.padding.typeParameters, JContainerLocation.TYPE_PARAMETERS, p)); + parameterizedType = parameterizedType.padding.withTypeParameters(this.visitContainer(parameterizedType.padding.typeParameters, JContainer.Location.TYPE_PARAMETERS, p)); return parameterizedType; } public visitParentheses(parentheses: java.Parentheses, p: P): J | null { - parentheses = parentheses.withPrefix(this.visitSpace(parentheses.prefix, SpaceLocation.PARENTHESES_PREFIX, p)!); + parentheses = parentheses.withPrefix(this.visitSpace(parentheses.prefix, Space.Location.PARENTHESES_PREFIX, p)!); let tempExpression = this.visitExpression(parentheses, p) as Expression; if (!(tempExpression instanceof java.Parentheses)) { @@ -671,12 +671,12 @@ export class JavaVisitor

extends TreeVisitor { } parentheses = tempExpression as java.Parentheses; parentheses = parentheses.withMarkers(this.visitMarkers(parentheses.markers, p)); - parentheses = parentheses.padding.withTree(this.visitRightPadded(parentheses.padding.tree, JRightPaddedLocation.PARENTHESES, p)!); + parentheses = parentheses.padding.withTree(this.visitRightPadded(parentheses.padding.tree, JRightPadded.Location.PARENTHESES, p)!); return parentheses; } public visitControlParentheses(controlParentheses: java.ControlParentheses, p: P): J | null { - controlParentheses = controlParentheses.withPrefix(this.visitSpace(controlParentheses.prefix, SpaceLocation.CONTROL_PARENTHESES_PREFIX, p)!); + controlParentheses = controlParentheses.withPrefix(this.visitSpace(controlParentheses.prefix, Space.Location.CONTROL_PARENTHESES_PREFIX, p)!); let tempExpression = this.visitExpression(controlParentheses, p) as Expression; if (!(tempExpression instanceof java.ControlParentheses)) { @@ -684,12 +684,12 @@ export class JavaVisitor

extends TreeVisitor { } controlParentheses = tempExpression as java.ControlParentheses; controlParentheses = controlParentheses.withMarkers(this.visitMarkers(controlParentheses.markers, p)); - controlParentheses = controlParentheses.padding.withTree(this.visitRightPadded(controlParentheses.padding.tree, JRightPaddedLocation.PARENTHESES, p)!); + controlParentheses = controlParentheses.padding.withTree(this.visitRightPadded(controlParentheses.padding.tree, JRightPadded.Location.PARENTHESES, p)!); return controlParentheses; } public visitPrimitive(primitive: java.Primitive, p: P): J | null { - primitive = primitive.withPrefix(this.visitSpace(primitive.prefix, SpaceLocation.PRIMITIVE_PREFIX, p)!); + primitive = primitive.withPrefix(this.visitSpace(primitive.prefix, Space.Location.PRIMITIVE_PREFIX, p)!); let tempExpression = this.visitExpression(primitive, p) as Expression; if (!(tempExpression instanceof java.Primitive)) { @@ -701,7 +701,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitReturn(_return: java.Return, p: P): J | null { - _return = _return.withPrefix(this.visitSpace(_return.prefix, SpaceLocation.RETURN_PREFIX, p)!); + _return = _return.withPrefix(this.visitSpace(_return.prefix, Space.Location.RETURN_PREFIX, p)!); let tempStatement = this.visitStatement(_return, p) as Statement; if (!(tempStatement instanceof java.Return)) { @@ -714,7 +714,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitSwitch(_switch: java.Switch, p: P): J | null { - _switch = _switch.withPrefix(this.visitSpace(_switch.prefix, SpaceLocation.SWITCH_PREFIX, p)!); + _switch = _switch.withPrefix(this.visitSpace(_switch.prefix, Space.Location.SWITCH_PREFIX, p)!); let tempStatement = this.visitStatement(_switch, p) as Statement; if (!(tempStatement instanceof java.Switch)) { @@ -728,7 +728,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitSwitchExpression(switchExpression: java.SwitchExpression, p: P): J | null { - switchExpression = switchExpression.withPrefix(this.visitSpace(switchExpression.prefix, SpaceLocation.SWITCH_EXPRESSION_PREFIX, p)!); + switchExpression = switchExpression.withPrefix(this.visitSpace(switchExpression.prefix, Space.Location.SWITCH_EXPRESSION_PREFIX, p)!); let tempExpression = this.visitExpression(switchExpression, p) as Expression; if (!(tempExpression instanceof java.SwitchExpression)) { @@ -742,7 +742,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitSynchronized(synchronized: java.Synchronized, p: P): J | null { - synchronized = synchronized.withPrefix(this.visitSpace(synchronized.prefix, SpaceLocation.SYNCHRONIZED_PREFIX, p)!); + synchronized = synchronized.withPrefix(this.visitSpace(synchronized.prefix, Space.Location.SYNCHRONIZED_PREFIX, p)!); let tempStatement = this.visitStatement(synchronized, p) as Statement; if (!(tempStatement instanceof java.Synchronized)) { @@ -756,7 +756,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitTernary(ternary: java.Ternary, p: P): J | null { - ternary = ternary.withPrefix(this.visitSpace(ternary.prefix, SpaceLocation.TERNARY_PREFIX, p)!); + ternary = ternary.withPrefix(this.visitSpace(ternary.prefix, Space.Location.TERNARY_PREFIX, p)!); let tempStatement = this.visitStatement(ternary, p) as Statement; if (!(tempStatement instanceof java.Ternary)) { @@ -771,13 +771,13 @@ export class JavaVisitor

extends TreeVisitor { ternary = tempExpression as java.Ternary; ternary = ternary.withMarkers(this.visitMarkers(ternary.markers, p)); ternary = ternary.withCondition(this.visitAndCast(ternary.condition, p)!); - ternary = ternary.padding.withTruePart(this.visitLeftPadded(ternary.padding.truePart, JLeftPaddedLocation.TERNARY_TRUE, p)!); - ternary = ternary.padding.withFalsePart(this.visitLeftPadded(ternary.padding.falsePart, JLeftPaddedLocation.TERNARY_FALSE, p)!); + ternary = ternary.padding.withTruePart(this.visitLeftPadded(ternary.padding.truePart, JLeftPadded.Location.TERNARY_TRUE, p)!); + ternary = ternary.padding.withFalsePart(this.visitLeftPadded(ternary.padding.falsePart, JLeftPadded.Location.TERNARY_FALSE, p)!); return ternary; } public visitThrow(_throw: java.Throw, p: P): J | null { - _throw = _throw.withPrefix(this.visitSpace(_throw.prefix, SpaceLocation.THROW_PREFIX, p)!); + _throw = _throw.withPrefix(this.visitSpace(_throw.prefix, Space.Location.THROW_PREFIX, p)!); let tempStatement = this.visitStatement(_throw, p) as Statement; if (!(tempStatement instanceof java.Throw)) { @@ -790,7 +790,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitTry(_try: java.Try, p: P): J | null { - _try = _try.withPrefix(this.visitSpace(_try.prefix, SpaceLocation.TRY_PREFIX, p)!); + _try = _try.withPrefix(this.visitSpace(_try.prefix, Space.Location.TRY_PREFIX, p)!); let tempStatement = this.visitStatement(_try, p) as Statement; if (!(tempStatement instanceof java.Try)) { @@ -798,22 +798,22 @@ export class JavaVisitor

extends TreeVisitor { } _try = tempStatement as java.Try; _try = _try.withMarkers(this.visitMarkers(_try.markers, p)); - _try = _try.padding.withResources(this.visitContainer(_try.padding.resources, JContainerLocation.TRY_RESOURCES, p)); + _try = _try.padding.withResources(this.visitContainer(_try.padding.resources, JContainer.Location.TRY_RESOURCES, p)); _try = _try.withBody(this.visitAndCast(_try.body, p)!); _try = _try.withCatches(ListUtils.map(_try.catches, el => this.visit(el, p) as java.TryCatch)); - _try = _try.padding.withFinally(this.visitLeftPadded(_try.padding.finally, JLeftPaddedLocation.TRY_FINALLY, p)); + _try = _try.padding.withFinally(this.visitLeftPadded(_try.padding.finally, JLeftPadded.Location.TRY_FINALLY, p)); return _try; } public visitTryResource(tryResource: java.TryResource, p: P): J | null { - tryResource = tryResource.withPrefix(this.visitSpace(tryResource.prefix, SpaceLocation.TRY_RESOURCE, p)!); + tryResource = tryResource.withPrefix(this.visitSpace(tryResource.prefix, Space.Location.TRY_RESOURCE, p)!); tryResource = tryResource.withMarkers(this.visitMarkers(tryResource.markers, p)); tryResource = tryResource.withVariableDeclarations(this.visitAndCast(tryResource.variableDeclarations, p)!); return tryResource; } public visitCatch(tryCatch: java.TryCatch, p: P): J | null { - tryCatch = tryCatch.withPrefix(this.visitSpace(tryCatch.prefix, SpaceLocation.CATCH_PREFIX, p)!); + tryCatch = tryCatch.withPrefix(this.visitSpace(tryCatch.prefix, Space.Location.CATCH_PREFIX, p)!); tryCatch = tryCatch.withMarkers(this.visitMarkers(tryCatch.markers, p)); tryCatch = tryCatch.withParameter(this.visitAndCast(tryCatch.parameter, p)!); tryCatch = tryCatch.withBody(this.visitAndCast(tryCatch.body, p)!); @@ -821,7 +821,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitTypeCast(typeCast: java.TypeCast, p: P): J | null { - typeCast = typeCast.withPrefix(this.visitSpace(typeCast.prefix, SpaceLocation.TYPE_CAST_PREFIX, p)!); + typeCast = typeCast.withPrefix(this.visitSpace(typeCast.prefix, Space.Location.TYPE_CAST_PREFIX, p)!); let tempExpression = this.visitExpression(typeCast, p) as Expression; if (!(tempExpression instanceof java.TypeCast)) { @@ -835,25 +835,25 @@ export class JavaVisitor

extends TreeVisitor { } public visitTypeParameter(typeParameter: java.TypeParameter, p: P): J | null { - typeParameter = typeParameter.withPrefix(this.visitSpace(typeParameter.prefix, SpaceLocation.TYPE_PARAMETERS_PREFIX, p)!); + typeParameter = typeParameter.withPrefix(this.visitSpace(typeParameter.prefix, Space.Location.TYPE_PARAMETERS_PREFIX, p)!); typeParameter = typeParameter.withMarkers(this.visitMarkers(typeParameter.markers, p)); typeParameter = typeParameter.withAnnotations(ListUtils.map(typeParameter.annotations, el => this.visit(el, p) as java.Annotation)); typeParameter = typeParameter.withModifiers(ListUtils.map(typeParameter.modifiers, el => this.visit(el, p) as java.Modifier)); typeParameter = typeParameter.withName(this.visitAndCast(typeParameter.name, p)!); - typeParameter = typeParameter.padding.withBounds(this.visitContainer(typeParameter.padding.bounds, JContainerLocation.TYPE_BOUNDS, p)); + typeParameter = typeParameter.padding.withBounds(this.visitContainer(typeParameter.padding.bounds, JContainer.Location.TYPE_BOUNDS, p)); return typeParameter; } public visitTypeParameters(typeParameters: java.TypeParameters, p: P): J | null { - typeParameters = typeParameters.withPrefix(this.visitSpace(typeParameters.prefix, SpaceLocation.TYPE_PARAMETERS_PREFIX, p)!); + typeParameters = typeParameters.withPrefix(this.visitSpace(typeParameters.prefix, Space.Location.TYPE_PARAMETERS_PREFIX, p)!); typeParameters = typeParameters.withMarkers(this.visitMarkers(typeParameters.markers, p)); typeParameters = typeParameters.withAnnotations(ListUtils.map(typeParameters.annotations, el => this.visit(el, p) as java.Annotation)); - typeParameters = typeParameters.padding.withTypeParameters(ListUtils.map(typeParameters.padding.typeParameters, el => this.visitRightPadded(el, JRightPaddedLocation.TYPE_PARAMETER, p))); + typeParameters = typeParameters.padding.withTypeParameters(ListUtils.map(typeParameters.padding.typeParameters, el => this.visitRightPadded(el, JRightPadded.Location.TYPE_PARAMETER, p))); return typeParameters; } public visitUnary(unary: java.Unary, p: P): J | null { - unary = unary.withPrefix(this.visitSpace(unary.prefix, SpaceLocation.UNARY_PREFIX, p)!); + unary = unary.withPrefix(this.visitSpace(unary.prefix, Space.Location.UNARY_PREFIX, p)!); let tempStatement = this.visitStatement(unary, p) as Statement; if (!(tempStatement instanceof java.Unary)) { @@ -867,13 +867,13 @@ export class JavaVisitor

extends TreeVisitor { } unary = tempExpression as java.Unary; unary = unary.withMarkers(this.visitMarkers(unary.markers, p)); - unary = unary.padding.withOperator(this.visitLeftPadded(unary.padding.operator, JLeftPaddedLocation.UNARY_OPERATOR, p)!); + unary = unary.padding.withOperator(this.visitLeftPadded(unary.padding.operator, JLeftPadded.Location.UNARY_OPERATOR, p)!); unary = unary.withExpression(this.visitAndCast(unary.expression, p)!); return unary; } public visitVariableDeclarations(variableDeclarations: java.VariableDeclarations, p: P): J | null { - variableDeclarations = variableDeclarations.withPrefix(this.visitSpace(variableDeclarations.prefix, SpaceLocation.VARIABLE_DECLARATIONS_PREFIX, p)!); + variableDeclarations = variableDeclarations.withPrefix(this.visitSpace(variableDeclarations.prefix, Space.Location.VARIABLE_DECLARATIONS_PREFIX, p)!); let tempStatement = this.visitStatement(variableDeclarations, p) as Statement; if (!(tempStatement instanceof java.VariableDeclarations)) { @@ -884,23 +884,23 @@ export class JavaVisitor

extends TreeVisitor { variableDeclarations = variableDeclarations.withLeadingAnnotations(ListUtils.map(variableDeclarations.leadingAnnotations, el => this.visit(el, p) as java.Annotation)); variableDeclarations = variableDeclarations.withModifiers(ListUtils.map(variableDeclarations.modifiers, el => this.visit(el, p) as java.Modifier)); variableDeclarations = variableDeclarations.withTypeExpression(this.visitAndCast(variableDeclarations.typeExpression, p)); - variableDeclarations = variableDeclarations.withVarargs(this.visitSpace(variableDeclarations.varargs, SpaceLocation.VARARGS, p)); + variableDeclarations = variableDeclarations.withVarargs(this.visitSpace(variableDeclarations.varargs, Space.Location.VARARGS, p)); variableDeclarations = variableDeclarations.withDimensionsBeforeName([el.with_before(self.visit_space(el.before, Space.Location.DIMENSION_PREFIX, p)).with_element(self.visit_space(el.element, Space.Location.DIMENSION, p)) for el in variable_declarations.dimensions_before_name]); - variableDeclarations = variableDeclarations.padding.withVariables(ListUtils.map(variableDeclarations.padding.variables, el => this.visitRightPadded(el, JRightPaddedLocation.NAMED_VARIABLE, p))); + variableDeclarations = variableDeclarations.padding.withVariables(ListUtils.map(variableDeclarations.padding.variables, el => this.visitRightPadded(el, JRightPadded.Location.NAMED_VARIABLE, p))); return variableDeclarations; } public visitVariable(variableDeclarationsNamedVariable: java.VariableDeclarationsNamedVariable, p: P): J | null { - variableDeclarationsNamedVariable = variableDeclarationsNamedVariable.withPrefix(this.visitSpace(variableDeclarationsNamedVariable.prefix, SpaceLocation.VARIABLE_PREFIX, p)!); + variableDeclarationsNamedVariable = variableDeclarationsNamedVariable.withPrefix(this.visitSpace(variableDeclarationsNamedVariable.prefix, Space.Location.VARIABLE_PREFIX, p)!); variableDeclarationsNamedVariable = variableDeclarationsNamedVariable.withMarkers(this.visitMarkers(variableDeclarationsNamedVariable.markers, p)); variableDeclarationsNamedVariable = variableDeclarationsNamedVariable.withName(this.visitAndCast(variableDeclarationsNamedVariable.name, p)!); variableDeclarationsNamedVariable = variableDeclarationsNamedVariable.withDimensionsAfterName([el.with_before(self.visit_space(el.before, Space.Location.DIMENSION_PREFIX, p)).with_element(self.visit_space(el.element, Space.Location.DIMENSION, p)) for el in named_variable.dimensions_after_name]); - variableDeclarationsNamedVariable = variableDeclarationsNamedVariable.padding.withInitializer(this.visitLeftPadded(variableDeclarationsNamedVariable.padding.initializer, JLeftPaddedLocation.VARIABLE_INITIALIZER, p)); + variableDeclarationsNamedVariable = variableDeclarationsNamedVariable.padding.withInitializer(this.visitLeftPadded(variableDeclarationsNamedVariable.padding.initializer, JLeftPadded.Location.VARIABLE_INITIALIZER, p)); return variableDeclarationsNamedVariable; } public visitWhileLoop(whileLoop: java.WhileLoop, p: P): J | null { - whileLoop = whileLoop.withPrefix(this.visitSpace(whileLoop.prefix, SpaceLocation.WHILE_PREFIX, p)!); + whileLoop = whileLoop.withPrefix(this.visitSpace(whileLoop.prefix, Space.Location.WHILE_PREFIX, p)!); let tempStatement = this.visitStatement(whileLoop, p) as Statement; if (!(tempStatement instanceof java.WhileLoop)) { @@ -909,12 +909,12 @@ export class JavaVisitor

extends TreeVisitor { whileLoop = tempStatement as java.WhileLoop; whileLoop = whileLoop.withMarkers(this.visitMarkers(whileLoop.markers, p)); whileLoop = whileLoop.withCondition(this.visitAndCast(whileLoop.condition, p)!); - whileLoop = whileLoop.padding.withBody(this.visitRightPadded(whileLoop.padding.body, JRightPaddedLocation.WHILE_BODY, p)!); + whileLoop = whileLoop.padding.withBody(this.visitRightPadded(whileLoop.padding.body, JRightPadded.Location.WHILE_BODY, p)!); return whileLoop; } public visitWildcard(wildcard: java.Wildcard, p: P): J | null { - wildcard = wildcard.withPrefix(this.visitSpace(wildcard.prefix, SpaceLocation.WILDCARD_PREFIX, p)!); + wildcard = wildcard.withPrefix(this.visitSpace(wildcard.prefix, Space.Location.WILDCARD_PREFIX, p)!); let tempExpression = this.visitExpression(wildcard, p) as Expression; if (!(tempExpression instanceof java.Wildcard)) { @@ -922,13 +922,13 @@ export class JavaVisitor

extends TreeVisitor { } wildcard = tempExpression as java.Wildcard; wildcard = wildcard.withMarkers(this.visitMarkers(wildcard.markers, p)); - wildcard = wildcard.padding.withBound(this.visitLeftPadded(wildcard.padding.bound, JLeftPaddedLocation.WILDCARD_BOUND, p)); + wildcard = wildcard.padding.withBound(this.visitLeftPadded(wildcard.padding.bound, JLeftPadded.Location.WILDCARD_BOUND, p)); wildcard = wildcard.withBoundedType(this.visitAndCast(wildcard.boundedType, p)); return wildcard; } public visitYield(_yield: java.Yield, p: P): J | null { - _yield = _yield.withPrefix(this.visitSpace(_yield.prefix, SpaceLocation.YIELD_PREFIX, p)!); + _yield = _yield.withPrefix(this.visitSpace(_yield.prefix, Space.Location.YIELD_PREFIX, p)!); let tempStatement = this.visitStatement(_yield, p) as Statement; if (!(tempStatement instanceof java.Yield)) { @@ -941,7 +941,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitUnknown(unknown: java.Unknown, p: P): J | null { - unknown = unknown.withPrefix(this.visitSpace(unknown.prefix, SpaceLocation.UNKNOWN_PREFIX, p)!); + unknown = unknown.withPrefix(this.visitSpace(unknown.prefix, Space.Location.UNKNOWN_PREFIX, p)!); let tempStatement = this.visitStatement(unknown, p) as Statement; if (!(tempStatement instanceof java.Unknown)) { @@ -960,7 +960,7 @@ export class JavaVisitor

extends TreeVisitor { } public visitUnknownSource(unknownSource: java.UnknownSource, p: P): J | null { - unknownSource = unknownSource.withPrefix(this.visitSpace(unknownSource.prefix, SpaceLocation.UNKNOWN_SOURCE_PREFIX, p)!); + unknownSource = unknownSource.withPrefix(this.visitSpace(unknownSource.prefix, Space.Location.UNKNOWN_SOURCE_PREFIX, p)!); unknownSource = unknownSource.withMarkers(this.visitMarkers(unknownSource.markers, p)); return unknownSource; }