Skip to content

Commit

Permalink
- Lots of connection handling in the new instantiation.
Browse files Browse the repository at this point in the history
- Cleaned up BaseHashTable a bit.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13240 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed Oct 8, 2012
1 parent 39baea0 commit 807c294
Show file tree
Hide file tree
Showing 14 changed files with 1,843 additions and 1,293 deletions.
457 changes: 241 additions & 216 deletions Compiler/FrontEnd/ComponentReference.mo

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion Compiler/FrontEnd/Connect2.mo
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ public uniontype ConnectorAttr
end CONN_ATTR;
end ConnectorAttr;

public constant ConnectorAttr DEFAULT_ATTR =
CONN_ATTR(DAE.VARIABLE(), DAE.PUBLIC(), DAE.BIDIR());

public uniontype Connection
record CONNECTION
Connector lhs;
Expand Down Expand Up @@ -114,11 +117,12 @@ end Root;
public uniontype Connections
record CONNECTIONS
list<Connection> connections;
list<Connection> expandableConnections;
list<Connection> branches;
list<Root> roots;
end CONNECTIONS;
end Connections;

public constant Connections emptyConnections := CONNECTIONS({}, {}, {});
public constant Connections emptyConnections := CONNECTIONS({}, {}, {}, {});

end Connect2;
14 changes: 14 additions & 0 deletions Compiler/FrontEnd/ConnectCheck.mo
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,25 @@ algorithm
then
();

// Both connectors are undeclared, show error.
case (_, POTENTIALLY_PRESENT(), _, POTENTIALLY_PRESENT(),
(lhs_cref, rhs_cref, info))
equation
cref_str1 = ComponentReference.printComponentRefStr(lhs_cref);
cref_str2 = ComponentReference.printComponentRefStr(rhs_cref);
Error.addSourceMessage(Error.UNDECLARED_CONNECTION,
{cref_str1, cref_str2}, info);
then
fail();

// One of the connectors is only potentially present
case (_, POTENTIALLY_PRESENT(), _, _, _) then ();
case (_, _, _, POTENTIALLY_PRESENT(), _) then ();

// Both connectors are expandable, check them later.
/*-----------------------------------------------------------------------*/
// TODO: Check that none of them contains flow components.
/*-----------------------------------------------------------------------*/
case (_, EXPANDABLE_CONNECTOR(), _, EXPANDABLE_CONNECTOR(), _) then ();

// One is expandable and one is non-expandable, show error.
Expand Down

0 comments on commit 807c294

Please sign in to comment.