Skip to content

Commit

Permalink
Fix more white-space irregularities
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Nov 4, 2020
1 parent 1a17c50 commit 8c8b322
Showing 1 changed file with 55 additions and 31 deletions.
86 changes: 55 additions & 31 deletions chapters/syntax.tex
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,28 @@ \subsection{Stored Definition -- Within}\label{stored-definition-within}
\subsection{Class Definition}\label{class-definition}
\begin{lstlisting}[language=grammar]
class-definition :
[ encapsulated ] class-prefixes
class-specifier
[ encapsulated ] class-prefixes class-specifier

class-prefixes :
[ partial ]
( class | model | [ operator ] record | block | [ expandable ] connector | type |
package | [ pure | impure ] [ operator ] function | operator )
( class
| model
| [ operator ] record
| block
| [ expandable ] connector
| type
| package
| [ pure | impure ] [ operator ] function
| operator
)

class-specifier :
long-class-specifier | short-class-specifier | der-class-specifier

long-class-specifier :
IDENT description-string composition end IDENT
| extends IDENT [ class-modification ] description-string composition
end IDENT
end IDENT

short-class-specifier :
IDENT "=" base-prefix type-specifier [ array-subscripts ]
Expand All @@ -111,16 +118,16 @@ \subsection{Class Definition}\label{class-definition}
base-prefix :
[ input | output ]

enum-list : enumeration-literal { "," enumeration-literal}
enum-list : enumeration-literal { "," enumeration-literal }

enumeration-literal : IDENT description

composition :
element-list
{ public element-list |
protected element-list |
equation-section |
algorithm-section
{ public element-list
| protected element-list
| equation-section
| algorithm-section
}
[ external [ language-specification ]
[ external-function-call ] [ annotation-clause ] ";" ]
Expand All @@ -137,17 +144,23 @@ \subsection{Class Definition}\label{class-definition}
{ element ";" }

element :
import-clause |
extends-clause |
[ redeclare ]
[ final ]
[ inner ] [ outer ]
( class-definition | component-clause |
replaceable ( class-definition | component-clause )
[ constraining-clause description ] )
import-clause
| extends-clause
| [ redeclare ]
[ final ]
[ inner ] [ outer ]
( class-definition
| component-clause
| replaceable ( class-definition | component-clause )
[ constraining-clause description ]
)

import-clause :
import ( IDENT "=" name | name [ ".*" | "." ( "*" | "{" import-list "}" ) ] ) description
import
( IDENT "=" name
| name [ ".*" | "." ( "*" | "{" import-list "}" ) ]
)
description

import-list :
IDENT { "," IDENT }
Expand All @@ -169,7 +182,8 @@ \subsection{Component Clause}\label{component-clause}

type-prefix :
[ flow | stream ]
[ discrete | parameter | constant ] [ input | output ]
[ discrete | parameter | constant ]
[ input | output ]

component-list :
component-declaration { "," component-declaration }
Expand Down Expand Up @@ -239,18 +253,21 @@ \subsection{Equations}\label{equations1}
| for-equation
| connect-clause
| when-equation
| component-reference function-call-args )
| component-reference function-call-args
)
description

statement :
( component-reference ( ":=" expression | function-call-args )
| "(" output-expression-list ")" ":=" component-reference function-call-args
| "(" output-expression-list ")" ":="
component-reference function-call-args
| break
| return
| if-statement
| for-statement
| while-statement
| when-statement )
| when-statement
)
description

if-equation :
Expand Down Expand Up @@ -286,7 +303,7 @@ \subsection{Equations}\label{equations1}
end for

for-indices :
for-index {"," for-index}
for-index { "," for-index }

for-index :
IDENT [ in expression ]
Expand All @@ -300,25 +317,29 @@ \subsection{Equations}\label{equations1}
when expression then
{ equation ";" }
{ elsewhen expression then
{ equation ";" } }
{ equation ";" }
}
end when

when-statement :
when expression then
{ statement ";" }
{ elsewhen expression then
{ statement ";" } }
{ statement ";" }
}
end when

connect-clause :
connect "(" component-reference "," component-reference ")"
\end{lstlisting}

\subsection{Expressions}\label{expressions1}
\begin{lstlisting}[language=grammar]
expression :
simple-expression
| if expression then expression { elseif expression then expression }
else expression
| if expression then expression
{ elseif expression then expression }
else expression

simple-expression :
logical-expression [ ":" logical-expression [ ":" logical-expression ] ]
Expand Down Expand Up @@ -365,11 +386,14 @@ \subsection{Expressions}\label{expressions1}
| "{" array-arguments "}"
| end

UNSIGNED-NUMBER : UNSIGNED-INTEGER | UNSIGNED-REAL
UNSIGNED-NUMBER :
UNSIGNED-INTEGER | UNSIGNED-REAL

type-specifier : ["."] name
type-specifier :
["."] name

name : IDENT { "." IDENT }
name :
IDENT { "." IDENT }

component-reference :
[ "." ] IDENT [ array-subscripts ] { "." IDENT [ array-subscripts ] }
Expand Down

0 comments on commit 8c8b322

Please sign in to comment.