2424\newcommand {\unfinished }{\fixme {\ldots }}
2525
2626\newtheorem {defth}{Definition}[chapter]
27+ \newtheorem {example}{Example}[chapter]
2728
2829\newenvironment {Def}[1]{\begin {defth }[#1]\index {#1|textbf}}{\end {defth}}
2930
@@ -437,7 +438,7 @@ \subsection{A Modelica specification is needed}
437438
438439\subsection {Gaining experience with RML }
439440
440- The RML language and compiler were developed at IDA by Mikael
441+ The RML language and compiler were developed at PELAB by Mikael
441442Pettersson. They were new, and only a few language specifications had
442443yet been written using it. More experience with various language
443444specifications was desired to gain experience with its advantages and
@@ -455,7 +456,7 @@ \subsection{Natural semantics and equation-based\\ languages}
455456\section {Scope of the thesis }
456457\label {sec:scope }
457458
458-
459+ \unfinished
459460
460461\chapter {Development environment }
461462\label {cha:devenv }
@@ -482,14 +483,17 @@ \section{Parser}
482483the RML object files. The glue between the languages is a special RML
483484relation \code {parse}, which is implemented in C, rather than RML.
484485
485- The parser only builds an abstract syntax tree, and leaves the rest of
486- the transformation logic to the RML code. Therefore, the parser
487- itself is not further described in this report.
486+ The parser only builds an abstract syntax tree (AST) , and leaves the
487+ rest of the transformation logic to the RML code. Therefore, the
488+ parser itself is not further described in this report.
488489
489490The parser generator in PCCTS is powerful, but it has a few problems,
490491and is currently not maintained very actively. Because of problems
491492with error handlers, the translator does not deal very well with
492- syntax errors.
493+ syntax errors. If an error occurs while parsing, an error message
494+ will be printed, but the tranlator will try to translate the result of
495+ parsing anyway. Since the resulting AST will be severely broken, this
496+ will fail.
493497
494498\section {The report }
495499\label {sec:report }
@@ -542,7 +546,21 @@ \section{Terminology}
542546 appears inside a class definition.
543547\end {Def }
544548
545- \fixme {Example}
549+ \begin {example }
550+ The following class definition contains four elements. One
551+ \code {extends} statement, one class definition, and two class
552+ definitions. Note that the definitions of \code {width} and
553+ \code {height} are separate elements, but the grammar only needs one
554+ \code {element} rule to match them.
555+
556+ \begin {boxedverbatim }
557+ class C
558+ extends OtherClass;
559+ type Length = Real(unit = "m" );
560+ Length width, height;
561+ end C;
562+ \end {boxedverbatim }
563+ \end {example }
546564
547565\begin {Def }{Instantiation}
548566 The word \term {instantiate} is used in many language
@@ -556,24 +574,41 @@ \section{Terminology}
556574 modified by any given modifiers. This instance is not a run-time
557575 object that needs an allocated piece of memory, as in many dynamic
558576 object-oriented languages, but the principle is the same.
559-
577+
578+ For every component declaration in the class definition (possible
579+ inherited from another class definitions using an \code {extends}
580+ element), the component declarations class is also instantiated.
581+
560582 \fixme {Call this `` Component instantiation,'' and then define
561- `` type instantiation?'' }
583+ `` type instantiation?'' But what is that? }
562584\end {Def }
563585
564- \fixme {Example}
586+ \begin {example }
587+ The following Modelica example contains three class definitions. If
588+ the last one (\code {C}) is instantiated, it means that the class
589+ \code {B} needs to be instantiated twice to create the subcomponents
590+ \code {b1} and \code {b2}.
591+
592+ \begin {boxedverbatim }
593+ class B
594+ Real x;
595+ end B;
596+
597+ class C
598+ B b1,b2;
599+ end C;
600+ \end {boxedverbatim }
601+ \end {example }
565602
566603\begin {Def }{Component}
567604 The term \term {Component} refers to an class instance. Many
568- components are composed of several other components. \fixme {But it
569- is also used to refer to component declarations in class
570- definitions, right?}
605+ components are composed of several other components.
571606\end {Def }
572607
573608\begin {Def }{Immediate Subcomponent}
574- If component $ A$ is a structure which is composed from other
609+ If component $ A$ is a structure which is composed of other
575610 components, each of these components is an \term {immediate
576- subcomponent} of $ A$ .
611+ subcomponent} of $ A$ .
577612\end {Def }
578613
579614\begin {Def }{Subcomponent}
@@ -612,8 +647,9 @@ \subsection{Overview of the type system in Modelica}
612647 as one of the following:
613648
614649 \begin {enumerate }
615- \item A built-in type (\code {RealType}, \code {IntegerType},
616- \code {StringType} or \code {BooleanType}) \fixme {not exactly}
650+ \item A built-in type (Real, Integer, String or Boolean). These
651+ correspond to the Modelica predefined classes \code {RealType},
652+ \code {IntegerType}, \code {StringType} and \code {BooleanType}.
617653
618654 \item A structured type, containing a set of public components
619655 $ (N,T)$ , where $ N$ is an identifier and $ T$ is a type. No two
@@ -637,11 +673,14 @@ \subsection{Overview of the type system in Modelica}
637673 synonym for a two-dimensional array.
638674\end {Def }
639675
640- \fixme {Should we make a difference between incomplete and complete
641- types? Important for functions, where input arguments may be of
642- incomplete type.}
676+ \begin {Def }{Incomplete types}
677+ If a type includes an undefined array size, it is an
678+ \term {incomplete type}. If not, it is a \term {complete type}.
679+ \end {Def }
643680
644- \unfinished
681+ All components must have a complete type. All expressions also have
682+ complete types. Incomplete types only appear as the input argument
683+ types of function. \fixme {But nobody known how this actually works}
645684
646685\subsection {Type equivalence and subtypes }
647686\label {sec:typeq }
@@ -753,15 +792,22 @@ \subsection{Overloaded array operations}
753792
754793The exact meaning of multiplication where one or more of the operands
755794are arrays is currently being defined. Similarly for other
756- operations. The semantics specified here should be regarded as an
795+ operations. The semantics specified here should not be regarded as an
757796absolute reference to what these operations should mean, but rather as
758797a description of how the overloading of operators works.
759798
760799
761800\subsection {Collapsing arrays }
762801\label {sec:collaps }
763802
803+ \fixme {This won't be implemented anyway}
804+
805+
806+
807+ \section {Functions }
808+ \label {sec:functions }
764809
810+ \fixme {Who knows how functions work?}
765811
766812
767813\section {Connections }
0 commit comments