From 83965b82e8c64ce260cfcf334b1ef8e247c95ab8 Mon Sep 17 00:00:00 2001
From: Altareos <8584797+Altareos@users.noreply.github.com>
Date: Fri, 11 Mar 2022 12:39:52 +0100
Subject: [PATCH] doc syntax
---
doc/syntax.md | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 170 insertions(+)
create mode 100644 doc/syntax.md
diff --git a/doc/syntax.md b/doc/syntax.md
new file mode 100644
index 0000000..ad1ba0b
--- /dev/null
+++ b/doc/syntax.md
@@ -0,0 +1,170 @@
+# PL/XML Syntax
+
+Programs that do not respect this syntax may (and probably
+will) still work, but with no guarantee.
+
+## McKeeman Form
+
+```
+plxml
+ program
+
+program
+ "" functions main functions ""
+
+tag
+ '"' characters '"'
+
+characters
+ ''
+ character characters
+
+character
+ '0020' . '10FFFF' - '"' - '0027' - '<' - '>' - '&'
+ '&' escapes ';'
+
+ws
+ ""
+ '0020' ws
+ '000A' ws
+ '000D' ws
+ '0009' ws
+
+escapes
+ "quot"
+ "apos"
+ "lt"
+ "gt"
+ "amp"
+
+main
+ ws "" instructions "" ws
+
+functions
+ ""
+ function functions
+
+function
+ ws "" ws "" arguments "" ws "" instructions "" ws "" ws
+
+arguments
+ ""
+ argument arguments
+
+argument
+ ws "" ws
+
+instructions
+ ws "" ws
+ instruction instructions
+
+instruction
+ ws _instruction ws
+
+_instruction
+ value
+ assign
+ integer
+ float
+ string
+ array
+ add
+ subtract
+ multiply
+ divide
+ and
+ or
+ not
+ equal
+ greater
+ lower
+ call
+ return
+ if
+ for
+ each
+ while
+
+value
+ ""
+
+assign
+ "" instruction ""
+
+integer
+ ""
+ "" instruction ""
+
+float
+ ""
+ "" instruction ""
+
+string
+ ""
+ "" instruction ""
+
+array
+ "" instructions ""
+
+add
+ "" instructions ""
+
+subtract
+ "" instructions ""
+
+multiply
+ "" instructions ""
+
+divide
+ "" instructions ""
+
+and
+ "" instructions ""
+
+or
+ "" instructions ""
+
+not
+ "" instruction ""
+
+equal
+ "" instruction instruction ""
+
+greater
+ "" instruction instruction ""
+
+lower
+ "" instruction instruction ""
+
+call
+ "" ws "" instructions "" ws ""
+ "" instruction "" instructions "" ws ""
+
+return
+ "" instruction ""
+
+if
+ "" ws instruction ws "" instructions "" ws ""
+ "" ws instruction ws "" instructions "" ws "" instructions "" ws ""
+
+each
+ "" instruction do ""
+
+while
+ "" instruction do ""
+
+for
+ "" ws from to step do ""
+
+from
+ ws "" instruction "" ws
+
+to
+ ws "" instruction "" ws
+
+step
+ ws "" instruction "" ws
+
+do
+ ws "" instructions "" ws
+```
\ No newline at end of file