Langium - v4.4.0
    Preparing search index...

    Interface CstNode

    A node in the Concrete Syntax Tree (CST).

    interface CstNode {
        astNode: AstNode;
        container?: CompositeCstNode;
        end: number;
        grammarSource?: GrammarAST.AbstractElement;
        hidden: boolean;
        length: number;
        offset: number;
        range: Range;
        root: RootCstNode;
        text: string;
    }

    Hierarchy (View Summary)

    Implemented by

    Index
    astNode: AstNode

    The AST node created from this CST node

    container?: CompositeCstNode

    The container node in the CST

    end: number
    grammarSource?: GrammarAST.AbstractElement

    The grammar element from which this node was parsed

    hidden: boolean

    Whether the token is hidden, i.e. not explicitly part of the containing grammar rule

    length: number
    offset: number
    range: Range

    The root CST node.

    The root is resolved by walking up the container chain on every access. Avoid repeated accesses in loops over many nodes of the same tree; resolve the root once instead.

    text: string

    The actual text covered by this node.

    The text is extracted from the document content on every access. When processing many nodes of the same tree, prefer resolving root.fullText once and slicing it with the nodes' offset and end values.