Skip to content

Parsing complex expressions into a tree and getting the answer. Built with C++.

Notifications You must be signed in to change notification settings

ivo96/expression-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expression Parser

Top down parser for parsing expressions into abstract syntax tree for arithmetic expressions.

Following operators allowed

  • Numbers - Int only!(for now)
  • Normal Operators - +, -, *, /
  • If/Else - if('value' <|>|= 'value', 'whenTrue', 'whenFalse')
  • Braces - ()
  • Log - log(number, base)
  • Natural Logarithm - ln(number)

Example expression

98+if(log(56*3,32) > 98, 845*32,ln(37))

Prerequisites

You need to have g++ installed.

Installing

Clone repo

https://github.com/ivo96/expression-parser.git

Change permissions

chmod +x ./compile.bash

Compile

./compile.bash

Run the executable

./bin/calculator  

About

Parsing complex expressions into a tree and getting the answer. Built with C++.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published