MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / selectEquationSection

Method selectEquationSection

src/modelica/ModelicaFileImpl.cpp:556–582  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

554}
555
556modelicaParser::Equation_sectionContext* ClassDefinitionImpl::selectEquationSection() const {
557 auto* specifier = ctx()->class_specifier();
558 if (!specifier || !specifier->long_class_specifier()) {
559 return nullptr;
560 }
561
562 auto* composition = specifier->long_class_specifier()->composition();
563 if (!composition) {
564 return nullptr;
565 }
566
567 modelicaParser::Equation_sectionContext* fallback = nullptr;
568 const auto sections = composition->equation_section();
569 for (auto* section : sections) {
570 if (!section) {
571 continue;
572 }
573 auto* start = section->getStart();
574 if (start && start->getText() != "initial") {
575 return section;
576 }
577 if (!fallback) {
578 fallback = section;
579 }
580 }
581 return fallback;
582}
583
584std::pair<std::string, std::string> ClassDefinitionImpl::validateAndNormalizeConnectClause(const std::string& source, const std::string& target) {
585 try {

Callers

nothing calls this directly

Calls 5

class_specifierMethod · 0.80
long_class_specifierMethod · 0.80
compositionMethod · 0.80
equation_sectionMethod · 0.80
getTextMethod · 0.45

Tested by

no test coverage detected