wood burning stoves 2.0*
The moose likes Java in General and the fly likes Evaluation of an expression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Evaluation of an expression" Watch "Evaluation of an expression" New topic
Author

Evaluation of an expression

A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Hi all,

I want a suggestion regarding this problem.

The user can enter an expression in the textbox..

At the server side I have to evaluate whether the expression entered by the

user is a valid expression....(infix/postfix/prefix)

Can u suggest me a solution for this..how should i go about this problem.

Thanks in advance.
ARKumar
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
Seems to me that is essentially the problem solved by a compiler so you should look for tutorials on compiler writing. To give you a start, you will need some way to recognize/distinguish between operators and operands.
Bill
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Evaluation of an expression