-
Registered User
Calculator Parser
I wanna know how to go about making a calculator Parser.
I want the user to be able to input problems of different lenghts, but i dont know how to about breaking the problem into the parts.
Im thinking maybe store the problem in a string/char[] and then check everyting one by one.
Any ideas on how to do that, or other ideas about a parser?
Last edited by mrafcho001; 07-17-2005 at 11:31 AM.
-
Dump Truck Internet
well, I'm sure people disagree with me because your not trying to make an expandable large scale app, but to do it right you should look into context-free grammars
For a quick one, buf everythying, first search for * and /, your operators with greater precedence, get the operands on each side and perform the calculation, then go through + and - and do the same thing
Last edited by valis; 07-17-2005 at 11:41 AM.
Popular pages
Recent additions