in reply to Re^2: Parsing Boolean expressions (hack)
in thread Parsing Boolean expressions
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!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Parsing Boolean expressions (hack)
by Anonymous Monk on Apr 23, 2017 at 16:00 UTC | |
by LanX (Saint) on Apr 23, 2017 at 16:04 UTC | |
by Anonymous Monk on Apr 23, 2017 at 16:28 UTC | |
by LanX (Saint) on Apr 23, 2017 at 16:40 UTC | |
by Anonymous Monk on Apr 23, 2017 at 18:01 UTC |