design: Remove requirement for magic bytes in PDL file

This commit is contained in:
Sasha Koshka 2025-06-05 20:28:23 -04:00
parent 0ed55bcbc2
commit bb5fc89cc5

View File

@ -43,7 +43,6 @@ structures. They are separated by whitespace.
| Name | Syntax | Description
| -------- | ------------------ | -----------
| Magic | `PDL/0` | Must appear at the very start of the file.
| Method | `M[0-9A-Fa-f]{4}` | A 16-bit hexadecimal method code.
| Key | `[0-9A-Fa-f]{4}` | A 16-bit hexadecimal table key.
| Ident | `[A-Z][A-Za-z0-9]` | An identifier.
@ -55,8 +54,6 @@ structures. They are separated by whitespace.
## Syntax
All files must begin with a Magic token.
Types are expressed with an Ident. A table can be used by either writing the
name of the type (Table), or by defining a schema with curly braces. Arrays must
be expressed using two matching square brackets before their element type.
@ -73,8 +70,6 @@ can be anything.
Here is an example of all that:
```
PDL/0
M0000 Connect {
0000 Name String,
0001 Password String,
@ -96,8 +91,7 @@ User {
Below is an EBNF description of the language.
```
<file> -> <magic> (<message> | <typedef)*
<magic> -> "PDL/0"
<file> -> (<message> | <typedef)*
<method> -> /M[0-9A-Fa-f]{4}/
<key> -> /[0-9A-Fa-f]{4}/
<ident> -> /[A-Z][A-Za-z0-9]/