not really, for a syntax tree you would need an [OP, arg1, arg2] format.
this
["B", "'", "+", ["C", "*", "D"], "'"]]
doesn't help without further parsing because precedence is still not resolved.
Rather
[ "or", [ "not" , "B" ] , [ "not", [ "and", "C", "D"] ] ]
without recursive parsing hard to achieve, I just delegated the hard part to Perl, deliberately ignoring what the OP didn't tell us yet.
For instance if the = is not an assignment but a condition, he would want solutions for this equation system...
(which I could produce at least by brute force for small variable sets, if we had a guarantied format)
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
In reply to Re^3: Parsing Boolean expressions (hack)
by LanX
in thread Parsing Boolean expressions
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |