Parsing strings to System.Linq.Expression
The example included with the last post is probably a bit underwhelming, so I thought I’d include another.
This variation on the “good old calculator example” takes a string input like 1 + 2 * (3 + 4)
and produces an equivalent System.Linq.Expression
that can be executed to get the numeric value.
You can also play around with the very minimal included error handling abilities.
Check out the code for the parser and the driver program.