Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Notation

This reference uses a BNF dialect for grammar productions. The notation is intentionally close to the Rust Reference so readers familiar with Rust documentation can read it without a separate primer.

Grammar productions

A production has the form LHS ::= RHS, where the right-hand side is a sequence of terminals, non-terminals, and meta-operators. Productions are written in text-tagged code blocks:

EventDecl ::= 'evt' ident carriers? ':' (stmt | '{' stmt* '}')
carriers  ::= carrier_group+
carrier_group ::= '.' '|' param (',' param)* '|'
param     ::= ident ':' type

Meta-operators

FormMeaning
'literal'A literal token (keyword, symbol). Matches verbatim.
identAn identifier: an ASCII letter or _, then letters, digits or _, and not a reserved keyword.
UIdentAn ident whose first character is an uppercase ASCII letter (UpperCamelCase); process names and references.
UPPER_IDENTAn ident written in upper case by convention (constants such as SLOT_SIZE); the parser accepts any ident.
X?Zero or one of X.
X*Zero or more of X.
X+One or more of X.
X | YEither X or Y. Listed alternatives appear on separate lines for readability when the disjunction is long.
(X Y)Grouping; otherwise meta-operators bind tighter than juxtaposition.

Literals in a production are named by their lexical class (the lexical structure has the full rules):

NameMatches
int_litA decimal integer (42); digits only, no _ separators.
hex / hex_lit0x then hex digits; _ may separate them (0xFE00_0000).
bool_lit / bool_literaltrue or false.
string_literal / text_literal"..." of printable ASCII, with the escapes \\, \", \n and \t.

Comments inside a production start with --; examples, which are Fiducia source, use the language’s own // and /* */.

Whitespace between symbols in a production is significant only when called out — most productions allow inter-token whitespace and comments, exactly as the lexer does.

Inline references

  • A non-terminal in prose is written in italics (e.g. event, process).
  • A literal token in prose is written in backticks (e.g. evt, ->).
  • A type-level reference into the AST uses backticks plus the Rust path fragment when it disambiguates (Event::CPEvent, Process::Choice { branches, default }).

Examples

Examples render in text-tagged code blocks, not rust-tagged: the Fiducia source language is not Rust, and text keeps mdBook’s syntax-highlighter neutral. Example:

evt handle_irq:
    eth.handle_irq();

Where an example references symbols declared elsewhere (a channel from the .fis file, a function from an imported .c file, a process declared in the same section), the surrounding prose names the dependency.

Stability markers

A construct flagged with the 🚧 marker is not yet implemented by the parser. The form appears in the reference because it is part of the designed grammar, but the parser will reject it today:

🚧 Not yet implemented.