Skip to content

Check Location Specifiers

Rob Bocchino edited this page Nov 4, 2025 · 5 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 do the following:

      1. Check that l matches the actual location of d. If not, then return an error.

      2. Check that d is a dictionary definition and l is a dictionary specifier or d is not a dictionary definition and l is not a dictionary specifier. If not, then throw an error.

Clone this wiki locally