ASTNode (@NotNull ASTNode chameleon) { PsiBuilder builder = createBuilder(chameleon); PsiBuilder.Marker root = builder.mark(); TEST_PARSER.accept(builder); if (!builder.eof()) { PsiBuilder.Marker unparsed = builder.mark(); while (!builder.eof()) builder.advanceLexer(); unparsed.error("Unparsed tokens"); } root.done(this); ASTNode rootNode = builder.getTreeBuilt(); return rootNode.getFirstChildNode(); }