Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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(^)