Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 11 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 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-23T18:43:03.000Z (7 months ago)
- Last Synced: 2024-06-23T19:50:38.062Z (7 months ago)
- Language: C
- Homepage:
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
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
make eval expr="1+2*3"
make eval expr="(1+2)*9+2"
#+END_SRC* TODO Functionality [5/7]
- [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 number support
- [X] Adding support for unary operators [1/2]
- [x] negate (-expression)
- [] prefix plus (+expression)
- [] Adding support for boolean operators[0/4]
- [] And(&)
- [] Or(|)
- [] Not(!)
- [] Xor(^)