chickadee » abnf » define-bi-rule

(define-bi-rule TYPENAME CLAUSE ...)syntax

Generates a record type named TYPENAME, together with a matching bidirectional parser named bi-TYPENAME, from one declaration. Each CLAUSE should be of the form

 CLAUSE = (FIELDNAME BP)
        | BP

(FIELDNAME BP) becomes both a record field and a piece of the grammar; a bare BP with no name is matched and printed but not stored -- a fixed piece of syntax such as punctuation or a keyword. A clause is read as a named field only when it is written as a name next to a bare rule name; anything else, including a bare rule name on its own, is read as a fixed part.