summaryrefslogtreecommitdiff
path: root/exprparser/design.mdwn
blob: 84ddef3aa59f6a1acfb72bdf0dc44e6a1dcd7ea9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Expression parser for Canopied

Expressions are simple (for now):

    expr ::= <term> "+" <expr>
           | <term> "-" <expr>
           | <term>

    term ::= <factor> "*" <term>
           | <factor> "/" <term>
           | <factor>

    factor ::= "(" <expr> ")"
             | <const>

    <const> ::= integer | floatynumber

We will use Nom, and construct an expression parse tree as our output.