Skip to content

Commit

Permalink
Move non-normative motivation for package to start of chapter,
Browse files Browse the repository at this point in the history
and move up most definitions as discussed.
  • Loading branch information
HansOlsson committed Sep 9, 2020
1 parent fc393b5 commit 69de9dc
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions chapters/packages.tex
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
\chapter{Packages}\label{packages}

\section{Package as Specialized Class}\label{package-as-specialized-class}

The package concept is a specialized class (\cref{specialized-classes}), using the
keyword \lstinline!package!.

\section{Motivation and Usage of Packages}\label{motivation-and-usage-of-packages}

\begin{nonnormative}
\label{motivation-and-usage-of-packages}
Packages in Modelica may contain definitions of constants and
classes including all kinds of specialized classes, functions, and
subpackages. By the term subpackage we mean that the package is declared
Expand Down Expand Up @@ -40,9 +32,12 @@ \section{Motivation and Usage of Packages}\label{motivation-and-usage-of-package
standard mapping of package names to storage places, typically file or
directory locations in the file system.
\end{itemize}
\end{nonnormative}
\section{Package as Specialized Class}\label{package-as-specialized-class}

The package concept is a specialized class (\cref{specialized-classes}), using the
keyword \lstinline!package!.

\subsection{Importing Definitions from a Package}\label{importing-definitions-from-a-package}
\section{Importing Definitions from a Package}\label{importing-definitions-from-a-package}

The import-clause makes public classes and other public definitions
declared in some package available for use by shorter names in a class
Expand Down Expand Up @@ -85,7 +80,7 @@ \subsection{Importing Definitions from a Package}\label{importing-definitions-fr
Here $\mathit{packagename}$ is the fully qualified name of the imported package including possible dot notation and $\mathit{definitionname}$ is the name of an element in a package. The multiple definition import is equivalent
to multiple single definition imports with corresponding $\mathit{packagename}$ and definition names.

\subsubsection{Lookup of Imported Names}\label{lookup-of-imported-names}
\subsection{Lookup of Imported Names}\label{lookup-of-imported-names}

This section only defines how the imported name is looked up in the import clause. For lookup in general -- including how import clauses are used -- see \cref{static-name-lookup}.

Expand Down Expand Up @@ -114,7 +109,7 @@ \subsubsection{Lookup of Imported Names}\label{lookup-of-imported-names}
\end{lstlisting}
\end{nonnormative}

\subsubsection{Summary of Rules for Import Clauses}\label{summary-of-rules-for-import-clauses}
\subsection{Summary of Rules for Import Clauses}\label{summary-of-rules-for-import-clauses}

The following rules apply to import-clauses:
\begin{itemize}
Expand All @@ -137,7 +132,7 @@ \subsubsection{Summary of Rules for Import Clauses}\label{summary-of-rules-for-i
Multiple qualified import-clauses may not have the same import name.
\end{itemize}

\subsection{Mapping Package/Class Structures to a Hierarchical File System}\label{mapping-package-class-structures-to-a-hierarchical-file-system}
\section{Mapping Package/Class Structures to a Hierarchical File System}\label{mapping-package-class-structures-to-a-hierarchical-file-system}

Packages/classes may be represented in the hierarchical structure of the
operating system (the file system). For classes with version
Expand All @@ -162,7 +157,7 @@ \subsection{Mapping Package/Class Structures to a Hierarchical File System}\labe
Tools may also store classes in data-base systems, but that is not standardized.
\end{nonnormative}

\subsubsection{Mapping a Package/Class Hierarchy into a Directory Hierarchy (Structured Entity)}\label{mapping-a-package-class-hierarchy-into-a-directory-hierarchy-structured-entity}
\subsection{Mapping a Package/Class Hierarchy into a Directory Hierarchy (Structured Entity)}\label{mapping-a-package-class-hierarchy-into-a-directory-hierarchy-structured-entity}

A directory shall contain a node, the file \filename{package.mo}. The node shall contain a stored-definition that defines a class \lstinline!A! with a name
matching the name of the structured entity.
Expand Down Expand Up @@ -195,7 +190,7 @@ \subsubsection{Mapping a Package/Class Hierarchy into a Directory Hierarchy (Str
\filename{package.mo} (this ensures that the relative order between classes and
constants stored in different ways is preserved).

\subsubsection{Mapping a Package/Class Hierarchy into a Single File (Nonstructured Entity)}\label{mapping-a-package-class-hierarchy-into-a-single-file-nonstructured-entity}
\subsection{Mapping a Package/Class Hierarchy into a Single File (Nonstructured Entity)}\label{mapping-a-package-class-hierarchy-into-a-single-file-nonstructured-entity}

When mapping a package or class-hierarchy to a file (e.g.\ the file \filename{A.mo}), that file shall only define a single class \lstinline!A! with a
name matching the name of the nonstructured entity. In a file hierarchy the files shall have the extension \filename{.mo}.
Expand All @@ -204,7 +199,7 @@ \subsubsection{Mapping a Package/Class Hierarchy into a Single File (Nonstructur
to file-structure and it is an error if it is loaded from the
\lstinline!MODELICAPATH!.

\subsubsection{The within Clause}\label{the-within-clause}
\subsection{The within Clause}\label{the-within-clause}

A within-clause has the following syntax:
\begin{lstlisting}[language=grammar]
Expand All @@ -230,7 +225,7 @@ \subsubsection{The within Clause}\label{the-within-clause}
\end{lstlisting}
\end{example}

\subsection{External resources}\label{external-resources}
\section{External resources}\label{external-resources}

In order to reference external resources from documentation (such as
links and images in html-text) and/or to reference images in the Bitmap
Expand Down Expand Up @@ -285,7 +280,7 @@ \subsection{External resources}\label{external-resources}
resource than \filename{modelica://Modelica/C.jpg}.
\end{example}

\subsection{The Modelica Library Path -- MODELICAPATH}\label{the-modelica-library-path-modelicapath}
\section{The Modelica Library Path -- MODELICAPATH}\label{the-modelica-library-path-modelicapath}

The top-level scope implicitly contains a number of classes stored
externally. If a top-level name is not found at global scope, a Modelica
Expand Down Expand Up @@ -314,7 +309,7 @@ \subsection{The Modelica Library Path -- MODELICAPATH}\label{the-modelica-librar
fails without searching for \lstinline!A! in any of the remaining roots in \lstinline!MODELICAPATH!.
\end{nonnormative}

\subsubsection{Example of Searching MODELICAPATH}\label{example-of-searching-modelicapath}
\subsection{Example of Searching MODELICAPATH}\label{example-of-searching-modelicapath}

If during lookup a top-level name is not found in the unnamed top-level
scope, the search continues in the package hierarchies stored in these
Expand Down

0 comments on commit 69de9dc

Please sign in to comment.