-
Notifications
You must be signed in to change notification settings - Fork 35
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.
-
Compute the used symbol set S as follows:
-
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).
-
-
Let S be the union of the sets S'' computed in the previous step.
-
-
For each dictionary element kind k, compute the mapping mk as follows:
-
Let mk be an empty mapping.
-
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 mk.
-
-
-
-
Compute the mapping m from telemetry packet group names to telemetry packet groups as follows:
-
Let m be an empty mapping.
-
Visit the telemetry packet groups of d. For each telemetry packet group g with name n:
-
Check that each telemetry packet p of g is semantically valid.
-
Use the telemetry channel map computed in step 3 to check that g is semantically valid.
-
Add the mapping (n, g) to m.
-
-
-
Use the set S, the maps mk, and the map m to construct a dictionary D.
-
Map s to D in the dictionary map of a.
-
Return a as the result.