Okay lets say I have a string such as this in a text file:
((( var1 AND var2 AND var3) OR var4) AND ((var5 OR var6) AND var7))
after parsin
I believe Lex and Yacc are still the best tools for simple parsing tasks like this.