Skip to content

Dictionary Construction

Justine West edited this page Jan 8, 2024 · 27 revisions

Input

  1. An analysis data structure

  2. A topology data structure to construct dictionary for

Output

  1. Dictionary data structure consisting of dictionary contents

  2. If dictionary construction fails, an error and no output

Procedure

  1. Populate used symbols: Traverse component instance map and for each component

    1. For all command, event, telemetry channel, parameter, record, and container maps:

      1. Get all used symbols for all entries in the map

      2. Check to see if a valid analysis is returned, if not then raise an error

      3. If the analysis is valid, return the analysis' used symbol set

    2. Flatten list of sets into a single set consisting of used symbols

    3. For each entry in the used symbol, create 3 subsets consisting of only array symbols, enumeration symbols, and struct symbols

    4. Return Dictionary data structure consisting of populated used symbol sets (all symbols, arrays only, enumerations only, and structs only)

  2. Resolve identifiers and construct maps of resolved identifiers to commands, telemetry channels, events, parameters, records, and collections: Traverse component instance map and for each dictionary element in the component (ie: command map, telemetry channel map, event map, parameter map, record map, collection map):

    1. Build the resolved identifier to dictionary element map:

      1. Get map from the component and for each element in the map

      2. Retrieve the identifier from the element and add it to the base ID of the component instance to create the resolved ID

      3. Add the resolved ID to mapping from resolved ID to dictionary element

      4. Return a ResolvedComponentInstance intermediate data structure consisting of resolved ID maps for commands, telemetry channels, events, parameters, records, and collections

    2. Merge list of ResolvedComponentInstance maps into a single map

      1. Traverse list of ResolvedComponentInstance data structure and merge each resolved map type (ie: command map, telemetry channel map, event map, parameter map, record map, collection map) into one

      2. Return Dictionary data structure consisting of all resolved command, telemetry channel, event, parameter, record, and collection maps for all component instances in the topology

Clone this wiki locally