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:
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.