Changeset f6e7c77 in OpenModelica
- Timestamp:
- 2012-11-20T10:34:17+01:00 (11 years ago)
- Branches:
- Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
- Children:
- 69de9ca
- Parents:
- 2c58d767
- Location:
- Compiler/FrontEnd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Compiler/FrontEnd/ConnectUtil.mo
r09fafda9 rf6e7c77 150 150 then inChildSets; 151 151 152 // Check if the node already exists. In that case it's probably due to 153 // multiple inheritance and we should ignore it. 154 case (Connect.SETS(sets = Connect.SET_TRIE_NODE(nodes = nodes)), 155 Connect.SETS(sets = node)) 156 equation 157 name = setTrieNodeName(node); 158 _ = setTrieGetNode(name, nodes); 159 then 160 inParentSets; 161 152 162 // In the normal case we add the trie on the child sets to the parent, and 153 163 // also merge their lists of connection crefs and outer connects. … … 1253 1263 end match; 1254 1264 end setTrieNewNode; 1265 1266 protected function setTrieNodeName 1267 input SetTrieNode inNode; 1268 output String outName; 1269 algorithm 1270 outName := match(inNode) 1271 local 1272 String name; 1273 1274 case Connect.SET_TRIE_NODE(name = name) then name; 1275 case Connect.SET_TRIE_LEAF(name = name) then name; 1276 case Connect.SET_TRIE_DELETED(name = name) then name; 1277 1278 end match; 1279 end setTrieNodeName; 1255 1280 1256 1281 protected function mergeSets -
Compiler/FrontEnd/ConnectUtil2.mo
rb9444fb rf6e7c77 683 683 "Determines the face of a connector element, i.e. inside or outside. A 684 684 connector element is outside if the first identifier in the cref is a 685 connector, otherwise inside. This function takes the optional component686 returned from lookupConnectorCref instead of a cref though."687 input Option<Component> inPrefixComponent;685 connector, otherwise inside." 686 input DAE.ComponentRef inCref; 687 input Component inComponent; 688 688 output Face outFace; 689 689 algorithm 690 outFace := match(in PrefixComponent)690 outFace := match(inCref, inComponent) 691 691 local 692 692 Component comp; … … 694 694 Face face; 695 695 696 // No prefix component means a simple identifier, i.e. the connector element 697 // itself is the first identifier. 698 case NONE() then Connect2.OUTSIDE(); 699 700 // A prefix component, face depends on if it's a connector or not. 701 case SOME(comp) 702 equation 696 // Non-qualified connector crefs are always outside. 697 case (DAE.CREF_IDENT(ident = _), _) then Connect2.OUTSIDE(); 698 699 // Qualified connector crefs are allowed to be on two forms: m.c or 700 // c1.c2.c3..., where m is a non-connector component and cN a connector. 701 // To determine the face of a connector we only need to look at the parent 702 // of the given connector element. 703 case (DAE.CREF_QUAL(ident = _), _) 704 equation 705 SOME(comp) = InstUtil.getComponentParent(inComponent); 703 706 is_conn = InstUtil.isConnectorComponent(comp); 704 707 // Connector => outside, not connector => inside. … … 709 712 end match; 710 713 end getConnectorFace; 711 714 712 715 public function isConstOrComplexConnector 713 716 input Connector inConnector; -
Compiler/FrontEnd/Typing.mo
rb9444fb rf6e7c77 1536 1536 (cref, comp, pre_comp) = 1537 1537 lookupConnectorCref(inCref, inPrefix, inSymbolTable, inInfo); 1538 (cref, face, is_deleted) = typeConnectorCref2(cref, comp, pre_comp, inInfo);1538 (cref, face, is_deleted) = typeConnectorCref2(cref, inCref, comp, pre_comp, inInfo); 1539 1539 then 1540 1540 (cref, face, comp, is_deleted); … … 1545 1545 protected function typeConnectorCref2 1546 1546 input DAE.ComponentRef inCref; 1547 input DAE.ComponentRef inUnprefixedCref; 1547 1548 input Option<Component> inComponent; 1548 1549 input Option<Component> inPrefixComponent; … … 1553 1554 algorithm 1554 1555 (outCref, outFace, outIsDeleted) := 1555 match(inCref, in Component, inPrefixComponent, inInfo)1556 match(inCref, inUnprefixedCref, inComponent, inPrefixComponent, inInfo) 1556 1557 local 1557 1558 Face face; … … 1563 1564 1564 1565 // A connector that is part of a deleted conditional component. 1565 case (_, NONE(), NONE(), _)1566 case (_, _, NONE(), NONE(), _) 1566 1567 then (inCref, Connect2.NO_FACE(), true); 1567 1568 1568 1569 // A connector which is itself deleted. 1569 case (_, SOME(InstTypes.DELETED_COMPONENT(_)), _, _)1570 case (_, _, SOME(InstTypes.DELETED_COMPONENT(_)), _, _) 1570 1571 then (inCref, Connect2.NO_FACE(), true); 1571 1572 1572 1573 // A component that should be added to an expandable connector. It can only 1573 1574 // be outside, since only connectors on the form m.c are inside. 1574 case (_, NONE(), SOME(comp), _)1575 case (_, _, NONE(), SOME(comp), _) 1575 1576 equation 1576 1577 /* ------------------------------------------------------------------*/ … … 1585 1586 1586 1587 // A normal connector. 1587 case (cref, SOME(comp), _, _)1588 case (cref, _, SOME(comp), _, _) 1588 1589 equation 1589 1590 /* ------------------------------------------------------------------*/ … … 1591 1592 /* ------------------------------------------------------------------*/ 1592 1593 ConnectCheck.checkComponentIsConnector(comp, inPrefixComponent, inCref, inInfo); 1593 face = ConnectUtil2.getConnectorFace(in PrefixComponent);1594 face = ConnectUtil2.getConnectorFace(inUnprefixedCref, comp); 1594 1595 cref = InstUtil.typeCrefWithComponent(cref, comp); 1595 1596 then … … 1653 1654 equation 1654 1655 comp = InstSymbolTable.lookupCref(inCref, inSymbolTable); 1655 opt_pre_comp = InstUtil.getComponentParent(comp); 1656 then 1657 (SOME(comp), opt_pre_comp); 1656 then 1657 (SOME(comp), NONE()); 1658 1658 1659 1659 // If the cref is qualified but we couldn't find it, it might be part of a
Note: See TracChangeset
for help on using the changeset viewer.