Skip to content

Commit 1a5dd13

Browse files
committed
[NF] Change NFComponent to a uniontype.
1 parent 8244a02 commit 1a5dd13

33 files changed

+91
-97
lines changed

OMCompiler/Compiler/NFFrontEnd/NFBuiltin.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import SCode;
4747
import NFBinding;
4848
import NFClass.Class;
4949
import NFClassTree.ClassTree;
50-
import NFComponent.Component;
50+
import Component = NFComponent;
5151
import Expression = NFExpression;
5252
import NFInstNode.InstNode;
5353
import NFInstNode.InstNodeType;

OMCompiler/Compiler/NFFrontEnd/NFBuiltinCall.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected
6262
import Util;
6363
import ExpandExp = NFExpandExp;
6464
import Operator = NFOperator;
65-
import NFComponent.Component;
65+
import Component = NFComponent;
6666
import NFPrefixes.ConnectorType;
6767

6868
public

OMCompiler/Compiler/NFFrontEnd/NFBuiltinFuncs.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import NFFunction.FuncType;
4040
import NFInstNode.CachedData;
4141
import NFInstNode.InstNode;
4242
import NFInstNode.InstNodeType;
43-
import NFComponent.Component;
43+
import Component = NFComponent;
4444
import Type = NFType;
4545
import Expression = NFExpression;
4646
import Absyn;

OMCompiler/Compiler/NFFrontEnd/NFCall.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import Lookup = NFLookup;
5656
import MetaModelica.Dangerous.listReverseInPlace;
5757
import NFBinding.Binding;
5858
import NFClass.Class;
59-
import NFComponent.Component;
59+
import Component = NFComponent;
6060
import NFFunction.Function;
6161
import NFFunction.FunctionMatchKind;
6262
import NFFunction.MatchedFunction;

OMCompiler/Compiler/NFFrontEnd/NFCeval.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ encapsulated package NFCeval
3434
import NFBinding.Binding;
3535
import ComponentRef = NFComponentRef;
3636
import Error;
37-
import NFComponent.Component;
37+
import Component = NFComponent;
3838
import Expression = NFExpression;
3939
import NFInstNode.InstNode;
4040
import Operator = NFOperator;

OMCompiler/Compiler/NFFrontEnd/NFClass.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import NFModifier.Modifier;
3636
import NFStatement.Statement;
3737
import SCode.Element;
3838
import Type = NFType;
39-
import NFComponent.Component;
39+
import Component = NFComponent;
4040
import Dimension = NFDimension;
4141
import NFClassTree.ClassTree;
4242
import NFSections.Sections;

OMCompiler/Compiler/NFFrontEnd/NFClassTree.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected
4444
import Error;
4545
import MetaModelica.Dangerous.*;
4646
import NFClass.Class;
47-
import NFComponent.Component;
47+
import Component = NFComponent;
4848
import Inst = NFInst;
4949
import List;
5050
import Lookup = NFLookup;

OMCompiler/Compiler/NFFrontEnd/NFComponent.mo

Lines changed: 62 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*
3030
*/
3131

32-
encapsulated package NFComponent
32+
encapsulated uniontype NFComponent
3333

3434
import DAE;
3535
import NFBinding.Binding;
@@ -49,71 +49,70 @@ import List;
4949
import Prefixes = NFPrefixes;
5050
import SCodeUtil;
5151
import Restriction = NFRestriction;
52+
import Component = NFComponent;
5253

5354
public
54-
constant Component.Attributes DEFAULT_ATTR =
55-
Component.Attributes.ATTRIBUTES(
56-
ConnectorType.NON_CONNECTOR,
57-
Parallelism.NON_PARALLEL,
58-
Variability.CONTINUOUS,
59-
Direction.NONE,
60-
InnerOuter.NOT_INNER_OUTER,
61-
false,
62-
false,
63-
Replaceable.NOT_REPLACEABLE()
64-
);
65-
constant Component.Attributes INPUT_ATTR =
66-
Component.Attributes.ATTRIBUTES(
67-
ConnectorType.NON_CONNECTOR,
68-
Parallelism.NON_PARALLEL,
69-
Variability.CONTINUOUS,
70-
Direction.INPUT,
71-
InnerOuter.NOT_INNER_OUTER,
72-
false,
73-
false,
74-
Replaceable.NOT_REPLACEABLE()
75-
);
76-
77-
constant Component.Attributes OUTPUT_ATTR =
78-
Component.Attributes.ATTRIBUTES(
79-
ConnectorType.NON_CONNECTOR,
80-
Parallelism.NON_PARALLEL,
81-
Variability.CONTINUOUS,
82-
Direction.OUTPUT,
83-
InnerOuter.NOT_INNER_OUTER,
84-
false,
85-
false,
86-
Replaceable.NOT_REPLACEABLE()
87-
);
88-
89-
constant Component.Attributes CONSTANT_ATTR =
90-
Component.Attributes.ATTRIBUTES(
91-
ConnectorType.NON_CONNECTOR,
92-
Parallelism.NON_PARALLEL,
93-
Variability.CONSTANT,
94-
Direction.NONE,
95-
InnerOuter.NOT_INNER_OUTER,
96-
false,
97-
false,
98-
Replaceable.NOT_REPLACEABLE()
99-
);
100-
101-
constant Component.Attributes IMPL_DISCRETE_ATTR =
102-
Component.Attributes.ATTRIBUTES(
103-
ConnectorType.NON_CONNECTOR,
104-
Parallelism.NON_PARALLEL,
105-
Variability.IMPLICITLY_DISCRETE,
106-
Direction.NONE,
107-
InnerOuter.NOT_INNER_OUTER,
108-
false,
109-
false,
110-
Replaceable.NOT_REPLACEABLE()
111-
);
112-
113-
uniontype Component
114-
uniontype Attributes
115-
import SCode;
55+
constant Attributes DEFAULT_ATTR =
56+
Attributes.ATTRIBUTES(
57+
ConnectorType.NON_CONNECTOR,
58+
Parallelism.NON_PARALLEL,
59+
Variability.CONTINUOUS,
60+
Direction.NONE,
61+
InnerOuter.NOT_INNER_OUTER,
62+
false,
63+
false,
64+
Replaceable.NOT_REPLACEABLE()
65+
);
66+
67+
constant Attributes INPUT_ATTR =
68+
Attributes.ATTRIBUTES(
69+
ConnectorType.NON_CONNECTOR,
70+
Parallelism.NON_PARALLEL,
71+
Variability.CONTINUOUS,
72+
Direction.INPUT,
73+
InnerOuter.NOT_INNER_OUTER,
74+
false,
75+
false,
76+
Replaceable.NOT_REPLACEABLE()
77+
);
78+
79+
constant Attributes OUTPUT_ATTR =
80+
Attributes.ATTRIBUTES(
81+
ConnectorType.NON_CONNECTOR,
82+
Parallelism.NON_PARALLEL,
83+
Variability.CONTINUOUS,
84+
Direction.OUTPUT,
85+
InnerOuter.NOT_INNER_OUTER,
86+
false,
87+
false,
88+
Replaceable.NOT_REPLACEABLE()
89+
);
90+
91+
constant Attributes CONSTANT_ATTR =
92+
Attributes.ATTRIBUTES(
93+
ConnectorType.NON_CONNECTOR,
94+
Parallelism.NON_PARALLEL,
95+
Variability.CONSTANT,
96+
Direction.NONE,
97+
InnerOuter.NOT_INNER_OUTER,
98+
false,
99+
false,
100+
Replaceable.NOT_REPLACEABLE()
101+
);
102+
103+
constant Attributes IMPL_DISCRETE_ATTR =
104+
Attributes.ATTRIBUTES(
105+
ConnectorType.NON_CONNECTOR,
106+
Parallelism.NON_PARALLEL,
107+
Variability.IMPLICITLY_DISCRETE,
108+
Direction.NONE,
109+
InnerOuter.NOT_INNER_OUTER,
110+
false,
111+
false,
112+
Replaceable.NOT_REPLACEABLE()
113+
);
116114

115+
uniontype Attributes
117116
record ATTRIBUTES
118117
// adrpo: keep the order in DAE.ATTR
119118
ConnectorType.Type connectorType;
@@ -1002,7 +1001,6 @@ uniontype Component
10021001
else false;
10031002
end match;
10041003
end isTypeAttribute;
1005-
end Component;
10061004

10071005
annotation(__OpenModelica_Interface="frontend");
10081006
end NFComponent;

OMCompiler/Compiler/NFFrontEnd/NFComponentRef.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
encapsulated uniontype NFComponentRef
3333
protected
34-
import NFComponent.Component;
34+
import Component = NFComponent;
3535
import Absyn;
3636
import DAE;
3737
import Subscript = NFSubscript;

OMCompiler/Compiler/NFFrontEnd/NFConnectEquations.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ import BuiltinCall = NFBuiltinCall;
6666
import ComplexType = NFComplexType;
6767
import ExpandExp = NFExpandExp;
6868
import Prefixes = NFPrefixes;
69-
import NFComponent.Component;
69+
import Component = NFComponent;
7070
import Ceval = NFCeval;
7171
import MetaModelica.Dangerous.listReverseInPlace;
7272
import SimplifyExp = NFSimplifyExp;

0 commit comments

Comments
 (0)