This project implements a post-fix notation calculator for Boolean algebra using Flex and Bison. The calculator can evaluate Boolean expressions using the values TRUE and FALSE and the operators AND, OR, NOT, and XOR.
- Accepts both capital and lower-case letters for TRUE and FALSE.
- Supports the operators & (AND), | (OR), ! (NOT), and XOR (exclusive OR).
- Input can be provided through keyboard and calculations are performed when Enter is pressed.
- Program exits on the end-of-file character (CTRL+d).
To compile and run the calculator:
- Compile using Flex and Bison with the provided
boolcalc.l
andboolcalc.y
files. - Run the generated executable.
- Input the Boolean expression in post-fix notation and press Enter to evaluate.
INPUT: TRUE FALSE &
OUTPUT: FALSE
INPUT: true false xor
OUTPUT: TRUE
INPUT: TRUE!
OUTPUT: FALSE
INPUT: tRuE FaLsE & ! fAlSe |
OUTPUT: TRUE
This project is licensed under the MIT License. See the LICENSE file for more details.