Vixen
02b45cc4
csharp
public sealed class Binder

Turns a parsed document into a BoundComponent: what each tag is, what each attribute means, and where every expression came from.

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

Remarks

There is no semantic model here, and that is the design rather than a shortcut. The original sketch had the binder resolve <Counter Title="x" /> against the C# type Counter using Roslyn's Compilation. It does not need to: if the emitter puts the tag's name and the attribute's name into an object initializer under a #line, then an unknown component, a misspelt parameter and a wrong type are all reported by Roslyn — at the right character of the .vxml — with no type resolution on this side at all. What is left for the binder is the set of mistakes Roslyn cannot catch, because they are about markup rather than about C#.

Which is why every diagnostic below is structural: a duplicate attribute, an event handler given a string, two slots with one name, a loop whose elements have no identity. A rule that a C# compiler would catch anyway does not belong here.

Methods (1)

Used by (5)

  • BinderTestsVixen.Ui.Markup.Tests
  • ComponentEmitterVixen.Ui.Markup
  • EmitterTestsVixen.Ui.Markup.Tests
  • VxmlGeneratorVixen.Ui.Markup.Generators
  • MarkupDocumentVixen.Editor.AssetEditors