graph LR
Parser_Orchestrator["Parser Orchestrator"]
Pattern_Set_Builder["Pattern Set Builder"]
Pattern_Collection_Manager["Pattern Collection Manager"]
Individual_Pattern_Parser["Individual Pattern Parser"]
Row_Parser["Row Parser"]
Row_Connector["Row Connector"]
ID_Manager["ID Manager"]
Parser_Orchestrator -- "initiates creation of" --> Pattern_Set_Builder
Parser_Orchestrator -- "directs" --> Pattern_Collection_Manager
Pattern_Collection_Manager -- "delegates parsing to" --> Individual_Pattern_Parser
Individual_Pattern_Parser -- "requests parsing from" --> Row_Parser
Individual_Pattern_Parser -- "triggers" --> Row_Connector
Individual_Pattern_Parser -- "utilizes" --> ID_Manager
Row_Parser -- "provides delayed data to" --> Individual_Pattern_Parser
Row_Parser -- "utilizes" --> ID_Manager
The Pattern Parser subsystem is primarily encapsulated within the knittingpattern.Parser module, specifically the Parser.py file. Its core responsibility is to interpret raw input data (typically JSON objects) and transform it into a canonical, structured internal knitting pattern data model, handling validation and data enrichment.
Manages the overall parsing lifecycle, including initialization, state management, and providing entry points for parsing operations. It acts as the primary coordinator for the parsing process.
Related Classes/Methods:
knittingpattern.Parser.knitting_pattern_set:76-90knittingpattern.Parser.__init__:40-49knittingpattern.Parser._start:51-58knittingpattern.Parser.default_parser:257-266
Constructs the high-level structure of the knitting pattern set, including version and type validation, ensuring the input conforms to the expected schema.
Related Classes/Methods:
knittingpattern.Parser._create_pattern_set:247-254knittingpattern.Parser._get_type:231-241knittingpattern.Parser._error:68-74
Iterates through the input data to manage the parsing of individual patterns within a larger set, delegating the detailed parsing of each pattern.
Related Classes/Methods:
Parses the intricate details of a single knitting pattern, including its rows, and handles post-processing steps like instruction finalization and inheritance resolution.
Related Classes/Methods:
knittingpattern.Parser._pattern:174-182knittingpattern.Parser.new_pattern:184-192knittingpattern.Parser._finish_instructions:107-112knittingpattern.Parser._finish_inheritance:92-97
Focuses on parsing individual rows and their specific elements, including marking certain data for delayed processing (e.g., instructions or inheritance that depend on other parsed elements).
Related Classes/Methods:
knittingpattern.Parser._rows:194-199knittingpattern.Parser._row:145-153knittingpattern.Parser._delay_instructions:114-120knittingpattern.Parser._delay_inheritance:99-105
Establishes logical connections and relationships between parsed rows, crucial for building the complete pattern structure.
Related Classes/Methods:
Provides a utility for standardizing and converting elements to internal identifiers, ensuring data consistency and uniqueness within the parsed data model.
Related Classes/Methods: