diff --git a/chapters/functions.tex b/chapters/functions.tex index 1a3bb85c6..dabefc5a5 100644 --- a/chapters/functions.tex +++ b/chapters/functions.tex @@ -1881,10 +1881,17 @@ \section{Function Inlining and Event Generation}\label{function-inlining-and-eve "GenerateEvents" "=" ( false | true ) \end{lstlisting}\end{synopsis} \begin{semantics} -Has only an effect within a function declaration +Has only an effect within a function declaration. + +By default, \lstinline!GenerateEvents = false! and expressions in the function body that would normally be event-generating shall not generate events, similar to inlining the function body while wrapping all expressions in \lstinline!noEvent!, see \cref{modelica:noEvent}. +By specifying \lstinline!GenerateEvents = true!, event-generating expressions in the function body shall generate events as normal, similar to inlining the function body without wrapping all expressions in \lstinline!noEvent!. +Having \lstinline!GenerateEvents = true! implies \lstinline!Inline = true! unless overridden by specifying one of the inlining annotations with value \lstinline!true! (in particular, \lstinline!GenerateEvents = true! cannot be combined with \lstinline!Inline = false!). -If \lstinline!GenerateEvents = true!, the model developer proposes that crossing functions in the function should generate events (one possibility of doing this is to inline the function and generate events for the inlined function). +\begin{nonnormative} +In case a given inlining annotation proposes to inline at a stage when the tool cannot process \lstinline!GenerateEvents = true!, it is recommended to give a diagnostic and instead perform inlining of the function at the nearest stage where \lstinline!GenerateEvents = true! can still be respected. +If the function is called in a context where events will not be generated (e.g., inside another function without \lstinline!GenerateEvents = true!) no special action is needed. +\end{nonnormative} \end{semantics} \end{annotationdefinition}