%opt and %nopt statements (SDL script)
This topic applies to TDK SDL script extensions. For more information, see
Overview of SDL script extensions for TDK (SDL script).
SDL Script Extensions for TDK:
%string AString = "class "
AString %opt " " %nopt %c:Name " {\n"
%opt specifies the following "free text" expressions will be appended into the output if they are not present, that is, the current output buffer does not already terminate with the same expression.
In the above example, %opt " " does not append anything because the output generated by AString already terminates with a blank.
%nopt resumes the normal operations, that is, subsequent expressions are generated regardless of whether they are in the output or not.