return scopedExpression;
}
TerminalNode newNode = getTerminalNode(context, JavaParser.NEW);
if (newNode != null) {
ClassInstantiation newInvocation = createNode(newNode, context, ClassInstantiation.class);
NonWildcardTypeArgumentsContext nonWildcardTypeArgumentsContext =
getChild(context, NonWildcardTypeArgumentsContext.class);
if (nonWildcardTypeArgumentsContext != null) {
newInvocation.setTypeArguments(getAdapter(NonWildcardTypeArgumentsAdapter.class).adapt(
nonWildcardTypeArgumentsContext));
}
InnerCreatorContext innerCreatorContext = getChild(context, InnerCreatorContext.class);
if (innerCreatorContext != null) {
TerminalNode typeIdentifierNode =
getTerminalNode(innerCreatorContext, JavaParser.Identifier);
NonWildcardTypeArgumentsOrDiamondContext nonWildcardTypeArgumentsOrDiamondContext =
getChild(innerCreatorContext, NonWildcardTypeArgumentsOrDiamondContext.class);
TypeWithArguments typeWithArguments =
createNode(typeIdentifierNode,
nonWildcardTypeArgumentsOrDiamondContext == null
? typeIdentifierNode
: nonWildcardTypeArgumentsOrDiamondContext,
TypeWithArguments.class);
typeWithArguments.setIdentifiersWithTypeArguments(
convertIdentifiersWithTypeArguments(innerCreatorContext));
newInvocation.setType(typeWithArguments);
ClassCreatorRestContext classCreatorRestContext =
getChild(innerCreatorContext, ClassCreatorRestContext.class);
if (classCreatorRestContext != null) {
ArgumentsContext arguments = getChild(classCreatorRestContext, ArgumentsContext.class);
if (arguments != null) {
newInvocation.setArguments(getAdapter(ArgumentsAdapter.class).adapt(arguments));
}
ClassBodyContext classBodyContext =
getChild(classCreatorRestContext, ClassBodyContext.class);
if (classBodyContext != null) {
newInvocation.setMemberDeclarations(
getAdapter(ClassBodyAdapter.class).adapt(classBodyContext));
}
}
}