Login   Register  
PHP Classes
elePHPant
Icontem

Expressions: Parse, convert and evaluate math expressions

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (9)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2012-07-08 (2 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 304 This week: 1All time: 6,529 This week: 1,545Up
Version License PHP version Categories  
expressions 1.0BSD License5.0Algorithms, PHP 5, Math
Description Author  

This package can parse, convert and evaluate math expressions.

There is a convertor class that can parse a string with a math expression with infix format (operators in the middle of the operands) to postfix format (operators after operands), as well to expression tree of objects.

An evaluator class can evaluate a math expression from a postfix string or expression or an expression tree of objects.

Currently the evaluation supports addition, subtraction, multiplication and division of integer operator numbers, as well parenthesis to group expressions to be evaluated first.

Picture of Alex Dan
Name: Alex Dan <contact>
Classes: 1 package by
Country: Romania Romania
Age: ???
All time rank: 337173 in Romania Romania
Week rank: 1141 Up26 in Romania Romania Up

  Files folder image Files  
File Role Description
Files folder imageConfig (2 files)
Files folder imageLib (1 file, 1 directory)
Accessible without login Plain text file main.php Example Expression Example script

  Files folder image Files  /  Config  
File Role Description
  Accessible without login Plain text file config.php Conf. Expression Example config file
  Accessible without login Plain text file load.php Aux. Expression Example autoload file

  Files folder image Files  /  Lib  
File Role Description
Files folder imageExpression (5 files)
  Accessible without login Plain text file functions.php Aux. Expression Example functions file

  Files folder image Files  /  Lib  /  Expression  
File Role Description
  Plain text file Convertor.php Class Expression Example Convertor class
  Plain text file Evaluator.php Class Expression Example Evaluator class
  Plain text file Exception.php Class Expression Example Exception class
  Plain text file Tree.php Class Expression Example Tree class
  Plain text file TreeNode.php Class Expression Example TreeNode class

 Version Control Unique User Downloads Download Rankings  
 0%Total:304All time:6,529
 This week:1This week:1,545Up