https://github.com/foufoujoujou/binary-expression-evaluator
A binary expression evaluator as test study for a pascal mini compiler
https://github.com/foufoujoujou/binary-expression-evaluator
Last synced: 9 days ago
JSON representation
A binary expression evaluator as test study for a pascal mini compiler
- Host: GitHub
- URL: https://github.com/foufoujoujou/binary-expression-evaluator
- Owner: FouFouJouJou
- License: bsd-3-clause
- Created: 2023-07-03T01:34:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-18T13:04:28.000Z (5 months ago)
- Last Synced: 2025-05-18T13:50:29.815Z (5 months ago)
- Language: C
- Homepage:
- Size: 74.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
#+TITLE: Binary expression evaluator in RAW C
** Description
An attempt to compile and run a binary expression for my mini pascal compiler project.
** Resouces
- [[https://web.stonehill.edu/compsci/CS104/Stuff/Infix%20and%20%20postfix%20expressions.pdf][Infix and postfix expressions]]
- [[https://en.wikipedia.org/wiki/Binary_expression_tree][Binary expression tree]]
** Instructions
*** To run the program with an expression passed as a command line argument:
#+BEGIN_SRC bash
mkdir
cd
cmake ..
make
./main help
#+END_SRC* TODO Functionality [8/9]
- [X] Help
- [X] Basic operation parsing[4/4]
- [X] +
- [X] -
- [X] /
- [X] *
- [X] Adding support for command line arguments
- [X] Adding support for parentheses
- [X] Building a binary expression tree from a postfix expression
- [X] Evaluating a binary expression tree
- [X] Implementing a small lexer for multi-digit integer support
- [X] Adding support for unary operators [0/1]
- [x] negate (-expression)
- [] prefix plus (+expression)
- [ ] Adding support for boolean operators[0/4]
- [ ] And(&)
- [ ] Or(|)
- [ ] Not(!)
- [ ] Xor(^)