Vixen
02b45cc4
csharp
public sealed class SemanticModel

Semantic answers about one syntax tree: what a name refers to, what type an expression has, and what a declaration declares.

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

Remarks

Unlike Roslyn, which binds on demand around the node you ask about, this model binds every member body in the tree the first time it is queried and answers from the resulting maps. That keeps the binder chain construction in one place at the cost of doing the whole tree at once.

Fields and properties (3)

  • public Compilation Compilation
  • public SyntaxTree SyntaxTree
  • public IReadOnlyList<Diagnostic> Diagnostics

    Diagnostics produced by binding this tree's member bodies.

Methods (5)

  • public SymbolInfo GetSymbolInfo(SyntaxNode node)

    The symbol a name or expression refers to.

  • public TypeInfo GetTypeInfo(ExpressionSyntax node)

    The type of an expression, and the type its context converted it to.

  • public Symbol? GetDeclaredSymbol(SyntaxNode node)

    The symbol a declaration introduces.

  • public IReadOnlyList<BoundBody> GetBoundBodies()

    Every member body in this tree, normalized to a block with an explicit parameter list and return type. This is the entry point for lowering.

  • public BoundNode? GetBoundNode(SyntaxNode node)

    The bound node produced for a syntax node, for inspection and testing.

Used by (7)

  • BindingTestsVixen.Raven.Tests
  • CompilationVixen.Raven
  • LowererVixen.Raven
  • RemovedConstructsTestsVixen.Raven.Tests
  • SemanticModelTestsVixen.Raven.Tests
  • SemanticTestBaseVixen.Raven.Tests
  • SizedArrayTestsVixen.Raven.Tests