yamlsketcher.md 6.4 KB

Content

YAML sketcher file grammar

Sketcher file EBNF Grammar is

Sketch::= Sketch_Name Parts
Sketch_Name::= "-" " " "name: " Identifier Comment? "\n"
Parts::= "-" " " "parts:\n" Comment? Part+
Part::= Part_Name Shapes
Part_Name::= INDENT "-" " " "name: " Identifier Comment? "\n" DEDENT
Shapes::= INDENT " " " " "shapes:\n" Comment? Shape+ DEDENT
Shape::= Simple | DoAction | SketchObject
Simple::= INDENT Identifier ":" PyRightHandExpression Comment? "\n" DEDENT
DoAction::= INDENT Identifier ":" Comment? "\n" Action DEDENT
Action::= INDENT "action:" PyExpression Comment? "\n" DEDENT 
Identifier::= [A-Za-z][_A-Za-z0-9]+
Comment::= "#" STRING

Here is the railroad grammar diagram:

Yaml Sketcher Definition