Custom Formula Editor and Compiler
Name: A3 Software (
Industry: Financial Software
Description: A3 Software specializes in wide range of accounting and financial applications for a variety of
businesses. Their clients can range from a small office to a large company with its own IT department. The
company head office located in Barcelona, Spain.
The accounting and financial applications produced by A3 Software have to allow defining custom formulas in
order to customize the calculation due the high level "requirements" as well as the variations with regard to a
calculation and the customer profile variations. A3 Software decided to implement custom formula editor and
compiler components attempting to be as flexible and powerful as possible. That is, to make a simple formula
(adding two numbers) or to create a "small program".
A number of additional requirements were asked as follows:
Mandatory use of Microsoft Visual Studio.NET and a .NET component set that was previously developed
by A3 Software and has to be used in all their applications as a company policy
The formula editor component has to implement rich graphics environment in Web browser and has to
be the three-tiered application according to general A3 Software application architecture
The required components have to be integrated with a main run-time application that A3 Software
The custom formulas have to be able to process data in the common application database
Astrosoft already cooperated with A3 Software as software outsourcing services provider for .NET development.
Keeping in mind previous successful cooperation experience, solid Astrosoft's expertise in .NET area and unique
expertise in development of compilers, A3 Software asked Astrosoft to perform full-cycle development of
required software, including design, development, testing and maintenance phases as A3 Software provided
only general requirements specification on the formula compiler system interface, formula editor functionality,
and formula language definitions.
Addressing those requirements Astrosoft presented a solution that includes the following:
Design of detailed specification of the Formula language. This specification defines all language
features, lexical and syntactical conventions, and semantics of the language elements.
Formula compiler component that allows checking a specified formula to be valid, producing C# source
code of a specified formula and compiling it in run-time dll module, formatting a specified formula for
representing in the editor component.
Formula editor component that is a Web-based application with rich client functionality to edit
application formulas in convenient environment, keep them in application database, and compile
formulas for execution.
Formula source provider components that is intended to manage all operations to save and retrieve
formulas from application database.
Formula support component that is responsible for application data manipulations at run-time
The formula compiler component and the language specification were designed according to common rules of
compiler development. The formula compiler core engine uses formula grammar and implements all required
compilation parts as lexer, parser, semantic actions, lookup, type check and code generator. It also prepares
specific database select statements that are used at run-time environment to process data. The formula
compiler shell implements system interface allowing two-way integration of the compiler as .NET component to
any application including the formula editor.