Skip to content

Check Component Instance Definitions

Robert L. Bocchino Jr. edited this page Apr 18, 2024 · 7 revisions

This algorithm traverses the source model and checks component instance definitions.

Input

  1. A list tul of translation units.

  2. An analysis data structure a representing the results of analysis so far.

Output

An updated analysis a' with the component instance map filled in if the check passes; otherwise an error.

Procedure

  1. Visit each translation unit in tul with input a, yielding either a or an error.

  2. Check that there are no overlapping identifier ranges for any pairs of instances in the component instance map for a.

AST Visitor Methods

Each method accepts an analysis data structure a as input and yields either a or an error as output.

Translation Units

For each translation unit tu, visit each definition appearing in tu.

Component Instance Definitions

For each component instance definition d

  1. Construct a component instance i from d.

  2. Check that i conforms to the rules for component instances.

  3. Visit each init specifier s for d.

    1. Check that the phase of s is not already represented in i.

    2. Map the phase of s to s in i.

  4. Map i to d in the component instance map of a.

  5. Return a as the result.