Parsing System (v0.5)
Goldie Home (v0.5) -> GoldieLib Sample Apps -> Calculator Dynamic

Calculator Dynamic

A simple arithmetic calculator utilizing a calculator grammar. Demonstrates how to use Goldie's dynamic-style.

Calculator Dynamic Source Code

Sample run:

>goldie-calculatorDynamic Calculator Loading language...done! Enter an arithmetic expression ('exit' to exit) calculator>2+2*20 42.00000 calculator>(1-3) / 2 -1.00000 calculator>10 10.00000 calculator>12 {;[ 456 qwf (1:4): Syntax Error: '{;[' (1:12): Syntax Error: 'qwf' 2 Error(s) calculator>2 + * 7 (1:5): Unexpected *: '*' calculator>-10 * -20 200.00000 calculator>exit