Files
sml-projects/fcore/parser/parser.md

577 B

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 ints in the grid int int **{** (item)+ **}** always follow the order: canvasWidth canvasHeight.

The large number of ints in the item always follows the order: x y ex ey r g b a.