public static SchemaDocument.ParseResult parseContent(ParseContext context) {
        CharSequence sequence = context.content();
        SchemaParser parserFaultTolerant = new SchemaParser(context.fileURI(), sequence);
        parserFaultTolerant.setParserTolerant(true);

        try {
            parserFaultTolerant.RootRankProfile();
        } catch(ParseException pe) {
            // ignore
        } catch(IllegalArgumentException e) {
            // ignore
        }

        Node node = parserFaultTolerant.rootNode();
        var tolerantResult = SchemaDocument.parseCST(node, context);

        tolerantResult.diagnostics().addAll(InheritanceResolver.resolveInheritances(context));

        if (tolerantResult.CST().isPresent()) {
            tolerantResult.diagnostics().addAll(ResolverTraversal.traverse(context, tolerantResult.CST().get()));
        }

        return tolerantResult;
    }
RankProfileDocumnet parses and represents .profile files
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/schemadocument/RankProfileDocument.java