An invalid abstract syntax tree (AST) violates one or more constraints of its domain-specific language. It may arise during incomplete editing, software defects, storage corruption, or DSL version changes. section 9.1
Invalid ASTs should generally remain representable outside the DSL editor. Editing is often incomplete, and preventing persistence would force domain experts to finish content before they could save or share it for repair. section 9.1
Common reasons an AST becomes invalid include:
- Incomplete DSL content while a domain expert is still editing. section 9.1
- Bugs in the DSL editor or serialized AST storage that corrupt the representation. section 9.1
- Migration to a new DSL version whose constraints differ from the previous version. section 9.1
A DSL editor should ideally let domain experts repair corruption. When that fails, developers may need to correct the serialized JSON representation. Invalid ASTs can cause the generator, build step, or runtime to fail or produce meaningless results. section 9.1
