private static void traverseCST(SchemaNode node, ParseContext context, List<Diagnostic> diagnostics) {
        if (node.containsOtherLanguageData(LanguageType.INDEXING)) {
            if (node.get(node.size() - 1).isASTInstance(indexingOperationElm.class)) {
                node.removeChild(node.size() - 1);
            }
            SchemaNode indexingRoot = parseIndexingScript(node, context, diagnostics);
            if (indexingRoot != null) {
                node.addChild(indexingRoot);
            }
        }

        if (node.containsOtherLanguageData(LanguageType.RANK_EXPRESSION)) {
            // Range nodeRange = node.getRange();
            // String nodeString = node.get(0).get(0).getText();
            // Position rankExpressionStart = CSTUtils.addPositions(nodeRange.getStart(), new Position(0, nodeString.length()));

            SchemaRankExpressionParser.embedCST(context, node, diagnostics);
        }

        for (Identifier<SchemaNode> identifier : context.identifiers()) {
            diagnostics.addAll(identifier.identify(node));
        }

        for (ai.vespa.schemals.tree.Node child : node) {
            traverseCST(child.getSchemaNode(), context, diagnostics);
        }
    }
SchemaDocument parses and represents .sd files
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/schemadocument/SchemaDocument.java