i am not entirely sure what your issue is. what i gather is you having issues with "return on int", but you don't have to do you...
why not treat everything as a char? (assuming single digits)
sillyboy
Practically a Master Poster
686 posts since Mar 2007
Reputation Points: 85
Solved Threads: 64
why does it need to be int?
sillyboy
Practically a Master Poster
686 posts since Mar 2007
Reputation Points: 85
Solved Threads: 64
oh right now i see what you mean. it is similar to your exising recursion, just use different conditions. all you need to do is keep track of some counter.
sillyboy
Practically a Master Poster
686 posts since Mar 2007
Reputation Points: 85
Solved Threads: 64
from a quick glance i'd say your contructor isn't trimming the whitespaces correctly
sillyboy
Practically a Master Poster
686 posts since Mar 2007
Reputation Points: 85
Solved Threads: 64
that method is going to involve a bit of thought, and i am not feeling quite up for thinking it out completely. i think at the moment you haven't quite accounted for having child nodes which are expressions ("+", "-", ...). another thing that looks wrong is your return statement. i might have another look later when i have a clearer head.
sillyboy
Practically a Master Poster
686 posts since Mar 2007
Reputation Points: 85
Solved Threads: 64