Return type |
Top Previous Next |
Scripts > Productions > Input mask for a production > Return type
In the field return type a type identifier must be specified only for the case, that instructions of the semantic actions of the production return a value. Otherwise a procedure of the type void is created automatically.
By according bracketing it is possible to determine, whether a return type shall be used inside the interpreter or shall be written to the produced source code or both. For example, a string is returned inside the interpreter and a pointer is the return type of the produced source code, if you write the following:
{-str-} {_CToken*_}
Without brackets the project option for double braces "{{...}}" will be applied. It is important, that the parts of interpretable and exportable code keep coherently.
Only the interpretable code is type checked by the TextTransformer. Other code will simply be copied into the generated code and the c++ compiler then might find errors.
If a return type is defined in code only for the export a default value must be given. This can be done here by appending a slash and the value. E.g.::
{_ CProduktion* _}/NULL
|
This page belongs to the TextTransformer Documentation |
Home Content German |