Skip to content

Check Location Specifiers

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

This algorithm checks that for each location specifier, the specified location matches the actual location of the symbol.

Input

  1. An analysis data structure a.

  2. A list tul of FPP translation units.

Output

  1. An analysis data structure a with updated location specifier map, or an error.

Procedure

  1. Build the location specifier map: Use the same algorithm as for computing dependencies.

  2. Check specified locations: Traverse each translation unit tu in tul, updating the scope name list as modules are entered and exited. For each definition d encountered other than a module definition, do the following:

    1. Use the scope name list to construct the unique qualified name N associated with d.

    2. Look in the location specifier map to get the location l associated with N, if any.

    3. If l exists, then check that l matches the actual location of d. If not, then return an error.