Expand description
§SketchDDD Parser
Parser for the SketchDDD domain-specific language.
§Example
context Commerce {
objects { Customer, Order, LineItem, Product, Money }
morphisms {
placedBy: Order -> Customer
items: Order -> List<LineItem>
product: LineItem -> Product
price: LineItem -> Money
}
aggregate Order {
root: Order
contains: [LineItem]
invariant: totalPrice = sum(items.price)
}
value Money {
amount: Decimal
currency: Currency
}
enum OrderStatus = Pending | Confirmed | Shipped | Cancelled
}Structs§
- Aggregate
Decl - An aggregate declaration.
- Context
Decl - A context declaration.
- Context
MapDecl - A context map declaration.
- Enum
Decl - An enum declaration.
- Field
Decl - A field declaration.
- Invariant
Decl - An invariant declaration.
- Mapping
Decl - A mapping declaration in a context map.
- Morphism
Decl - A morphism declaration.
- Object
Decl - An object declaration.
- Parse
Error - Error that occurs during parsing.
- Span
- Source location for error reporting.
- Value
Object Decl - A value object declaration.
Enums§
- Type
Expr - A type expression.
Functions§
- parse
- Parse a SketchDDD source file.
- parse_
context - Parse a single context definition.