design: Remove requirement for magic bytes in PDL file
This commit is contained in:
parent
0ed55bcbc2
commit
bb5fc89cc5
@ -43,7 +43,6 @@ structures. They are separated by whitespace.
|
|||||||
|
|
||||||
| Name | Syntax | Description
|
| 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.
|
| 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.
|
| Key | `[0-9A-Fa-f]{4}` | A 16-bit hexadecimal table key.
|
||||||
| Ident | `[A-Z][A-Za-z0-9]` | An identifier.
|
| Ident | `[A-Z][A-Za-z0-9]` | An identifier.
|
||||||
@ -55,8 +54,6 @@ structures. They are separated by whitespace.
|
|||||||
|
|
||||||
## Syntax
|
## Syntax
|
||||||
|
|
||||||
All files must begin with a Magic token.
|
|
||||||
|
|
||||||
Types are expressed with an Ident. A table can be used by either writing the
|
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
|
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.
|
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:
|
Here is an example of all that:
|
||||||
|
|
||||||
```
|
```
|
||||||
PDL/0
|
|
||||||
|
|
||||||
M0000 Connect {
|
M0000 Connect {
|
||||||
0000 Name String,
|
0000 Name String,
|
||||||
0001 Password String,
|
0001 Password String,
|
||||||
@ -96,8 +91,7 @@ User {
|
|||||||
Below is an EBNF description of the language.
|
Below is an EBNF description of the language.
|
||||||
|
|
||||||
```
|
```
|
||||||
<file> -> <magic> (<message> | <typedef)*
|
<file> -> (<message> | <typedef)*
|
||||||
<magic> -> "PDL/0"
|
|
||||||
<method> -> /M[0-9A-Fa-f]{4}/
|
<method> -> /M[0-9A-Fa-f]{4}/
|
||||||
<key> -> /[0-9A-Fa-f]{4}/
|
<key> -> /[0-9A-Fa-f]{4}/
|
||||||
<ident> -> /[A-Z][A-Za-z0-9]/
|
<ident> -> /[A-Z][A-Za-z0-9]/
|
||||||
|
Loading…
Reference in New Issue
Block a user