From 940dfcaeb51a7fed96dd4dba91fcdab108ade9b9 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 22 Nov 2021 22:51:19 +0100 Subject: [PATCH 01/17] Local changes to sentence-based line breaking --- chapters/introduction.tex | 7 ++----- chapters/syntax.tex | 8 ++++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/chapters/introduction.tex b/chapters/introduction.tex index b53aea21c..9c912d523 100644 --- a/chapters/introduction.tex +++ b/chapters/introduction.tex @@ -103,10 +103,7 @@ \section{Notation and Grammar}\label{notation-and-grammar} The meta symbols (of the extended BNF-grammar) are defined in~\cref{lexical-conventions}. -Boldface denotes keywords of the Modelica language. Keywords are -reserved words and shall not be used as identifiers, with the exception of -\lstinline!initial! which is a keyword in section headings, and \lstinline!der! which is a -keyword for declaration functions, but it is also possible to call the -functions \lstinline!initial! and \lstinline!der!. +Boldface denotes keywords of the Modelica language. +Keywords are reserved words and shall not be used as identifiers, with the exception of \lstinline!initial! which is a keyword in section headings, and \lstinline!der! which is a keyword for declaration functions, but it is also possible to call the functions \lstinline!initial! and \lstinline!der!. See \cref{modelica-concrete-syntax} for a full lexical specification and grammar. diff --git a/chapters/syntax.tex b/chapters/syntax.tex index 5c2eedf04..7cac58259 100644 --- a/chapters/syntax.tex +++ b/chapters/syntax.tex @@ -64,11 +64,11 @@ \section{Lexical conventions}\label{lexical-conventions} Within a description-string the tags \lstinline!! and \lstinline!! or \lstinline!! and \lstinline!! define optionally begin and end of content that is HTML encoded. \end{nonnormative} \item - Boldface denotes keywords of the Modelica language. Keywords are - reserved words and shall not be used as identifiers. + Boldface denotes keywords of the Modelica language. + Keywords are reserved words and shall not be used as identifiers. \item - Productions use hyphen as separator both in the grammar and in the - text. Previously the grammar used underscore. + Productions use hyphen as separator both in the grammar and in the text. + Previously the grammar used underscore. \end{itemize} \section{Grammar}\label{grammar} From 31cf6cd2c1c8874c17474788b1ed1bbe21cc421b Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 22 Nov 2021 23:04:58 +0100 Subject: [PATCH 02/17] Fix missing cases of grammar inline code formatting --- chapters/syntax.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapters/syntax.tex b/chapters/syntax.tex index 7cac58259..2132bfa5d 100644 --- a/chapters/syntax.tex +++ b/chapters/syntax.tex @@ -57,11 +57,11 @@ \section{Lexical conventions}\label{lexical-conventions} Modelica uses the same comment syntax as C++ and Java (i.e., \lstinline!//! signals the start of a line comment and \lstinline!/* $\ldots$ */! is a multi-line comment); comments may contain any Unicode character. Modelica also has structured comments in the form of annotations and string comments. \item - Each description-string or string in annotations (= \lstinline[language=grammar]!STRING! with production annotation-clause in the grammar) may contain any member of the Unicode character set. + Each \lstinline[language=grammar]!description-string! or string in annotations (that is, a \lstinline[language=grammar]!STRING! with production \lstinline[language=grammar]!annotation-clause! in the grammar) may contain any member of the Unicode character set. All other strings have to contain only the subset of Unicode characters identical with the 7-bit US-ASCII character set. \begin{nonnormative} As a consequence, operators like `\lstinline!>!' or `\lstinline!! and \lstinline!! or \lstinline!! and \lstinline!! define optionally begin and end of content that is HTML encoded. + Within a \lstinline[language=grammar]!description-string! the tags \lstinline!! and \lstinline!! or \lstinline!! and \lstinline!! define optionally begin and end of content that is HTML encoded. \end{nonnormative} \item Boldface denotes keywords of the Modelica language. From 3f509809c9b8b516f69151e4ecf85484d21476e3 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 22 Nov 2021 23:05:19 +0100 Subject: [PATCH 03/17] Put statement about the past in parentheses --- chapters/syntax.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/syntax.tex b/chapters/syntax.tex index 2132bfa5d..fa7515dfc 100644 --- a/chapters/syntax.tex +++ b/chapters/syntax.tex @@ -68,7 +68,7 @@ \section{Lexical conventions}\label{lexical-conventions} Keywords are reserved words and shall not be used as identifiers. \item Productions use hyphen as separator both in the grammar and in the text. - Previously the grammar used underscore. + (Previously the grammar used underscore.) \end{itemize} \section{Grammar}\label{grammar} From 11c01e8ed71500bcac0a70705e080b13dd9162a5 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 22 Nov 2021 23:05:59 +0100 Subject: [PATCH 04/17] Be more vague about appearance of Modelica keywords in grammar --- chapters/syntax.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/syntax.tex b/chapters/syntax.tex index fa7515dfc..231b71960 100644 --- a/chapters/syntax.tex +++ b/chapters/syntax.tex @@ -64,7 +64,7 @@ \section{Lexical conventions}\label{lexical-conventions} Within a \lstinline[language=grammar]!description-string! the tags \lstinline!! and \lstinline!! or \lstinline!! and \lstinline!! define optionally begin and end of content that is HTML encoded. \end{nonnormative} \item - Boldface denotes keywords of the Modelica language. + In the grammar, keywords of the Modelica language are highlighted with color, for example, \lstinline[language=grammar]!equation!. Keywords are reserved words and shall not be used as identifiers. \item Productions use hyphen as separator both in the grammar and in the text. From 4cd107705f1e9a7168dc37536c3e613e50f89ade Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 22 Nov 2021 23:07:49 +0100 Subject: [PATCH 05/17] Remove redundant explanation of what a keyword is from grammar This belongs in chapter 'Lexical Structure'. --- chapters/syntax.tex | 1 - 1 file changed, 1 deletion(-) diff --git a/chapters/syntax.tex b/chapters/syntax.tex index 231b71960..f8b4cd012 100644 --- a/chapters/syntax.tex +++ b/chapters/syntax.tex @@ -65,7 +65,6 @@ \section{Lexical conventions}\label{lexical-conventions} \end{nonnormative} \item In the grammar, keywords of the Modelica language are highlighted with color, for example, \lstinline[language=grammar]!equation!. - Keywords are reserved words and shall not be used as identifiers. \item Productions use hyphen as separator both in the grammar and in the text. (Previously the grammar used underscore.) From 2789ee5bd254b44072d9f806835ae73e36397aca Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 22 Nov 2021 23:11:19 +0100 Subject: [PATCH 06/17] Be more vague about appearance of Modelica keywords in listings --- chapters/introduction.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/introduction.tex b/chapters/introduction.tex index 9c912d523..e05f7463e 100644 --- a/chapters/introduction.tex +++ b/chapters/introduction.tex @@ -103,7 +103,7 @@ \section{Notation and Grammar}\label{notation-and-grammar} The meta symbols (of the extended BNF-grammar) are defined in~\cref{lexical-conventions}. -Boldface denotes keywords of the Modelica language. +In Modelica code listings, keywords are highlighted with color and may come in both normal weight and boldface, for example, \lstinline!connect! and \lstinline!equation!. Keywords are reserved words and shall not be used as identifiers, with the exception of \lstinline!initial! which is a keyword in section headings, and \lstinline!der! which is a keyword for declaration functions, but it is also possible to call the functions \lstinline!initial! and \lstinline!der!. See \cref{modelica-concrete-syntax} for a full lexical specification and grammar. From cdc77b9c6e2d555933113b03401567ea1fce0a55 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 22 Nov 2021 23:11:19 +0100 Subject: [PATCH 07/17] Move explanation of what a keyword is to chapter 'Lexical Structure' Makes the introducing easier to digest, and places explanation where one would expect it. --- chapters/introduction.tex | 1 - chapters/lexicalstructure.tex | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/chapters/introduction.tex b/chapters/introduction.tex index e05f7463e..91349e67e 100644 --- a/chapters/introduction.tex +++ b/chapters/introduction.tex @@ -104,6 +104,5 @@ \section{Notation and Grammar}\label{notation-and-grammar} The meta symbols (of the extended BNF-grammar) are defined in~\cref{lexical-conventions}. In Modelica code listings, keywords are highlighted with color and may come in both normal weight and boldface, for example, \lstinline!connect! and \lstinline!equation!. -Keywords are reserved words and shall not be used as identifiers, with the exception of \lstinline!initial! which is a keyword in section headings, and \lstinline!der! which is a keyword for declaration functions, but it is also possible to call the functions \lstinline!initial! and \lstinline!der!. See \cref{modelica-concrete-syntax} for a full lexical specification and grammar. diff --git a/chapters/lexicalstructure.tex b/chapters/lexicalstructure.tex index 134ab1e56..1ae4493f7 100644 --- a/chapters/lexicalstructure.tex +++ b/chapters/lexicalstructure.tex @@ -108,7 +108,7 @@ \subsection{Names}\label{names} \subsection{Modelica Keywords}\label{modelica-keywords} -The following Modelica \firstuse{keywords}\index{keyword} are reserved words and shall not be used as identifiers, except as listed in \cref{lexical-conventions}: +The following Modelica \firstuse{keywords}\index{keyword} are reserved words and shall not be used as identifiers, with the exception of \lstinline!initial! which is a keyword in section headings, and \lstinline!der! which is a keyword for declaration functions, but it is also possible to call the functions \lstinline!initial! and \lstinline!der!: \begin{center} \begin{tabular}{l l l l l} \lstinline!algorithm! & \lstinline!discrete! & \lstinline!false! & \lstinline!loop! & \lstinline!pure!\\ \hline From df5bcba0e1301b58c0b50fd28e71c727ddeb3469 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 22 Nov 2021 23:11:19 +0100 Subject: [PATCH 08/17] Remove keyword exceptions These exceptions are just confusing as the grammar actually allows both 'der' and 'initial' (and also 'pure') to be used as the callee of a function call expression. --- chapters/lexicalstructure.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/lexicalstructure.tex b/chapters/lexicalstructure.tex index 1ae4493f7..043d773f4 100644 --- a/chapters/lexicalstructure.tex +++ b/chapters/lexicalstructure.tex @@ -108,7 +108,7 @@ \subsection{Names}\label{names} \subsection{Modelica Keywords}\label{modelica-keywords} -The following Modelica \firstuse{keywords}\index{keyword} are reserved words and shall not be used as identifiers, with the exception of \lstinline!initial! which is a keyword in section headings, and \lstinline!der! which is a keyword for declaration functions, but it is also possible to call the functions \lstinline!initial! and \lstinline!der!: +The following Modelica \firstuse{keywords}\index{keyword} are reserved words and shall not be used as identifiers: \begin{center} \begin{tabular}{l l l l l} \lstinline!algorithm! & \lstinline!discrete! & \lstinline!false! & \lstinline!loop! & \lstinline!pure!\\ \hline From ed4573dc5fe61073c346e1f2a6cbd53c38520dd2 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 22 Nov 2021 23:34:27 +0100 Subject: [PATCH 09/17] Describe appearance of recognized names --- chapters/introduction.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chapters/introduction.tex b/chapters/introduction.tex index 91349e67e..dbebb4936 100644 --- a/chapters/introduction.tex +++ b/chapters/introduction.tex @@ -104,5 +104,7 @@ \section{Notation and Grammar}\label{notation-and-grammar} The meta symbols (of the extended BNF-grammar) are defined in~\cref{lexical-conventions}. In Modelica code listings, keywords are highlighted with color and may come in both normal weight and boldface, for example, \lstinline!connect! and \lstinline!equation!. +There are also certain recognized names with special meaning defined by the specification, highlighted with another color, for example, \lstinline!semiLinear!. +% No need to describe appearance of comments, right? See \cref{modelica-concrete-syntax} for a full lexical specification and grammar. From 5cf9e1656b3c0e78e66fe177e0125650b460aacf Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 22 Nov 2021 23:42:47 +0100 Subject: [PATCH 10/17] Describe appearance of Modelica before grammar According to decreasing order of importance for readers. --- chapters/introduction.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapters/introduction.tex b/chapters/introduction.tex index dbebb4936..e1ff6d424 100644 --- a/chapters/introduction.tex +++ b/chapters/introduction.tex @@ -101,10 +101,10 @@ \section{Some Definitions}\label{some-definitions} \section{Notation and Grammar}\label{notation-and-grammar} -The meta symbols (of the extended BNF-grammar) are defined in~\cref{lexical-conventions}. - In Modelica code listings, keywords are highlighted with color and may come in both normal weight and boldface, for example, \lstinline!connect! and \lstinline!equation!. There are also certain recognized names with special meaning defined by the specification, highlighted with another color, for example, \lstinline!semiLinear!. % No need to describe appearance of comments, right? +The meta symbols of the extended BNF-grammar are defined in~\cref{lexical-conventions}. + See \cref{modelica-concrete-syntax} for a full lexical specification and grammar. From 1de18f9d07e29a3796d128ef993f204b9f83327e Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 22 Nov 2021 23:43:39 +0100 Subject: [PATCH 11/17] Remove link from introduction to chapter 'Modelica Concrete Syntax' In the introduction, it's better to just focus on notation. --- chapters/introduction.tex | 4 +--- chapters/revisions.tex | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/chapters/introduction.tex b/chapters/introduction.tex index e1ff6d424..0404121a9 100644 --- a/chapters/introduction.tex +++ b/chapters/introduction.tex @@ -99,12 +99,10 @@ \section{Some Definitions}\label{some-definitions} % - quality of implementation % - simulator -\section{Notation and Grammar}\label{notation-and-grammar} +\section{Notation}\label{notation} In Modelica code listings, keywords are highlighted with color and may come in both normal weight and boldface, for example, \lstinline!connect! and \lstinline!equation!. There are also certain recognized names with special meaning defined by the specification, highlighted with another color, for example, \lstinline!semiLinear!. % No need to describe appearance of comments, right? The meta symbols of the extended BNF-grammar are defined in~\cref{lexical-conventions}. - -See \cref{modelica-concrete-syntax} for a full lexical specification and grammar. diff --git a/chapters/revisions.tex b/chapters/revisions.tex index 8caa12f1f..b31b99fd1 100644 --- a/chapters/revisions.tex +++ b/chapters/revisions.tex @@ -453,8 +453,8 @@ \subsection{Main changes in Modelica 3.4}\label{main-changes-in-modelica-3-4} Clarified structural analysis, \cref{scope-of-the-specification}. Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/588}{\#588}. \item - Clarified meta-symbols, \cref{notation-and-grammar} and 2.3.1. Ticket - \href{https://github.com/modelica/ModelicaSpecification/issues/1616}{\#1616}. + Clarified meta-symbols, \cref{notation} and 2.3.1. + Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/1616}{\#1616}. \item Typo, \cref{identifiers}. Ticket \href{https://github.com/modelica/ModelicaSpecification/issues/1702}{\#1702}. From 125a9c0c2babc39318ffddabda87afdc1e83addd Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Tue, 23 Nov 2021 22:03:54 +0100 Subject: [PATCH 12/17] Local changes to sentence-based line breaking --- chapters/annotations.tex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chapters/annotations.tex b/chapters/annotations.tex index 381919d3f..27433a34b 100644 --- a/chapters/annotations.tex +++ b/chapters/annotations.tex @@ -55,7 +55,10 @@ \subsection{Class Description and Revision History}\label{annotation-info-revisi The \lstinline!revisions! documentation may be omitted in printed documentation. \end{nonnormative} -If the string starts with the tag \lstinline!! or \lstinline!! the entire string is HTML encoded (and is assumed to end with \lstinline!! or \lstinline!! and shall be rendered as HTML even if the end-tags are missing), otherwise the entire string is rendered as is. The HTML encoded content may contain links. For external links, see \cref{external-resources}. Links to Modelica classes may be defined with the HTML link command using scheme \lstinline!Modelica! (using its lower case form in the URI, see \cref{external-resources}), e.g., +If the string starts with the tag \lstinline!! or \lstinline!! the entire string is HTML encoded (and is assumed to end with \lstinline!! or \lstinline!! and shall be rendered as HTML even if the end-tags are missing), otherwise the entire string is rendered as is. +The HTML encoded content may contain links. +For external links, see \cref{external-resources}. +Links to Modelica classes may be defined with the HTML link command using scheme \lstinline!Modelica! (using its lower case form in the URI, see \cref{external-resources}), e.g., \begin{lstlisting}[language=modelica] MultiBody.Tutorial \end{lstlisting} From 3af5ab72376062a866845b4f04d1dc7301bea4ce Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Tue, 23 Nov 2021 22:23:08 +0100 Subject: [PATCH 13/17] Move two sentences out of 'Some Definitions' in introduction --- chapters/introduction.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chapters/introduction.tex b/chapters/introduction.tex index 0404121a9..283ad75fc 100644 --- a/chapters/introduction.tex +++ b/chapters/introduction.tex @@ -12,6 +12,7 @@ \section{Scope of the Specification}\label{scope-of-the-specification} The semantics of the Modelica language is specified by means of a set of rules for translating any class described in the Modelica language to a flat Modelica structure. +The semantic specification should be read together with the Modelica grammar. A class (of specialized class \lstinline!model!, \lstinline!class! or \lstinline!block!) intended to be simulated on its own is called a \firstuse{simulation model}\index{simulation model}. @@ -75,8 +76,6 @@ \section{Scope of the Specification}\label{scope-of-the-specification} \section{Some Definitions}\label{some-definitions} -The semantic specification should be read together with the Modelica grammar. -Non-normative text, i.e., examples and comments, are enclosed in {[}\ldots{]} and set in italics. Explanations of many terms can be found using the document index in \cref{document-index}. Some important terms are defined below. @@ -101,6 +100,8 @@ \section{Some Definitions}\label{some-definitions} \section{Notation}\label{notation} +Non-normative text, i.e., examples and comments, are enclosed in {[}\ldots{]} and set in italics. + In Modelica code listings, keywords are highlighted with color and may come in both normal weight and boldface, for example, \lstinline!connect! and \lstinline!equation!. There are also certain recognized names with special meaning defined by the specification, highlighted with another color, for example, \lstinline!semiLinear!. % No need to describe appearance of comments, right? From 670c76c9da427ff78b0b701e9ee36a4a218ca246 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 29 Nov 2021 00:43:14 +0100 Subject: [PATCH 14/17] Introduce notation by example --- chapters/introduction.tex | 62 +++++++++++++++++++++++++++++++++++---- chapters/syntax.tex | 2 +- 2 files changed, 57 insertions(+), 7 deletions(-) diff --git a/chapters/introduction.tex b/chapters/introduction.tex index 283ad75fc..00cdd8b40 100644 --- a/chapters/introduction.tex +++ b/chapters/introduction.tex @@ -100,10 +100,60 @@ \section{Some Definitions}\label{some-definitions} \section{Notation}\label{notation} -Non-normative text, i.e., examples and comments, are enclosed in {[}\ldots{]} and set in italics. - -In Modelica code listings, keywords are highlighted with color and may come in both normal weight and boldface, for example, \lstinline!connect! and \lstinline!equation!. -There are also certain recognized names with special meaning defined by the specification, highlighted with another color, for example, \lstinline!semiLinear!. -% No need to describe appearance of comments, right? +The remainder of this section shows examples of the presentation used in this document. + +Syntax highlighting of Modelica code is illustrated by the code listing below. +Things to note include keywords that define code structure such as \lstinline!equation!, keywords that do not define code structure such as \lstinline!connect!, and recognized identifiers with meaning defined by the specification such as \lstinline!semiLinear!: +\begin{lstlisting}[language=modelica] +model Example "Example used to illustrate syntax highlighting" + /* The string above is a class description string, this is a comment. */ +//String s = 1.0; /* Commenting out invalid code like this is rare. */ + /* Instead of commenting-out invalid code, it is typically done this way: */ + String s = 1.0; // Error: No conversion form Real to String. + Real x; +equation + 2 * x = semiLinear(time - 0.5, 2, 3); + /* The annotation below has omitted details represented by an ellipsis: */ + connect(resistor.n, conductor.p) annotation($\ldots$); +end Example; +\end{lstlisting} + +Relying on implicit conversion of \lstinline!Integer! literals to \lstinline!Real! is common, as seen in the equation above (note use of Modelica code appearing inline in the text). + +It is common to mix Modelica code with mathematical notation. +For example, \lstinline!average($x$, $y$)! could be defined as $\frac{x + y}{2}$. + +\begin{definition}[Something]% Do not add this one to the inde! +Text defining the meaning of \emph{something}. +\end{definition} -The meta symbols of the extended BNF-grammar are defined in~\cref{lexical-conventions}. +In addition to the style of definition above, new terminology can be introduced in the running text. +% TODO: Switch to \firstuse[---]{dummy} below. For now, using \willintroduce to avoid risk of accidentally +% creating index entry in the future. +For example, a \willintroduce{dummy} is something that\ldots + +\begin{nonnormative} +This is non-normative content that provides some explanation, motivation, and/or additional things to keep in mind. +It has no defining power and may be skipped by readers strictly interested in just the definition of the Modelica language. +\end{nonnormative} + +\begin{example} +This is an example, which is a special kind of non-normative content. +Examples often contain a mix of code listings and explanatory text, and this is no exception: +\begin{lstlisting}[language=modelica] +String s = 1.0; // Error: No conversion form Real to String. +\end{lstlisting} +To fix the type mismatch above, the number has to be replaced by a \lstinline!String! expression, such as \lstinline!"1.0"!. +\end{example} + +Other code listings in the document include specification of lexical units and grammatical structure, both using metasymbols of the extended BNF-grammar defined in~\cref{lexical-conventions}. +Lexical units are named with all upper-case letters and introduced with the `\lstinline[language=grammar]!=!' sign: +\begin{lstlisting}[language=grammar] +SOME-TOKEN = NON-DIGIT { DIGIT | NON-DIGIT } +\end{lstlisting} +Grammatical structure is recognized by production rules being named with lower-case letters and introduced with the `\lstinline[language=grammar]!:!' sign (also note appearance of the Modelica keyword \lstinline!der!): +\begin{lstlisting}[language=grammar] +differentiated-expression : + der "(" SOME-TOKEN ")" + | "(" differentiated-expression "+" differentiated-expression ")" +\end{lstlisting} diff --git a/chapters/syntax.tex b/chapters/syntax.tex index f8b4cd012..809beb0a8 100644 --- a/chapters/syntax.tex +++ b/chapters/syntax.tex @@ -2,7 +2,7 @@ \chapter{Modelica Concrete Syntax}\label{modelica-concrete-syntax} \section{Lexical conventions}\label{lexical-conventions} -The following syntactic meta symbols are used (extended BNF): +The following syntactic metasymbols are used (extended BNF): \begin{center} \begin{tabular}{c l} \hline From 811ea8bfc93840898ad2f8d1b745e9aa151d1abb Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Tue, 30 Nov 2021 22:23:20 +0100 Subject: [PATCH 15/17] Fix typo 'inde' -> 'index' Addressing commend by Hans. --- chapters/introduction.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/introduction.tex b/chapters/introduction.tex index 00cdd8b40..97c4fbed0 100644 --- a/chapters/introduction.tex +++ b/chapters/introduction.tex @@ -123,7 +123,7 @@ \section{Notation}\label{notation} It is common to mix Modelica code with mathematical notation. For example, \lstinline!average($x$, $y$)! could be defined as $\frac{x + y}{2}$. -\begin{definition}[Something]% Do not add this one to the inde! +\begin{definition}[Something]% Do not add this one to the index! Text defining the meaning of \emph{something}. \end{definition} From 6ff7d9bdc46ee113a494e2225291727cd98e265d Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Tue, 30 Nov 2021 22:27:10 +0100 Subject: [PATCH 16/17] Simplify examples of invalid code As suggested by Hans. Co-authored-by: Hans Olsson --- chapters/introduction.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chapters/introduction.tex b/chapters/introduction.tex index 97c4fbed0..9a25456d8 100644 --- a/chapters/introduction.tex +++ b/chapters/introduction.tex @@ -107,8 +107,7 @@ \section{Notation}\label{notation} \begin{lstlisting}[language=modelica] model Example "Example used to illustrate syntax highlighting" /* The string above is a class description string, this is a comment. */ -//String s = 1.0; /* Commenting out invalid code like this is rare. */ - /* Instead of commenting-out invalid code, it is typically done this way: */ + /* Invalid code is typically done this way: */ String s = 1.0; // Error: No conversion form Real to String. Real x; equation From a61ab15821979ccc0b922b3e48d21af7e2be4430 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Tue, 30 Nov 2021 22:29:38 +0100 Subject: [PATCH 17/17] Rephrase 'done this way' -> 'presented like this' Saying we 'do' invalid code sounded a bit too informal. --- chapters/introduction.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/introduction.tex b/chapters/introduction.tex index 9a25456d8..65799ae26 100644 --- a/chapters/introduction.tex +++ b/chapters/introduction.tex @@ -107,7 +107,7 @@ \section{Notation}\label{notation} \begin{lstlisting}[language=modelica] model Example "Example used to illustrate syntax highlighting" /* The string above is a class description string, this is a comment. */ - /* Invalid code is typically done this way: */ + /* Invalid code is typically presented like this: */ String s = 1.0; // Error: No conversion form Real to String. Real x; equation