Vixen
caa30e12
csharp
public sealed class SyntaxDomain

A language's inputs, mutated a syntax node at a time.

Read the guide page for this →

Remarks

One domain for both front ends, because they are the same tree. VXML and Raven each bring a grammar and nothing else — the green/red nodes, the trivia model and the printer all come from Vixen.Core.Syntax — so everything this needs is on SyntaxNode and neither language is named here. A third grammar on the same tree costs a parse delegate and a list of fragments.

⚠ The unit of mutation is a node; the edit is carried in the text, and that is a decision rather than a shortcut. Rewriting the tree itself is the obvious design and it does not survive contact with either front end: VXML has no public way to make a SyntaxToken at all, its generated Update returns a detached node with no parent, and its SyntaxRewriter cannot remove a list element — so a tree rewriter outside the assembly would be reduced to grafting whole subtrees anyway. Choosing the edit from the tree and applying it to the source text gets the same population of inputs with none of that, and it has two properties a rewriter would have had to work for: it needs no internals, and it carries trivia exactly, because a node's span already contains the author's whitespace and comments.

What matters is that the unit is grammatical. Replacing an element with an element, duplicating an attribute, deleting a statement — each produces something that lexes and mostly parses, which is the whole reason for the seam. Byte havoc gets a share of the budget anyway; see GarbageIn.

Fields and properties (2)

  • public const int MaxNodes

    How many nodes an edit is chosen from.

  • public override string What

    What is being mutated, in one line, for a report.

Methods (5)

Used by (2)

  • RavenTargetVixen.Fuzz
  • VxmlTargetVixen.Fuzz