Skip to content

Commit

Permalink
Add some missing language=grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Dec 2, 2020
1 parent edb4eb0 commit f7497c9
Showing 1 changed file with 11 additions and 22 deletions.
33 changes: 11 additions & 22 deletions chapters/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,11 @@ \subsection{Syntax and Examples of Component Declarations}\label{syntax-and-exam
\end{lstlisting}

\begin{nonnormative}
The declaration of a component states the type, access,
variability, data flow, and other properties of the component. A
\lstinline!component-clause! i.e., the whole declaration, contains type
prefixes followed by a \lstinline!type-specifier! with optional
\lstinline!array-subscripts! followed by a \lstinline!component-list!.

There is no semantic difference between variables declared in a
single declaration or in multiple declarations. For example, regard the
following single declaration (\lstinline!component-clause!) of two matrix
variables:
The declaration of a component states the type, access, variability, data flow, and other properties of the component.
A \lstinline[language=grammar]!component-clause! i.e., the whole declaration, contains type prefixes followed by a \lstinline[language=grammar]!type-specifier! with optional \lstinline[language=grammar]!array-subscripts! followed by a \lstinline[language=grammar]!component-list!.

There is no semantic difference between variables declared in a single declaration or in multiple declarations.
For example, regard the following single declaration (\lstinline[language=grammar]!component-clause!) of two matrix variables:
\begin{lstlisting}[language=modelica]
Real[2,2] A, B;
\end{lstlisting}
Expand All @@ -158,21 +153,15 @@ \subsection{Syntax and Examples of Component Declarations}\label{syntax-and-exam

\subsection{Component Declaration Static Semantics}\label{component-declaration-static-semantics}

If the \lstinline!type-specifier! of the component declaration denotes a built-in
type (\lstinline!RealType!, \lstinline!IntegerType!, etc.), the flattened or instantiated
component has the same type.

If the \lstinline!type-specifier! of the component does not denote a built-in type,
the name of the type is looked up (\cref{static-name-lookup}). The found type is
flattened with a new environment and the partially flattened enclosing
class of the component. It is an error if the type is partial in a
simulation model, or if a simulation model itself is partial. The new
environment is the result of merging
If the \lstinline[language=grammar]!type-specifier! of the component declaration denotes a built-in type (\lstinline!RealType!, \lstinline!IntegerType!, etc.), the flattened or instantiated component has the same type.

If the \lstinline[language=grammar]!type-specifier! of the component does not denote a built-in type, the name of the type is looked up (\cref{static-name-lookup}).
The found type is flattened with a new environment and the partially flattened enclosing class of the component.
It is an error if the type is partial in a simulation model, or if a simulation model itself is partial.
The new environment is the result of merging
\begin{itemize}
\item
the modification of enclosing class element-modification with the same
name as the component
the modification of enclosing class element-modification with the same name as the component
\item
the modification of the component declaration
\end{itemize}
Expand Down

0 comments on commit f7497c9

Please sign in to comment.