Note: This DOES NOT apply the "NOT" operator. If someone has an idea on how to implement it and wants to do it, please do!
Simple logical expression parser and evaluator. It accepts this format:
"(...) operation (...)"
Examples
exp1 = "(a&b)|c"
exp2 = "(a>b)|(c&d)"
Given an expression, it'll ask for the values of each variable. Enter T, F or U as needed. It'll then evaluate the expression and print the result.
Here's more info and another examples of the parser (the latest 3 doesn't evaluate the expression). I took inspiration and got helped by the authors!
parser by iglosiggio (javascript)
parser by nsanmartin (Haskell)
And a few more. In the next days I will make a post talking about the similarities in the parsers. (e.g. only one implemented the "not" operator, why?)