неделя, 24 юли 2011 г.

ActionScript Expression Parsing

There are several usefull ActionScript libraries/packages available for mathematical expressions parsing:


There are some cases however, when we need custom parser. For those, who decide to implement their own parser and dig into the stuff, we provide our simple ActionScript implementation of an expression parser. The parser first splits the expression into tokens, and then scans them using recursive descent in order to build a parse tree. The tree could then be traversed in order to calculate the expression value or to transform it.

An example:






Source code: is available here.

Няма коментари:

Публикуване на коментар