Skip to content

Commit

Permalink
Fix misc formatting found by looking at remaining instances of {[}
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Apr 30, 2020
1 parent b6875bd commit 5196ece
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion chapters/arrays.tex
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ \section{Array Indexing}\doublelabel{array-indexing}
dimension index bounds (\autoref{array-dimension-lower-and-upper-index-bounds}). The indexing operator takes two or more
operands, where the first operand is the array to be indexed and the rest of the operands are index expressions:

arrayname{[}\emph{indexexpr1}, \emph{indexexpr2}, ...{]}
\lstinline[mathescape=true]!$\mathit{arrayname}$[$\mathit{indexexpr}_{1}$, $\mathit{indexexpr}_{2}$, $\ldots$]!

A colon is used to denote all indices of one dimension. A vector
expression can be used to pick out selected rows, columns and elements
Expand Down
24 changes: 12 additions & 12 deletions chapters/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ \section{Access Control -- Public and Protected Elements}\doublelabel{access-con
Members of a Modelica class can have two levels of visibility: \lstinline!public! or
\lstinline!protected!. The default is \lstinline!public! if nothing else is specified

A protected element, P, in classes and components may not be accessed
via dot notation (e.g., A.P, a.P, a{[}1{]}.P, a.b.P, .A.P; but there is
no restriction on using P or P.x for a protected element P). They may
not be modified or redeclared except for modifiers applied to protected
elements in a base-class modification (not inside any component or
class) and the modifier on the declaration of the protected element.
A protected element, \lstinline!P!, in classes and components may not be accessed via dot notation (e.g., \lstinline!A.P!, \lstinline!a.P!, \lstinline!a[1].P!, \lstinline!a.b.P!,
\lstinline!.A.P!; but there is no restriction on using \lstinline!P! or \lstinline!P.x! for a protected element \lstinline!P!). They may not be modified or redeclared except for
modifiers applied to protected elements in a base-class modification (not inside any component or class) and the modifier on the declaration of the protected element.

\begin{example}
\begin{lstlisting}[language=modelica]
Expand Down Expand Up @@ -1447,16 +1444,19 @@ \section{Predefined Types and Classes}\doublelabel{predefined-types-and-classes}
and \lstinline!y!. It is not possible to combine extends from the predefined types,
enumeration types, or this \lstinline!Clock! type with other components. The names
\lstinline!Real!, \lstinline!Integer!, \lstinline!Boolean! and \lstinline!String! are reserved such that it is illegal
to declare an element with these names. {[}Thus it is possible to define
a normal class called \lstinline!Clock! in a package and extend from it.{]} The
definitions use \lstinline!RealType!, \lstinline!IntegerType!,
\lstinline!BooleanType!, \lstinline!StringType!, \lstinline!EnumType!
as mnemonics corresponding to machine representations.
to declare an element with these names.

\begin{nonnormative}
Hence, it is possible to define a normal class called \lstinline!Clock! in a package and extend from it.
\end{nonnormative}

\begin{nonnormative}
Hence the only way to declare a subtype of e.g. \lstinline!Real! is to use the \lstinline!extends! mechanism.
It also follows that the only way to declare a subtype of e.g. \lstinline!Real! is to use the \lstinline!extends! mechanism.
\end{nonnormative}

The definitions use \lstinline!RealType!, \lstinline!IntegerType!, \lstinline!BooleanType!, \lstinline!StringType!, \lstinline!EnumType!
as mnemonics corresponding to machine representations.

\subsection{Real Type}\doublelabel{real-type}

The following is the predefined \lstinline!Real! type:
Expand Down
13 changes: 7 additions & 6 deletions chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ \subsection{Scalar Functions Applied to Array Arguments}\doublelabel{scalar-func
If the argument is not a foreach argument, it is used as-is.
\item
If the argument is a foreach argument, the element at index
{[}i,...,j{]} is used.
\lstinline[mathescape=true]![i, $\ldots$, j]! is used.
\end{itemize}
\end{enumerate}

Expand Down Expand Up @@ -2517,13 +2517,14 @@ \subsubsection{Utility Functions for Allocating Strings}\doublelabel{utility-fun
ModelicaAllocateString (e.g., to free this memory, when appropriate). It
is not allowed to access memory that was allocated with
\lstinline!ModelicaAllocateString! in a previous call of this external function.
{[}\emph{Memory that is not passed to the Modelica simulation
environment, such as memory that is freed before leaving the function,
or in an ExternalObject, see \autoref{external-objects}, should be allocated
with the standard C-mechanisms, like calloc(..)}{]}.

\begin{nonnormative}
The reason why one may not use, for instance, \lstinline!malloc! for string allocation is that a Modelica simulation environment may have
Memory that is not passed to the Modelica simulation environment, such as memory that is freed before leaving the function, or in an \lstinline!ExternalObject!,
see~\autoref{external-objects}, should be allocated with the standard C-mechanisms, like \lstinline[language=C]!calloc(..)!.
\end{nonnormative}

\begin{nonnormative}
The reason why one may not use, for instance, \lstinline[language=C]!malloc! for string allocation is that a Modelica simulation environment may have
its own allocation scheme, e.g., a special stack for local variables of a function.
\end{nonnormative}

Expand Down

0 comments on commit 5196ece

Please sign in to comment.