| YamDocument | ::= | ( Title )? ( Sep )* ( Unit )* <EOF> |
| Sep | ::= | <sep> |
| Title | ::= | ( <sp> )* Text ( Sep Text )* |
| Text | ::= | ( Word ( <sp> )* )+ |
| Verbatim | ::= | <verbStart> ( <verbEscape> | <verbAny> )* <verbEnd> ( ( <sp> | Sep ) )* |
| Word | ::= | ( Escape | TargetControl | Plain | Hr | Url | Anchor | Br | Nbsp | Predicate | Control ) |
| Escape | ::= | <escape> |
| Plain | ::= | ( <plain> )+ |
| Control | ::= | ( <bold> | <tt> | <it> | <under> | <quote> ) |
| TargetControl | ::= | ( <amp> | <lt> ) |
| Hr | ::= | ( <hr> ) |
| Url | ::= | ( <urlPercentStart> <urlBodyToRrbrOrComma> ( <urlRrbr> | <urlText> <urlRrbr> ) | <urlPlainStart> <urlBodyToSpace> ) |
| Anchor | ::= | <anchorStart> <anchorBody> |
| Br | ::= | <br> |
| Nbsp | ::= | <nbsp> |
| Unit | ::= | ( SectionHead | Contents | Paragraph | List | Table | Verbatim ) ( Sep )* |
| SectionHead | ::= | <sectionLevel> ( SectionText )? |
| SectionText | ::= | ( <sp> )* Text ( Sep Text )* |
| Paragraph | ::= | Text ( Sep Text )* |
| List | ::= | ( ( ( <listItemStart> ( TextOrTable )? ( Sep TextOrTable )* ) ) )+ |
| OList | ::= | <dummy> |
| UList | ::= | <dummy> |
| Table | ::= | <tableStart> ( Row ( <tableRowStart> Row )* )? ( Sep )* <tableEnd> ( Whsp )* |
| Row | ::= | ( ( ( ( Text )* | ( Text ) ( Unit ) ( Text ) | ( Unit )* ) TableSep ) )+ |
| TableSep | ::= | <tableSep> |
| Whsp | ::= | <sp> |
| Contents | ::= | <contents> |
| Predicate | ::= | <predStart> ( ( <predArg> | <predArgSep> <predArg> ) )* <predEnd> |
| TextOrTable | ::= | ( Table | Text )+ |