-
Notifications
You must be signed in to change notification settings - Fork 34
Construct Dictionary Map
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 S of symbols directly used in each dictionary element kind of ci.
-
Let S' be the set of symbols transitively used in the symbols of S (i.e., the symbols of S, 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 group specifier sg in d
-
Create a new telemetry packet group g.
-
For each telemetry packet specifier sp of sg
-
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 channels identifiers of p.
-
-
Resolve the packet identifier i of p.
-
Map i to p in g. Check for duplicate identifiers.
-
-
Check for duplicate packet names in g.
-
For each telemetry channel identifier tci in the omitted list of sg
-
Check that tci refers to a telemetry channel c in D.
-
Add the global numerical identifier for c to the omitted channel identifiers of g.
-
-
Check that the union of the channels named in the packets (as a set) and the set of omitted channels is equal to the set of channels in the dictionary.
-
Add g to the telemetry packet group map of D. Check for duplicate names.
-
-
Map s to D in the dictionary map of a.
-
Return a as the result.