sec_parser.semantic_tree.nesting_rules ====================================== .. py:module:: sec_parser.semantic_tree.nesting_rules Classes ------- .. autoapisummary:: sec_parser.semantic_tree.nesting_rules.AbstractNestingRule sec_parser.semantic_tree.nesting_rules.AlwaysNestAsParentRule sec_parser.semantic_tree.nesting_rules.AlwaysNestAsChildRule sec_parser.semantic_tree.nesting_rules.NestSameTypeDependingOnLevelRule Module Contents --------------- .. py:class:: AbstractNestingRule(*, exclude_parents: set[type[sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement]] | None = None, exclude_children: set[type[sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement]] | None = None) Bases: :py:obj:`abc.ABC` AbstractNestingRule is a base class for defining rules for nesting semantic elements. Each rule should ideally mention at most one or two types of semantic elements to reduce coupling and complexity. In case of conflicts between rules, they should be resolved through parameters like exclude_parents and exclude_children. .. py:attribute:: _exclude_parents :value: None .. py:attribute:: _exclude_children :value: None .. py:method:: should_be_nested_under(parent: sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement, child: sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement) -> bool .. py:method:: _should_be_nested_under(parent: sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement, child: sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement) -> bool :abstractmethod: .. py:class:: AlwaysNestAsParentRule(cls: type[sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement], /, *, exclude_parents: set[type[sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement]] | None = None, exclude_children: set[type[sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement]] | None = None) Bases: :py:obj:`AbstractNestingRule` AbstractNestingRule is a base class for defining rules for nesting semantic elements. Each rule should ideally mention at most one or two types of semantic elements to reduce coupling and complexity. In case of conflicts between rules, they should be resolved through parameters like exclude_parents and exclude_children. .. py:attribute:: _cls .. py:method:: _should_be_nested_under(parent: sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement, child: sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement) -> bool .. py:class:: AlwaysNestAsChildRule(cls: type[sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement], /, *, exclude_parents: set[type[sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement]] | None = None, exclude_children: set[type[sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement]] | None = None) Bases: :py:obj:`AbstractNestingRule` AbstractNestingRule is a base class for defining rules for nesting semantic elements. Each rule should ideally mention at most one or two types of semantic elements to reduce coupling and complexity. In case of conflicts between rules, they should be resolved through parameters like exclude_parents and exclude_children. .. py:attribute:: _cls .. py:method:: _should_be_nested_under(parent: sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement, child: sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement) -> bool .. py:class:: NestSameTypeDependingOnLevelRule(*, exclude_parents: set[type[sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement]] | None = None, exclude_children: set[type[sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement]] | None = None) Bases: :py:obj:`AbstractNestingRule` AbstractNestingRule is a base class for defining rules for nesting semantic elements. Each rule should ideally mention at most one or two types of semantic elements to reduce coupling and complexity. In case of conflicts between rules, they should be resolved through parameters like exclude_parents and exclude_children. .. py:method:: _should_be_nested_under(parent: sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement, child: sec_parser.semantic_elements.abstract_semantic_element.AbstractSemanticElement) -> bool