Skip to content

A binary expression evaluator as test study for a pascal mini compiler

License

Notifications You must be signed in to change notification settings

FouFouJouJou/binary-expression-evaluator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binary expression evaluator in RAW C

Description

An attempt to compile and run a binary expression for my mini pascal compiler project.

Resouces

Instructions

To run the program with an expression passed as a command line argument:

make eval expr="1+2*3"
make eval expr="(1+2)*9+2"

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

About

A binary expression evaluator as test study for a pascal mini compiler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published