Core PDML 2.0.0 Grammar

The table below shows the Core PDML grammar, presented in an EBNF-like format.

It covers only Core PDML, omitting PDML extensions (optional features) like comments, attributes etc.

This grammar definition serves as a supplementary resource, to contextualize the authoritative specification.

Core PDML Grammar

NameRuleExamples
PDML_document = tagged_node [root
  [child text]
]
more examples
tagged_node =   tagged_branch_node
| tagged_leaf_node
tagged_branch_node = "[" tag separator child_node + "]" [color orange]
[config [color orange]]
[div A [i [b nice]] dog]
tagged_leaf_node = "[" tag "]" [remark]
[hr]
tag = tag_char +
height
123
2025-01-29
Index_12-a.2
_
👆👆
品質
Net\sWeight
tag_char =   any Unicode code point, except
  \ [ ]
  {space} {tab} {new line} {carriage return}
  ^ ( ) = " ~ | : , ` ! $
  U+0000 to U+001F (included)
  U+0080 to U+009F (included)

| \\
| \[
| \]

| \s
| \t
| \n
| \r

| \^
| \(
| \)
| \=
| \"
| \~
| \|
| \:
| \,
| \`
| \!
| \$
a
Z
é

9
_
👆
\=
separator =   " "
| "\t"
| "\n"
| "\r\n"
child_node =   tagged_branch_node
| tagged_leaf_node
| untagged_text_leaf_node
[b [i huge]]
[remark]
All is well!
untagged_text_leaf_node
(aka text_leaf)
= text_char + Bob
3.14
We want simplicity.
ขอให้คุณโชคดี
root\\config\["port"\]
text_char =   any Unicode code point, except
  \ [ ]
  U+0000 to U+001F (included)
  U+0080 to U+009F (included)

| \\
| \[
| \]

| \s
| \t
| \n
| \r

| \^
| \(
| \)
| \=
| \"
| \~
| \|
| \:
| \,
| \`
| \!
| \$
a
Z
é

9
_
😀
\[
\n