Skip to content

Commit b2ac6a3

Browse files
committed
Updated README
1 parent d6f8163 commit b2ac6a3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A simplistic expression evaluator in Go.
55
This is a research project.\
66
It is work in progress and right now in a very early stage.
77

8-
Check the tests in [`tree_test.go`](tree_test.go) for ideas of usage and capability, notably `TestTree_Eval*` tests.
8+
Check the tests for ideas of usage and capability.
99

1010
## Numbers
1111

@@ -42,4 +42,12 @@ Expressions are parsed in two stages:
4242
Notes:
4343

4444
- a Tree may contain one or more sub-Trees (recursively or not) to hold functions or to express associativity.
45-
- Calculation is performed in successive executions of by decreased operator precedence.
45+
- Calculation is performed in successive rounds of decreased operator precedence. This is to enforce natural associativity.
46+
47+
## Code structure
48+
49+
The main entry point is `Eval` in `gal.go`.
50+
51+
`Eval` instantiates a `TreeBuilder` optionally with configuration (notably to pass a map of variable names and values). It subsequently calls `TreeBuilder`'s `FromExpr` method to create a `Tree` from the expression to be evaluated.
52+
53+
Finally, `Tree`'s `Eval` method performs the evaluation of the `Tree` and returns the resultant `Value` to `gal.go`'s `Eval` function.

0 commit comments

Comments
 (0)