Skip to content

Check Component Instance Definitions

bocchino edited this page Mar 17, 2021 · 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. Map i to d in the component instance map of a.

  4. Return a as the result.

Clone this wiki locally