Low-Level Config Parsing API¶
The low-level API is used internally by the declarative API. It consists of
functions that work on strings (usually SourceStr) and split them into components corresponding
to different parts of a configuration file. It also defines dataclasses that
hold several such related components.
- yosys_mau.config_parser.split_into_sections(contents, start_index=0)¶
Split the contents of a config file into individual sections.
- Parameters:
- Return type:
- class yosys_mau.config_parser.ConfigSection(index, name, arguments, contents, header)¶
A single section within a config file.
- name: str¶
Name of the section.
The
namepart in a section header of the form[name]or[name arguments].For the initial content of a config file that precedes the first section, the name is
"". For proper sections, the name must be non-empty.
- arguments: str¶
Arguments of the section.
The
argumentspart in a section[name arguments]or the empty string if not present.Can contain spaces.
- contents: str¶
Contents of the section.
The contents following the section header up to the start of the next section or the end of the file.