Generating Code Automatically

User Defined Grammars
 
GeneXproTools 4.0 allows you to design User Defined Grammars so that the models evolved by GeneXproTools in its native Karva language can be automatically translated into the programming language of your choice if you happen to prefer a programming language not already covered by the eight built-in grammars of GeneXproTools 4.0 (Ada, C, C++, C#, Fortran, Java, Java Script, Matlab, Pascal, Perl, PHP, Python, Visual Basic, VB.Net, Verilog, and VHDL).

GeneXproTools 4.0 allows you to define as many grammars as you wish. The design of an extra grammar in GeneXproTools 4.0 is very easy, since it can be done by using one of the eight built-in grammars of GeneXproTools 4.0 as a starting point. As an illustration, the C++ grammar of GeneXproTools 4.0 is shown here. Then you just have to define correctly in this new language all the mathematical functions and rules used by GeneXproTools 4.0.

After a new grammar is created, it must be saved into a xml file. Then this file must be copied into the directory Grammars of GeneXproTools 4.0. After that you’ll be able to translate all the models evolved by GeneXproTools 4.0 into this new language.

To translate your model into this new language, on the GeneXproTools modeling environment, select the Model Panel, and then, on the Language list box, select the name you gave to your new language.

The code created with this new language can then be copied to the clipboard or saved to disk.

Previous  | Next