Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calculator

The project is created for testing the Interpreter design pattern and practicing text tokenization mechanisms.

It works like this:

The solved example is passed to the TokenArray object as a string. The syntax of the string is simple: one space should be left before and after each digit or symbol. At the moment, tokenization and invocation of Interpreter pattern resources occur in this class.

Available operations:

+

-

*

/

As an example:

If you need to calculate (2+45-13+56-88+5+2)

$returnSum = new TokenArray("2 + 45 - 13 * 56 - 88 / 5 + 2");

echo $returnSum->getRez(); //-696.6

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages