Thursday, June 16, 2011

Announcing exprtreelib release

Today, after nearly two months of work, I am pleased to announce the release of Magnificalc's first and most essential component, exprtreelib! exprtreelib performs the following functions:
  • Parsing of expressions
  • Construction of expression trees
  • Representation of expressions as trees
exprtreelib consists of a main entry class: the ExpressionParser, and classes to represent parts of an expression, namely Expression, Term, and Factor. The following types of factor are supported:
  • Constant
  • Variable (with attached coefficient)
  • Function
  • Subexpression
All factors contain an associated exponent field, which is a factor itself.

An implementation of a symbol table using a Rudolf Bayer red-black tree (1972) is included in the library. The symbol table is a required argument to the isAbstract and evaluate methods of interface INode.

The parser is written with ANTLRv3, and the objects are written in Java. The unit tests are written with the ScalaTest BDD framework.

To get the source and compile it, visit the project site at http://moosna-saltlakecity.github.com/exprtreelib! Happy coding!

No comments:

Post a Comment