I've been meaning to do this for my own use for a while and I have finally got a round tuit that allowed me to get on with it. Everyone should have a round tuit - they are so useful!

This is the recursive descent parser from my BasicLib library stripped down to deal with arithmetic functions only. Pass it a valid arithmetic expression as a string and it will return the result. Use a help viewer to see what is supported but basically it will evaluate any arithmetic expression that Basic4android can. It also supports variables that may be used to pass values and store intermediate results.

EDIT :- Version 1.1 has improved error reporting. See post #3 for details.

This is the recursive descent parser from my BasicLib library stripped down to deal with arithmetic functions only. Pass it a valid arithmetic expression as a string and it will return the result. Use a help viewer to see what is supported but basically it will evaluate any arithmetic expression that Basic4android can. It also supports variables that may be used to pass values and store intermediate results.

EDIT :- Version 1.1 has improved error reporting. See post #3 for details.

#### Attachments

Last edited: