diff --git a/comdel/display/schema_display.cpp b/comdel/display/schema_display.cpp index 6564d36..7bd27de 100644 --- a/comdel/display/schema_display.cpp +++ b/comdel/display/schema_display.cpp @@ -14,25 +14,15 @@ void Schema::setSchema(domain::Schema* schema) scene.clear(); this->schema = schema; if(schema != nullptr) { - for(auto &instance: schema->instances) { - ComponentWrapper *group = nullptr; - auto component = dynamic_cast(instance); - if(component) { - group = ComponentWrapper::ofComponent(component); - } - auto bus = dynamic_cast(instance); - if(bus) { - group = ComponentWrapper::ofBus(bus); - } - if(group != nullptr) { - group->setPos(instance->position.first, instance->position.second); - scene.addItem(group); - } + for(auto &instance: schema->componentInstances) { + ComponentWrapper *component = ComponentWrapper::ofComponent(&instance); + component->setPos(instance.position.first, instance.position.second); + scene.addItem(component); } - for(auto &wire: schema->wires) { - auto group = ComponentWrapper::ofWire(wire); - group->setPos(wire->position.first, wire->position.second); - scene.addItem(group); + for(auto &instance: schema->busInstances) { + ComponentWrapper *bus = ComponentWrapper::ofBus(&instance); + bus->setPos(instance.position.first, instance.position.second); + scene.addItem(bus); } } } diff --git a/comdel/domain/comdelvalidator.cpp b/comdel/domain/comdelvalidator.cpp index e79c48a..9fd9295 100644 --- a/comdel/domain/comdelvalidator.cpp +++ b/comdel/domain/comdelvalidator.cpp @@ -8,12 +8,9 @@ std::vector ComdelValidator::validateSchema(Schema &schema, Val context.instance = nullptr; context.attribute = nullptr; - for(auto &inst: schema.instances) { - auto *instance = dynamic_cast(inst); - if(instance) { - auto result = validateComponent(instance, context); - errors.insert(errors.end(), result.begin(), result.end()); - } + for(auto &instance: schema.componentInstances) { + auto result = validateComponent(&instance, context); + errors.insert(errors.end(), result.begin(), result.end()); } return errors; } diff --git a/comdel/domain/connectioninstance.cpp b/comdel/domain/connectioninstance.cpp index 7e0a008..2739065 100644 --- a/comdel/domain/connectioninstance.cpp +++ b/comdel/domain/connectioninstance.cpp @@ -3,16 +3,16 @@ namespace domain { -ConnectionInstance::ConnectionInstance(ComponentInstance *instance, std::vector attributes, WireInstance *wire, Connection connection) - : instance(instance), attributes(attributes), connection(connection), wire(wire) +ConnectionInstance::ConnectionInstance(ComponentInstance *instance, std::vector attributes, Connection connection) + : instance(instance), attributes(attributes), connection(connection) {} -BusConnectionInstance::BusConnectionInstance(ComponentInstance *instance, std::vector attributes, BusInstance *bus, WireInstance *wire, Connection connection) - : ConnectionInstance(instance, attributes, wire, connection), bus(bus) +BusConnectionInstance::BusConnectionInstance(ComponentInstance *instance, std::vector attributes, BusInstance *bus, Connection connection) + : ConnectionInstance(instance, attributes, connection), bus(bus) {} -DirectConnectionInstance::DirectConnectionInstance(ComponentInstance *instance, ComponentInstance *secondInstance, std::vector attributes, BusInstance *bus, WireInstance *wire, Connection connection) - : ConnectionInstance(instance, attributes, wire, connection), secondInstance(secondInstance), bus(bus) +DirectConnectionInstance::DirectConnectionInstance(ComponentInstance *instance, ComponentInstance *secondInstance, std::vector attributes, BusInstance *bus, Connection connection) + : ConnectionInstance(instance, attributes, connection), secondInstance(secondInstance), bus(bus) {} } // namespace domain diff --git a/comdel/domain/connectioninstance.h b/comdel/domain/connectioninstance.h index 2d593a6..4c5101c 100644 --- a/comdel/domain/connectioninstance.h +++ b/comdel/domain/connectioninstance.h @@ -14,13 +14,12 @@ class ConnectionInstance public: ComponentInstance *instance; Connection connection; - WireInstance *wire; virtual ~ConnectionInstance() = default; std::vector attributes; - ConnectionInstance(ComponentInstance *instance, std::vector attributes, WireInstance *wire, Connection connection); + ConnectionInstance(ComponentInstance *instance, std::vector attributes, Connection connection); }; @@ -29,7 +28,7 @@ class BusConnectionInstance: public ConnectionInstance public: BusInstance *bus; - BusConnectionInstance(ComponentInstance *instance, std::vector attributes, BusInstance *bus, WireInstance *wire, Connection connection); + BusConnectionInstance(ComponentInstance *instance, std::vector attributes, BusInstance *bus, Connection connection); }; @@ -39,7 +38,7 @@ public: BusInstance *bus; ComponentInstance *secondInstance; - DirectConnectionInstance(ComponentInstance *instance, ComponentInstance *secondsInstance, std::vector attributes, BusInstance *bus, WireInstance *wire, Connection connection); + DirectConnectionInstance(ComponentInstance *instance, ComponentInstance *secondsInstance, std::vector attributes, BusInstance *bus, Connection connection); }; diff --git a/comdel/domain/schema.h b/comdel/domain/schema.h index 7c7cae4..aa7732f 100644 --- a/comdel/domain/schema.h +++ b/comdel/domain/schema.h @@ -14,28 +14,21 @@ class Schema public: Schema(); - std::vector instances; - std::vector connections; - std::vector wires; - WireInstance *getWire(std::string name) { - for(auto wire: wires) { - if (wire->name == name) { - return wire; + std::vector busInstances; + std::vector componentInstances; + + std::vector connections; + + Instance *getInstance(std::string& name) { + for(auto& instance: busInstances) { + if (instance.name == name) { + return &instance; } } - return nullptr; - } - - bool hasWire(std::string name) { - return getWire(name) != NULL; - } - - - Instance *getInstance(std::string name) { - for(auto instance: instances) { - if (instance->name == name) { - return instance; + for(auto& instance: componentInstances) { + if (instance.name == name) { + return &instance; } } return nullptr; diff --git a/comdel/domain/schemacreator.cpp b/comdel/domain/schemacreator.cpp index 35de60b..7a4ef66 100644 --- a/comdel/domain/schemacreator.cpp +++ b/comdel/domain/schemacreator.cpp @@ -1,6 +1,7 @@ #include "schemacreator.h" #include +#include namespace domain { @@ -100,21 +101,21 @@ Popup::PopupType toType(PopupNode::PopupType type) } SchemaCreator::SchemaCreator(std::vector signatures) - : signatures(signatures) + : signatures(std::move(signatures)) {} std::optional SchemaCreator::loadLibrary(LibraryNode node) { // library fields if(!node.name) { - errors.push_back(SourceError{node.span, "missing @name"}); + errors.emplace_back(node.span, "missing @name"); return nullopt; } else { name = node.name->asString(); } if(!node.componentDirectory) { - errors.push_back(SourceError{node.span, "missing @componentDirectory"}); + errors.emplace_back(node.span, "missing @componentDirectory"); return nullopt; } else { componentDirectory = node.componentDirectory->asString(); @@ -136,25 +137,25 @@ std::optional SchemaCreator::loadLibrary(LibraryNode node) } } - for(uint i=0; i SchemaCreator::loadBus(BusNode node) count = std::make_pair(node.count->first.value, node.count->second.value); } if(count.first > count.second || count.first < 0) { - errors.push_back(SourceError{node.count->span, "invalid @size"}); + errors.emplace_back(node.count->span, "invalid @size"); return nullopt; } auto type = toType(node.type.value); if(!node.tooltip && type == Bus::REGULAR) { - errors.push_back(SourceError{node.span, "missing @tooltip"}); + errors.emplace_back(node.span, "missing @tooltip"); return nullopt; } std::string tooltip = node.tooltip->asString(); if(!node.display && type == Bus::REGULAR) { - errors.push_back(SourceError{node.span, "missing @display"}); + errors.emplace_back(node.span, "missing @display"); return nullopt; } if(node.display && (type == Bus::AUTOMATIC || type == Bus::AUTOMATIC_SINGLE)) { - errors.push_back(SourceError{node.span, "automatic bus cannot have a @display"}); + errors.emplace_back(node.span, "automatic bus cannot have a @display"); return nullopt; } @@ -200,7 +201,7 @@ std::optional SchemaCreator::loadBus(BusNode node) } if(node.wires.size() == 0) { - errors.push_back(SourceError{node.span, "missing @wires"}); + errors.emplace_back(node.span, "missing @wires"); return nullopt; } std::vector wires; @@ -379,14 +380,14 @@ std::optional SchemaCreator::loadComponent(ComponentNode node) std::string name = node.name.value; if(!node.tooltip) { - errors.push_back(SourceError{node.span, "missing @tooltip"}); + errors.emplace_back(node.span, "missing @tooltip"); pop(); return nullopt; } std::string tooltip = node.tooltip->asString(); if(!node.source) { - errors.push_back(SourceError{node.span, "missing @source"}); + errors.emplace_back(node.span, "missing @source"); pop(); return nullopt; } @@ -413,7 +414,7 @@ std::optional SchemaCreator::loadComponent(ComponentNode node) } if(!node.instanceName) { - errors.push_back(SourceError{node.span, "missing @instanceName"}); + errors.emplace_back(node.span, "missing @instanceName"); pop(); return nullopt; } @@ -424,13 +425,13 @@ std::optional SchemaCreator::loadComponent(ComponentNode node) count = std::make_pair(node.count->first.value, node.count->second.value); } if(count.first > count.second || count.first < 0) { - errors.push_back(SourceError{node.count->first.span, "invalid @size"}); + errors.emplace_back(node.count->first.span, "invalid @size"); pop(); return nullopt; } if(!node.display) { - errors.push_back(SourceError{node.span, "missing @display"}); + errors.emplace_back(node.span, "missing @display"); pop(); return nullopt; } @@ -441,8 +442,8 @@ std::optional SchemaCreator::loadComponent(ComponentNode node) } std::vector pins; - for(uint i=0; i SchemaCreator::loadPin(PinNode node) Pin::PinType type = toType(node.type.value); if(!node.tooltip) { - errors.push_back(SourceError{node.span, "missing @tooltip"}); + errors.emplace_back(node.span, "missing @tooltip"); return nullopt; } std::string tooltip = node.tooltip->asString(); if(!node.display) { - errors.push_back(SourceError{node.span, "missing @display"}); + errors.emplace_back(node.span, "missing @display"); return nullopt; } std::vector attributes; @@ -487,7 +488,7 @@ optional SchemaCreator::loadPin(PinNode node) } if(!node.connection) { - errors.push_back(SourceError{node.span, "missing @connection"}); + errors.emplace_back(node.span, "missing @connection"); return nullopt; } auto connection = loadPinConnection(*node.connection); @@ -548,7 +549,7 @@ std::optional SchemaCreator::loadDisplay(DisplayNode node) h = getIntProperty(item, "h"); displayItem.pin = ui::Pin(x, y, w, h); } else { - errors.push_back(SourceError{item.type.span, "unsupported display type"}); + errors.emplace_back(item.type.span, "unsupported display type"); } items.push_back(displayItem); } @@ -560,7 +561,7 @@ PinConnection SchemaCreator::loadPinConnection(PinConnectionNode node) { std::string message = node.message.asString(); PinConnection::ConnectionType type = toType(node.type.value); - return PinConnection(message, type); + return {message, type}; } std::optional SchemaCreator::loadAttribute(AttributeNode node) @@ -577,7 +578,7 @@ std::optional SchemaCreator::loadAttribute(AttributeNode node) } else if (node.type == ValueNode::STRING) { value = Value::fromString(node.defaultValue->asString()); } else { - errors.push_back(SourceError{node.name.span, "unsupported type"}); + errors.emplace_back(node.name.span, "unsupported type"); } } if(current().inConnection) { // TODO remove identifier @@ -586,14 +587,14 @@ std::optional SchemaCreator::loadAttribute(AttributeNode node) value = Value::fromReference(node.defaultValue->asIdentifier(), Value::WIRE_REFERENCE); } else { value = Value::fromReference("", Value::WIRE_REFERENCE); - errors.push_back(SourceError{node.span, "unknown identifier"}); + errors.emplace_back(node.span, "unknown identifier"); } } else { - errors.push_back(SourceError{node.name.span, "unsupported type"}); + errors.emplace_back(node.name.span, "unsupported type"); } } - current().attributes.push_back(Attribute(name, value)); + current().attributes.emplace_back(name, value); std::optional popup; if(node.popup) { @@ -611,16 +612,16 @@ std::optional SchemaCreator::loadPopup(PopupNode node, std::string name, pushAdditional(name); current().attributes.clear(); - current().attributes.push_back(Attribute(name, Value::ofType(type))); + current().attributes.emplace_back(name, Value::ofType(type)); if(!node.title) { - errors.push_back(SourceError{node.span, "missing @title"}); + errors.emplace_back(node.span, "missing @title"); return nullopt; } std::string title = node.title->asString(); if(!node.text) { - errors.push_back(SourceError{node.span, "missing @text"}); + errors.emplace_back(node.span, "missing @text"); return nullopt; } std::string text = node.text->asString(); @@ -635,34 +636,34 @@ std::optional SchemaCreator::loadPopup(PopupNode node, std::string name, std::vector enumeration; if(node.enumerated) { - for(uint i=0; i SchemaCreator::loadRule(RuleNode node) for(auto& stmt: node.statements) { auto condition = loadCondition(stmt.condition); if(condition) { - statements.push_back(IfStatement(*condition, Action(toType(stmt.action.type.value), stmt.action.message.asString()))); + statements.emplace_back(*condition, Action(toType(stmt.action.type.value), stmt.action.message.asString())); } else { return nullopt; } @@ -691,19 +692,19 @@ std::optional SchemaCreator::loadCondition(ConditionNode node) { std::string function = node.functionName.value; - for(uint i=0; i params; - for(uint j=0; j SchemaCreator::loadCondition(ConditionNode node) } if(!exists) { - errors.push_back(SourceError{node.functionName.span, "unknown reference " + type.asReference()}); + errors.emplace_back(node.functionName.span, "unknown reference " + type.asReference()); } } params.push_back(type); } return Condition(function, params, node.negated); } else { - errors.push_back(SourceError{node.functionName.span, "wrong number of parameters"}); + errors.emplace_back(node.functionName.span, "wrong number of parameters"); } } } - errors.push_back(SourceError{node.functionName.span, "unknown function name"}); + errors.emplace_back(node.functionName.span, "unknown function name"); return nullopt; } Schema* SchemaCreator::loadSchema(SchemaNode node, Library &library) { - Schema *schema = new Schema(); + auto *schema = new Schema(); for(auto &instance: node.instances) { if(library.hasComponent(instance.component.value)) { - schema->instances.push_back(loadComponentInstance(instance, library)); + schema->componentInstances.push_back(loadComponentInstance(instance, library)); } if(library.hasBus(instance.component.value)) { - schema->instances.push_back(loadBusInstance(instance, library)); - } - } - - for(auto &wire: node.wires) { - auto w = loadWireInstance(wire); - if(w) { - schema->wires.push_back(*w); + schema->busInstances.push_back(loadBusInstance(instance, library)); } } for(auto &conn: node.connections) { auto firstComponent = dynamic_cast(schema->getInstance(conn.first.instance.value)); - if(firstComponent == NULL) { - errors.push_back(SourceError{conn.first.instance.span, "unknown component"}); + if(firstComponent == nullptr) { + errors.emplace_back(conn.first.instance.span, "unknown component"); continue; } if(!firstComponent->component.hasPin(conn.first.pin.value)) { - errors.push_back(SourceError{conn.first.pin.span, "unknown pin"}); + errors.emplace_back(conn.first.pin.span, "unknown pin"); continue; } - ComponentInstance *secondComponent = NULL; + ComponentInstance *secondComponent = nullptr; if(conn.second.has_value()) { secondComponent = dynamic_cast(schema->getInstance(conn.second->instance.value)); - if(secondComponent == NULL) { - errors.push_back(SourceError{conn.second->instance.span, "unknown component"}); + if(secondComponent == nullptr) { + errors.emplace_back(conn.second->instance.span, "unknown component"); continue; } if(!secondComponent->component.hasPin(conn.second->pin.value)) { - errors.push_back(SourceError{conn.second->pin.span, "unknown pin"}); + errors.emplace_back(conn.second->pin.span, "unknown pin"); continue; } } auto bus = dynamic_cast(schema->getInstance(conn.bus.value)); - if(bus == NULL) { - errors.push_back(SourceError{conn.bus.span, "unknown bus"}); + if(bus == nullptr) { + errors.emplace_back(conn.bus.span, "unknown bus"); continue; } std::optional connection = std::nullopt; - if(secondComponent != NULL) { + if(secondComponent != nullptr) { ConnectionComponent firstConn{firstComponent->component.getName(), conn.first.pin.value}; ConnectionComponent secondConn{secondComponent->component.getName(), conn.second->pin.value}; @@ -789,7 +783,7 @@ Schema* SchemaCreator::loadSchema(SchemaNode node, Library &library) secondConn)) { connection = *library.getConnection(firstConn, bus->bus.getName(), secondConn); } else { - errors.push_back(SourceError{conn.span, "unknown connection"}); + errors.emplace_back(conn.span, "unknown connection"); continue; } } else { @@ -799,21 +793,15 @@ Schema* SchemaCreator::loadSchema(SchemaNode node, Library &library) bus->bus.getName())) { connection = *library.getConnection(firstConn, bus->bus.getName()); } else { - errors.push_back(SourceError{conn.span, "unknown connection"}); + errors.emplace_back(conn.span, "unknown connection"); continue; } } if(!conn.wire) { - errors.push_back(SourceError{conn.span, "missing @wire"}); + errors.emplace_back(conn.span, "missing @wire"); continue; } - if(!schema->hasWire(conn.wire->value)) { - errors.push_back(SourceError{conn.wire->span, "unknown wire"}); - continue; - } - - auto wire = schema->getWire(conn.wire->value); std::vector attributes; for(auto& attr: conn.attributes) { @@ -827,26 +815,26 @@ Schema* SchemaCreator::loadSchema(SchemaNode node, Library &library) } } if(value.isType(Value::UNDEFINED)) { - errors.push_back(SourceError{attr.span, "invalid value"}); + errors.emplace_back(attr.span, "invalid value"); } attributes.push_back(new InstanceAttribute(attribute.getName(), toType(attr.value), attribute)); } else { - errors.push_back(SourceError(attr.name.span, "unknown attribute")); + errors.emplace_back(attr.name.span, "unknown attribute"); } } - if(secondComponent == NULL) { - schema->connections.push_back(new BusConnectionInstance(firstComponent, attributes, bus, wire, *connection)); + if(secondComponent == nullptr) { + schema->connections.push_back(BusConnectionInstance(firstComponent, attributes, bus, *connection)); } else { - schema->connections.push_back(new DirectConnectionInstance(firstComponent, secondComponent, attributes, bus, wire, *connection)); + schema->connections.push_back(DirectConnectionInstance(firstComponent, secondComponent, attributes, bus, *connection)); } } return schema; } -ComponentInstance *SchemaCreator::loadComponentInstance(InstanceNode instance, Library &library) { +ComponentInstance SchemaCreator::loadComponentInstance(InstanceNode instance, Library &library) { auto name = instance.name.value; auto position = std::make_pair(instance.position->first.value, instance.position->second.value); @@ -858,15 +846,15 @@ ComponentInstance *SchemaCreator::loadComponentInstance(InstanceNode instance, L for(auto& attr: instance.attributes) { if(component.hasAttribute(attr.name.value, toType(attr.value.getType()))) { auto attribute = component.getAttribute(attr.name.value); - attributes.push_back(new InstanceAttribute(attribute.getName(), toType(attr.value), attribute)); + attributes.emplace_back(new InstanceAttribute(attribute.getName(), toType(attr.value), attribute)); } else { - errors.push_back(SourceError(attr.name.span, "unknown attribute")); + errors.emplace_back(SourceError(attr.name.span, "unknown attribute")); } } - return new ComponentInstance(name, attributes, position, component); + return {name, attributes, position, component}; } -BusInstance *SchemaCreator::loadBusInstance(InstanceNode instance, Library &library) { +BusInstance SchemaCreator::loadBusInstance(InstanceNode instance, Library &library) { auto name = instance.name.value; auto position = std::make_pair(instance.position->first.value, instance.position->second.value); @@ -878,25 +866,7 @@ BusInstance *SchemaCreator::loadBusInstance(InstanceNode instance, Library &libr size = instance.size->value; } - return new BusInstance(name, position, bus, size); + return {name, position, bus, static_cast(size)}; } -std::optional SchemaCreator::loadWireInstance(WireInstanceNode node) { - - if(!node.display) { - errors.push_back(SourceError{node.span, "missing @text"}); - return nullopt; - } - auto display = loadDisplay(*node.display); - if(!display) { - return nullopt; - } - std::pair position = std::make_pair(0, 0); - if(node.position) { - position = std::make_pair(node.position->first.value, node.position->second.value); - } - return std::optional(new WireInstance(node.name.value, *display, position)); -} - - } // namespace domain diff --git a/comdel/domain/schemacreator.h b/comdel/domain/schemacreator.h index fca225c..d29bf9d 100644 --- a/comdel/domain/schemacreator.h +++ b/comdel/domain/schemacreator.h @@ -75,9 +75,8 @@ class SchemaCreator std::optional loadConnection(ConnectionNode node); std::optional loadBus(BusNode node); - ComponentInstance *loadComponentInstance(InstanceNode instance, Library &library); - BusInstance *loadBusInstance(InstanceNode instance, Library &library); - std::optional loadWireInstance(WireInstanceNode node); + ComponentInstance loadComponentInstance(InstanceNode instance, Library &library); + BusInstance loadBusInstance(InstanceNode instance, Library &library); std::optional getBus(std::string name) { for(auto &bus: buses) { diff --git a/mainwindow.cpp b/mainwindow.cpp index f1bbb5d..50d3776 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -156,40 +156,28 @@ void MainWindow::onStoreScheme() { buffer << "@schema {" << std::endl; - for(auto &instance: schema->instances) { - auto componentInstance = dynamic_cast(instance); - if(componentInstance != nullptr) { - buffer << "\t" << "@instance " << componentInstance->name << " " << componentInstance->component.getName() << " {" << std::endl; - buffer << "\t\t" << "@position (" << componentInstance->position.first << ", " << componentInstance->position.second << ")" << std::endl; + for(auto &componentInstance: schema->componentInstances) { + buffer << "\t" << "@instance " << componentInstance.name << " " << componentInstance.component.getName() << " {" << std::endl; + buffer << "\t\t" << "@position (" << componentInstance.position.first << ", " << componentInstance.position.second << ")" << std::endl; - for(auto &attribute: instance->attributes) { - buffer << "\t\t" << "@attribute " << attribute->name << " " << attribute->value.stringify() << std::endl; - } - - buffer << "\t}" << std::endl << std::endl; + for(auto &attribute: componentInstance.attributes) { + buffer << "\t\t" << "@attribute " << attribute->name << " " << attribute->value.stringify() << std::endl; } - auto busInstance = dynamic_cast(instance); - if(busInstance != nullptr) { - buffer << "\t" << "@instance " << busInstance->name << " " << busInstance->bus.getName() << " {" << std::endl; - buffer << "\t\t" << "@position (" << busInstance->position.first << ", " << busInstance->position.second << ")" << std::endl; - buffer << "\t\t" << "@size " << busInstance->size << std::endl; - buffer << "\t}" << std::endl << std::endl; - } + buffer << "\t}" << std::endl << std::endl; } - for(auto &wire: schema->wires) { - buffer << "\t" << "@wire " << wire->name << " {" << std::endl; - buffer << "\t\t" << "@position (" << wire->position.first << ", " << wire->position.second << ")" << std::endl; - buffer << "\t\t" << "@display {}" << std::endl; - buffer << "\t" << "}" << std::endl; + for(auto &busInstance: schema->busInstances) { + buffer << "\t" << "@instance " << busInstance.name << " " << busInstance.bus.getName() << " {" << std::endl; + buffer << "\t\t" << "@position (" << busInstance.position.first << ", " << busInstance.position.second << ")" << std::endl; + buffer << "\t\t" << "@size " << busInstance.size << std::endl; + buffer << "\t}" << std::endl << std::endl; } for(auto &conn: schema->connections) { - auto busConn = dynamic_cast(conn); + auto busConn = dynamic_cast(&conn); if(busConn) { buffer << "\t" << "@connection (" << busConn->instance->name << "." << busConn->connection.getComponent().pin << ", " << busConn->bus->name << ") {" << std::endl; - buffer << "\t\t"<< "@wire " << busConn->wire->name << std::endl; buffer << "\t" << "}" << std::endl; } }