Skip to content

Math interpreter that supports postfix, prefix and infix notation.

Notifications You must be signed in to change notification settings

mmilunovic/raf-math-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Math Interpreter

This is a simple math interpreter written in python for Compiler Construction course at Faculty of Computer Science.

Feature

Math interpreter is capable of calculating math expressions in infix, postfix or prefix notation. It also supports variable initialization and usage, logical expressions as well as Roman numbers.

Example:

prefix --> + + 1 * 2 3 4 = 11

prefix --> + RIM(MCDXV) 66 = 1481

prefix --> > <= 334 RIM(MD) 4 = True


infix --> 4 * ( y = 5 + 8 * 6 ) / 7 = 30

infix --> 10 + RIM(XX) + hana = RIM(M) + 10 = 1040


postfix --> 1 2 + 3 4 + * = 21

postfix --> 70 hana 10 = / = 7

Usage

To try just run following commands.

git clone https://github.com/mmilunovic/raf-math-interpreter.git
cd raf-math-interpreter
python main.py

To change the type of notation just write infix, prefix of postfix and write expressions as you like.

About

Math interpreter that supports postfix, prefix and infix notation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages