Jump to content
  • Advertisement
Sign in to follow this  
jissyvarghese15

[web] mathematical expression evaluation

This topic is 3837 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

helo, i hav confusion in evalution of mathematical expression like 3*4+2/2-2. i need an asp program for text parser like that. i have to get an answer after evaluation like 11 set precedence *,/,+,- pls write to me

Share this post


Link to post
Share on other sites
Advertisement
Quote:
precedence *,/,+,-


That's the normal precedence in all programming languages I work with. Are you saying this isn't the precedence in ASP? Hard to believe, but if it is not, switch to a better programming language.

Share this post


Link to post
Share on other sites
I beleive the OP wants to write his own expression parser in ASP. You could take a look at the first few chapters of Lets Build a Compiler by Jack Crenshaw, that goes through developing a simple compiler, starting with expression evaluation.
If your using ASP.NET I think you could use antlr (I see no reason why not). I think there is a tutorial on the site which goes through developing a grammar for expression evaluation.

Hope that answers the qustion :/.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!