Construct Dictionary Map - nasa/fpp GitHub Wiki
This algorithm traverses the source model and constructs the dictionary map.
- 
A list tul of translation units. 
- 
An analysis data structure a representing the results of analysis so far. 
An updated analysis a' with the dictionary map filled in if the dictionaries in tul are valid; otherwise an error.
Visit each translation unit in tul with input a, yielding either a' or an error.
Each method accepts an analysis data structure a as input and yields either an updated analysis data structure a' or an error as output.
For each topology definition d:
- 
Let the dictionary element kinds be commands, events, telemetry channels, parameters, records, and containers. 
- 
Construct the unique topology symbol s for d. 
- 
Look up the topology t corresponding to s in the topology map of a. 
- 
Create a new dictionary D. 
- 
For each component instance ci of t: - 
Compute the set ss of symbols directly used in each dictionary element kind of ci. 
- 
Let S' be the set of symbols transitively used in the symbols of ss (i.e., the symbols of ss, the symbols used in those symbols, and so forth). 
- 
Add S' to the used symbol set of D. 
 
- 
- 
For each dictionary element kind k, for each component instance ci of t - 
Look up the component C of ci. 
- 
For each mapping (i, s) from a component-local identifier i to a specifier s of kind k in C, do the following: - 
Let b be the base ID of ci. 
- 
Let i' = b + i. 
- 
Construct a dictionary entry e = (ci, s). 
- 
Add (i', e) to the mapping for kind k in D. 
 
- 
 
- 
- 
For each telemetry packet set specifier ss in d - 
Create a new telemetry packet set S. 
- 
For each telemetry packet specifier sp of ss - 
Create a new telemetry packet p. 
- 
For each telemetry channel identifier tci in sp - 
Check that tci refers to a telemetry channel c in D. 
- 
Add the global numerical identifier for c to the telemetry channel identifiers of p. 
 
- 
- 
Resolve the packet identifier i of p. 
- 
Map i to p in S. Check for duplicate identifiers. 
 
- 
- 
Check for duplicate packet names in S. 
- 
For each telemetry channel identifier tci in the omitted list of ss - 
Check that tci refers to a telemetry channel c in D. 
- 
Add the global numerical identifier for c to the omitted channel identifiers of S. 
 
- 
- 
Check that the union of the channels named in the packets of S (as a set) and the set of omitted channels is equal to the set of channels in D. 
- 
Check that no channel is both used in a packet of S and included in the omitted set of S. 
- 
Add S to the telemetry packet set map of D. Check for duplicate names. 
 
- 
- 
Map s to D in the dictionary map of a. 
- 
Return a as the result.