Add 'dotscape/' from commit 'f306501a68a51b634e895c5fdac70788ae899d75'
git-subtree-dir: dotscape git-subtree-mainline:6b91d64fc3git-subtree-split:f306501a68
This commit is contained in:
21
dotscape/fcore/parser/parser.md
Normal file
21
dotscape/fcore/parser/parser.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Parsing
|
||||
|
||||
The parsing functionality is for saving and loading from a custom file format.
|
||||
|
||||
The BNF for the custom file format is below.
|
||||
|
||||
Terminals are surrounded by `**` to the left and right. (rule)+ means "1 or more".
|
||||
|
||||
```
|
||||
int ::= (0-9)+
|
||||
|
||||
item ::= **{** int int int int int int int int **}**
|
||||
|
||||
layer ::= **[** item **]**
|
||||
|
||||
layer_tree ::= int int **{** (layer)* **}**
|
||||
```
|
||||
|
||||
The first two `int`s in the `layer_tree` always follow the order: `canvasWidth canvasHeight`.
|
||||
|
||||
The large number of `int`s in the `item` always follow the order: `x y ex ey r g b a`.
|
||||
Reference in New Issue
Block a user