Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@123 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
- Loading branch information
x97davka
committed
Feb 9, 1998
1 parent
25e7be4
commit 8ecce83
Showing
3 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Lite designbeslut: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
Semantik-noteringar -*- outline -*- | ||
|
||
* redeclare extends | ||
|
||
Vad betyder "redeclare extends ..." | ||
|
||
* Typer i ekvationer | ||
|
||
Vilka variabler f�r man ha i ekvationer? Bara Real(Type) och | ||
Integer(type)? Exakt hur fungerar connect()? | ||
|
||
* connect | ||
|
||
Sista raden i connect-semantiken (B.2) m�ste vara fel. | ||
|
||
* Kvalificerade identifierare | ||
|
||
Vilka olika saker kan foo vara i "foo.bar"? | ||
|
||
** En variabel (eller konstant) i scopet | ||
|
||
module Resistor | ||
Pin p,n; | ||
parameter Real r; | ||
equation | ||
p.i = n.i; | ||
(p.v - n.v) = p.i * r; | ||
end Resistor; | ||
|
||
** En klass i scopet | ||
|
||
Klassen kommer ofta att vara ett package. | ||
|
||
package Foo | ||
constant Real x = 17.0; | ||
end Foo; | ||
|
||
model Bar | ||
Real y = Foo.x; | ||
end Bar; | ||
|
||
Men t.ex. i specialiseringar kan det vara vanligt med andra klasser. | ||
|
||
model Foo | ||
|
||
type Bar | ||
constant Real x = 17.0; | ||
end Bar; | ||
|
||
Bar b; | ||
end Foo; | ||
|
||
model Baz | ||
extends Foo(Bar.x = 4711.0); | ||
end Baz; | ||
|
||
** Ett package i en fil "foo.mdc" | ||
|
||
module Foo | ||
Modelica.SIunit.Area a; | ||
end Foo; | ||
|
||
* Hur funkar = i deklarationer | ||
|
||
Om man deklarerar | ||
|
||
model M | ||
Foo x = y; | ||
end M; | ||
|
||
�r det samma sak som: | ||
|
||
model M | ||
Foo x; | ||
equation | ||
x = y; | ||
end M; | ||
|
||
eller �r det bara startv�rdet p� x som p�verkas? | ||
|
||
* FOO | ||
|
||
model M | ||
Real x; | ||
equation | ||
x = 17; | ||
end M; | ||
|
||
model N | ||
M a(x=15); | ||
end N; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Noteringar om syntaxen: -*- outline -*- | ||
|
||
* Grammatiken: class_definition | ||
|
||
Borde v�l vara | ||
|
||
"=" name [ array_dimensions ] [ class_modification ] ) | ||
|
||
och inte | ||
|
||
"=" IDENT [ array_dimensions ] [ class_modification ] ) | ||
|
||
* Redeclare p� array-element | ||
|
||
class Foo | ||
Int x; | ||
end; | ||
|
||
class Bar | ||
Foo y[10]; | ||
end; | ||
|
||
class Weird | ||
Bar z(y[5](redeclare Real x)); | ||
end; | ||
|