Code generation

Top  Previous  Next

 

In the professional version of TextTransformer you can export source code for a c++ class of the created parser. TextTransformer produces all code, which is required for an independent executable program. The generated code can as well be used as a part of a larger application .

 

The use of the generated code has three advantages compared to the use of a project with the TextTransformer:

 

the program made with the code can be used independently from the TextTransformer
the program is faster
the semantic actions aren't restricted to the subset of the C++ instructions, which can be interpreted by the TextTransformer

 

In the introduction already was explained, that a production could be considered as a specification for the creation of o function. The generation of code now is the application of this specification, i.e. for each production an according function will be built.

 

The c++ code for the semantic actions is written into the generated code, according to the project option, simply by copying or by reconstruction. The code for the parser will be written at indicated positions in a code frame.

 

To compile a parser generated by the TextTransformer you need the library of regular expressions from Dr. Maddock and the some supporting C++ code:

 



This page belongs to the TextTransformer Documentation

Home  Content  German