Vixen
02b45cc4
csharp
public sealed class SyntaxTree

A parsed .vxml file: its tree, its text, and what went wrong reading it.

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

Fields and properties (6)

  • public Encoding? Encoding

    The encoding the file was read with, when the caller knew it.

  • public string FilePath

    The path diagnostics name and #line directives point at.

  • public int Length

    The source's length in characters.

  • public SourceText? Text

    The source text, kept for line mapping and for the next incremental reparse.

  • public IReadOnlyList<Diagnostic> Diagnostics

    Lexer and parser diagnostics (empty for a clean parse).

  • public int ReusedNodes

    How many nodes this parse took from the tree it was reparsed from.

Methods (5)

  • public SyntaxNode GetRoot()

    The document node.

  • public DocumentSyntax GetDocument()

    The document node, typed.

  • public bool TryGetRoot(out SyntaxNode? root)

    Gets the root if there is one.

  • public static SyntaxTree ParseText(string text, string? path = "", Encoding? encoding = null)

    Parses a .vxml file.

  • public SyntaxTree WithChangedText(SourceText newText)

    Reparses this tree against edited text, keeping the path and encoding.

Used by (8)

  • BinderVixen.Ui.Markup
  • EmitterTestsVixen.Ui.Markup.Tests
  • IncrementalTestsVixen.Ui.Markup.Tests
  • ParserTestsVixen.Ui.Markup.Tests
  • RecoveryTestsVixen.Ui.Markup.Tests
  • VxmlVixen.Ui.Markup.Tests
  • VxmlGeneratorVixen.Ui.Markup.Generators
  • MarkupDocumentVixen.Editor.AssetEditors