liveBook · Manning

Problem

As explained in Building User-Friendly DSLs

A diagnostic indicating that domain-specific language content violates a constraint.

A problem is a diagnostic produced when domain-specific language content violates a constraint. The constraint checker reports each violation as an issue message, allowing domain experts to repair invalid AST content before later failures occur. section 9.0

Treat problems as part of a staged failure-prevention workflow:

  • Define a condition that must hold throughout the AST. section 9.0
  • Compute violations with issuesFor(astObject), returning issue messages as an array. section 9.2.2
  • Project the messages reactively near the affected language element, using markers, tooltips, or clickable indicators. section 9.2.2

Empty data-attribute name

For a Data Attribute, test whether settings["name"] is a non-empty string. If the test fails, return "An attribute must have a name"; the interface can show a warning marker and tooltip.

How Building User-Friendly DSLs covers it

How deep it goes
Defines constraints, implements issue collection, and integrates reactive presentation, while deferring broader generator strengthening and failure diagnosis.
Examples
Uses an empty Data Attribute name, a warning marker, a tooltip, and a non-empty-string validation helper.
What it assumes
Assumes AST objects and DSL concepts, while introducing constraint predicates, issue arrays, and their frontend integration.
What you can do after
Diagnose/debug with it by computing violated constraints and displaying repair-oriented messages beside affected DSL elements.
How it connects
Connects AST validation with constraints checkers, code generators, reactive projections, and domain IDE feedback.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building User-Friendly DSLs. The section links point to the parts of the book it draws on.