@Override public ASTNode parseContents(final ASTNode chameleon) { final PsiBuilder builder = JavaParserUtil.createBuilder(chameleon); JavaParser.INSTANCE.getStatementParser().parseCodeBlockDeep(builder, true); return builder.getTreeBuilt().getFirstChildNode(); }
@Override public FlyweightCapableTreeStructure<LighterASTNode> parseContents(final LighterLazyParseableNode chameleon) { final PsiBuilder builder = JavaParserUtil.createBuilder(chameleon); JavaParser.INSTANCE.getStatementParser().parseCodeBlockDeep(builder, true); return builder.getLightTree(); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getDeclarationParser().parseAnnotation(builder); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getStatementParser().parseCatchBlock(builder); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getDeclarationParser().parseParameter(builder, true, false); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getDeclarationParser().parseResource(builder); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getReferenceParser().parseType(builder, ReferenceParser.EAT_LAST_DOT | ReferenceParser.ELLIPSIS | ReferenceParser.WILDCARD | ReferenceParser.DISJUNCTIONS); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getReferenceParser().parseJavaCodeReference(builder, false, true, false, false); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getReferenceParser().parseJavaCodeReference(builder, false, true, false, true); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getReferenceParser().parseImportCodeReference(builder, true); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getReferenceParser().parseTypeParameter(builder); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getDeclarationParser().parse(builder, DeclarationParser.Context.CLASS); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getStatementParser().parseCodeBlockDeep(builder, true); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getStatementParser().parseStatement(builder); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getExpressionParser().parse(builder); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getDeclarationParser().parseEnumConstant(builder); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getDeclarationParser().parseAnnotationValue(builder); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getStatementParser().parseStatements(builder); }
@Override public void parse(final PsiBuilder builder) { JavaParser.INSTANCE.getDeclarationParser().parseModifierList(builder); }
private void doParse(final PsiBuilder builder) { final PsiBuilder.Marker root = builder.mark(); JavaParser.INSTANCE.getFileParser().parse(builder); root.done(this); }
private void doParserTest(String text) { doParserTest(text, builder -> JavaParser.INSTANCE.getExpressionParser().parse(builder)); }
private void doRefParserTest(String text, boolean incomplete) { doParserTest(text, builder -> JavaParser.INSTANCE.getReferenceParser().parseJavaCodeReference(builder, incomplete, false, false, false)); }
private void doTypeParserTest(String text) { int flags = ReferenceParser.ELLIPSIS | ReferenceParser.DIAMONDS | ReferenceParser.DISJUNCTIONS; doParserTest(text, builder -> JavaParser.INSTANCE.getReferenceParser().parseType(builder, flags)); }
private void doTypeParamsParserTest(String text) { doParserTest(text, builder -> JavaParser.INSTANCE.getReferenceParser().parseTypeParameters(builder)); }
private void doParserTest(String text) { doParserTest(text, builder -> JavaParser.INSTANCE.getFileParser().parse(builder)); }
private void doParserTest(String text, boolean isAnnotation, boolean isEnum) { doParserTest(text, builder -> JavaParser.INSTANCE.getDeclarationParser().parseClassBodyWithBraces(builder, isAnnotation, isEnum)); }
private void doBlockParserTest(String text) { doParserTest(text, builder -> JavaParser.INSTANCE.getStatementParser().parseCodeBlockDeep(builder, true)); }
private void doParserTest(String text) { doParserTest(text, builder -> JavaParser.INSTANCE.getStatementParser().parseStatements(builder)); }
private void doParserTest(String text) { doParserTest(text, builder -> JavaParser.INSTANCE.getDeclarationParser().parseAnnotations(builder)); }