This grammar is intentionally pragmatic for v0.1: it captures the surface syntax needed by the Core spec. It is suitable as the basis for a hand-written parser or parser-generator input after minor adaptation (token rules, whitespace/comment handling).
1) Lexical tokens (informative)
Implementations MUST support:
- Whitespace: spaces, tabs, newlines (ignored except as separators)
- Line comments:
// ...to end of line - Block comments:
/* ... */
Recommended tokens:
IDENT→[A-Za-z_][A-Za-z0-9_]*QNAME→IDENT ('.' IDENT)*STRING→"..."with escapesINT→ digits with optional_separatorsDECIMAL→ digits.digits with optional_DATE→YYYY-MMorYYYY-MM-DD
2) Grammar
The formal EBNF grammar is maintained as a standalone file for use with grammar tooling (railroad diagram generators, parser generators, etc.):
3) Notes & implementation guidance (informative)
- Line breaks are not significant; blocks and keywords provide structure.
money_litis syntactic sugar; implementations should normalize toMoneywithcurrency.DATEacceptsYYYY-MMandYYYY-MM-DD; normalizeYYYY-MMtoYYYY-MM-01during parsing.schedule_optsare order-independent; parsers should accept any order.activate contract/deactivate contractwere removed: a contract is a collection of streams, and one switch cannot express forbearance or an early termination. Gate the streams a contract produced by name, or withactive in state.- The event latch was removed. An event fires on each occurrence (rising edge), and a schedule clause supplies occurrences that
whenthen filters. There is nooncekeyword: once-ness is declared, as a singular schedule or a topology with no way back. Implementations MUST NOT carry a hidden "has fired" flag — the latch was memory living outside the machine, unjournaled and undeclarable. - Arrival actions are
seton entity-relative FIELD names only, neverstatus. Entry actions (on enter <state>) run before the taken edge's actions, and both run on every traversal — including one caused by a named event's status write.