From ecdac9bfa807be3ffe0c98971e09a340aa8b1516 Mon Sep 17 00:00:00 2001 From: Lauchmelder Date: Fri, 26 Nov 2021 22:41:52 +0100 Subject: [PATCH] added grammar to docs --- src/doc/syntax.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/doc/syntax.md b/src/doc/syntax.md index 14005e0..78a0092 100644 --- a/src/doc/syntax.md +++ b/src/doc/syntax.md @@ -13,4 +13,12 @@ circle(A, len(AB)) ## Primitives * `Point point(x, y)` is a 2D point. It returns an element of type `Point` * `Line line(Point from, Point to)` is a straight line. It returns an element of type `Line`. -* `Circle circle(Point center, radius)` draws a circle at `center` and `radius` \ No newline at end of file +* `Circle circle(Point center, radius)` draws a circle at `center` and `radius` + +## Grammar +``` +instruction ::= identifier({parameter, }) +parameter ::= instruction | identifier | number +identifier ::= (A-Za-z) +number ::= (0-9)[.(0-9)] +``` \ No newline at end of file