aboutsummaryrefslogtreecommitdiff
path: root/src/manifest
blob: dc0394848b3ed11b6d423ddcf262241929ac686b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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>