aboutsummaryrefslogtreecommitdiff
path: root/src/manifest
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-03-12 14:23:01 +0100
committerCharles <sircharlesaze@gmail.com>2020-03-12 15:31:38 +0100
commit37e52bff39a1fe4d442cb253773252030c1cab8a (patch)
tree9942561e55e3a51947b87c6f35ac5181f3dff71c /src/manifest
parentdbbc2f6798ba77d2ea7d9cce91d3bd1879e467a2 (diff)
downloadcomputorv2-37e52bff39a1fe4d442cb253773252030c1cab8a.tar.gz
computorv2-37e52bff39a1fe4d442cb253773252030c1cab8a.tar.bz2
computorv2-37e52bff39a1fe4d442cb253773252030c1cab8a.zip
Basic expression parsing
Diffstat (limited to 'src/manifest')
-rw-r--r--src/manifest31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/manifest b/src/manifest
new file mode 100644
index 0000000..dc03948
--- /dev/null
+++ b/src/manifest
@@ -0,0 +1,31 @@
+Data struct:
+ - expression
+ - matrix
+ - complex
+
+ - polynomial
+
+State Data struct:
+ - function
+ - variable
+
+
+1. ( )
+2. ^
+3. * / % **
+4. + -
+
+expr ::= <term> (+ | -) <expr> | <term>
+term ::= <factor> (* | / | % | **)? <term> | <factor> -- default to '*'
+factor ::= <base> '^' <factor> | <base>
+base ::= '(' <expr> ')' | ( <real> | <imag> | <matrix> )
+
+imag ::= <expr> '*'? 'i'
+real ::= [0-9]+
+
+matrix ::= '[' (<line> ';')* ']'
+line ::= '[' (<expr> ',')* ']'
+
+func ::= [a-zA-Z]+ '(' <var> ')'
+var ::= [a-zA-Z]+
+endpoint ::= (<var> | <func>) '=' <expr>