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 16 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 16 built-in grammars of GeneXproTools 4.0 as a starting point. As an illustration, you can take a look both at the C++ Math grammar and the Boolean VHDL All Gates grammar of GeneXproTools 4.0 by following the links, but all the 16 built-in grammars of GeneXproTools are accessible as xml files in the folder Grammars (usually C:\Program Files\GeneXproTools 4\Grammars). Then you just have to define correctly in this new programming language all the mathematical / logical functions used by GeneXproTools 4.0.

After its creation, the new grammar must be saved into an xml file. Then this file must be copied into the directory Grammars of GeneXproTools 4.0. After that you will 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.

Home | Contents | Previous | Next