1) If I wanted to answer SO questions, I'd answer questions at SO, not CP. Posting so multiple groups do the same work for you is a good way to get peoples backs up - and annoyed people are less likely to help you than happy ones.
2) If you have written a tokenizer, then you've done the donkey work already: now convert the tokens into a stack-based (RPN) form and evaluate them:
ln(x+(2+ln(x)))
Becomes
x 2 x ln + + ln
Now unwind the stack and it's easy to evaluate.
Converting infix to RPN (shunting-yard algorithm) | andreinc[
^]