Hey guys!
I'm trying to build a program that will evaluate boolean expressions. For example:
a>(b>(a^b)) or maybe ¬a>(a^b).
It doesn't really matter if you know boolean logic or not since i'm ok doing the calculations. The only part i'm struggling with is parsing the formula. I need to read in a formula entered into the command line and then split it into it's subformals. For the first example, the subformals would be:
b>(a^b)
a^b
a
b
These values, including the original formula, will then be stored in an array but for the life of me i can't get it to work. I've played around with stringTokenizer but very quickly realized that wasn't going to be of much use and i've also had a go with stream Tokenizer and attempted recursive descent parsing but to no avail. Any help will be much appreciated.
The_Kermit 0 Newbie Poster
brianlevine 17 Light Poster
The_Kermit 0 Newbie Poster
brianlevine 17 Light Poster
The_Kermit 0 Newbie Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
The_Kermit 0 Newbie Poster
brianlevine 17 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.