Vixen
02b45cc4
csharp
public abstract class SyntaxNode

Base of the public red tree: a lazy overlay over an immutable GreenNode that adds a Parent pointer and an absolute Position. Child red nodes are realized on demand from the green tree and cached, so navigation is cheap and identity-stable.

No guide page documents this yet — the page shows what the code says about itself.

Fields and properties (7)

  • public SyntaxNode? Parent

    The enclosing node, or null at the root.

  • public int RawKind

    The node's kind as a raw integer. Each language re-exposes this as its own enum — Raven's RavenSyntaxNode.Kind is (SyntaxKind)RawKind.

  • public int SlotCount

    Number of child slots, including empty ones.

  • public bool IsList

    Whether this is the anonymous list node backing a SyntaxList`1.

  • public ISyntaxTree? SyntaxTree

    The tree this node belongs to. Only the root carries the back-reference; every other node walks up to it.

  • public TextSpan FullSpan

    Absolute span including leading/trailing trivia.

  • public TextSpan Span

    Absolute span of the significant text, excluding surrounding trivia.

Methods (22)

  • public Location GetLocation()

    This node's Span as a diagnostic Location.

  • public abstract SyntaxNode? GetSlot(int index)

    Red child at the given slot (node or token), or null.

  • public IEnumerable<SyntaxNode> ChildNodesAndTokens()

    The non-empty children, nodes and tokens alike, in source order.

  • public IEnumerable<SyntaxNode> ChildNodesAndTokensFlattened()

    The children with list nodes flattened away, in source order.

  • public IEnumerable<SyntaxNode> ChildNodes()

    The child nodes, without tokens and with list nodes flattened away.

  • public IEnumerable<SyntaxToken> ChildTokens()

    The child tokens, with list nodes flattened away.

  • public IEnumerable<SyntaxNode> DescendantNodesAndTokens()

    Everything beneath this node, nodes and tokens alike, in source order.

  • public IEnumerable<SyntaxNode> DescendantNodes()

    Every node beneath this one, in source order. Tokens are not nodes here.

  • public IEnumerable<SyntaxNode> DescendantNodesAndSelf()

    This node and every node beneath it.

  • public IEnumerable<SyntaxToken> DescendantTokens()

    Every token beneath this node, in source order — the node's text, tokenized.

  • public IEnumerable<SyntaxNode> Ancestors()

    The enclosing nodes, innermost first.

  • public IEnumerable<SyntaxNode> AncestorsAndSelf()

    This node and its enclosing nodes, innermost first.

  • public TNode? FirstAncestorOrSelf<TNode>() where TNode : SyntaxNode

    The innermost at or above this node, or null.

  • public SyntaxToken? GetFirstToken()

    The first token of this subtree, or null if it has none.

  • public SyntaxToken? GetLastToken()

    The last token of this subtree, or null if it has none.

  • public bool Contains(SyntaxNode? node)

    Whether is this node or lies beneath it.

  • public SyntaxToken FindToken(int position)

    The token whose full span — trivia included — contains .

  • public SyntaxNode? FindNode(TextSpan span)

    The innermost node whose Span covers , or null when nothing beneath this node does.

  • public bool IsEquivalentTo(SyntaxNode? other)

    Whether this subtree and say the same thing, ignoring trivia.

  • public string ToFullString()

    Full source text of this subtree, including all trivia (byte-for-byte).

  • public override string ToString()

    Significant text of this subtree, excluding outer trivia.

  • protected SyntaxNode? GetRed(int index)

    Realize (and cache) the red child at the given green slot, or null if empty.

Used by (339, showing 40)

  • Vixen.Ui.Markup
  • AttributeSyntaxVixen.Ui.Markup
  • AttributeSyntaxVixen.Ui.Markup
  • AttributeValueSyntaxVixen.Ui.Markup
  • BinderVixen.Ui.Markup
  • BlenderVixen.Core.Syntax
  • CodeBlockSyntaxVixen.Ui.Markup
  • CodeBlockSyntaxVixen.Ui.Markup
  • ComponentDirectiveSyntaxVixen.Ui.Markup
  • ComponentDirectiveSyntaxVixen.Ui.Markup
  • DirectiveSyntaxVixen.Ui.Markup
  • DocumentSyntaxVixen.Ui.Markup
  • DocumentSyntaxVixen.Ui.Markup
  • ElementSyntaxVixen.Ui.Markup
  • ElementSyntaxVixen.Ui.Markup
  • ElseClauseSyntaxVixen.Ui.Markup
  • ElseClauseSyntaxVixen.Ui.Markup
  • EndTagSyntaxVixen.Ui.Markup
  • EndTagSyntaxVixen.Ui.Markup
  • ExpressionAttributeValueSyntaxVixen.Ui.Markup
  • ExpressionAttributeValueSyntaxVixen.Ui.Markup
  • ForSyntaxVixen.Ui.Markup
  • ForSyntaxVixen.Ui.Markup
  • GreenNodeVixen.Core.Syntax
  • IfSyntaxVixen.Ui.Markup
  • IfSyntaxVixen.Ui.Markup
  • IncrementalTestsVixen.Ui.Markup.Tests
  • InterpolationSyntaxVixen.Ui.Markup
  • InterpolationSyntaxVixen.Ui.Markup
  • MarkupBlockSyntaxVixen.Ui.Markup
  • MarkupBlockSyntaxVixen.Ui.Markup
  • MarkupSyntaxVixen.Ui.Markup
  • NamespaceDirectiveSyntaxVixen.Ui.Markup
  • NamespaceDirectiveSyntaxVixen.Ui.Markup
  • NavigationTestsVixen.Core.Syntax.Tests
  • ParserTestsVixen.Ui.Markup.Tests
  • QuotedAttributeValueSyntaxVixen.Ui.Markup
  • QuotedAttributeValueSyntaxVixen.Ui.Markup
  • RecoveryTestsVixen.Ui.Markup.Tests
  • RedTreeTestsVixen.Core.Syntax.Tests