Skip to content

Analysis Data Structure

bocchino edited this page Dec 12, 2020 · 26 revisions

The Analysis Data Structure represents the results of FPP source analysis. It contains the following members.

  • Component map: A map from component symbols to the corresponding components.

  • Dependency file set: The set of files on which the analysis depends.

  • Included file set: The set of files included when parsing input.

  • Input file set: The set of files presented to the analyzer.

  • Location specifier map: A map from pairs (symbol kind, qualified name) to location specifiers. Each entry in the map represents the specified location of a symbol.

  • Missing dependency file set: The subset of the dependency file set consisting of files that could not be opened.

  • Nested scope: A nested scope object that represents the current position in a scope traversal.

  • Qualified name map: A map from symbols to their qualified names.

  • Scope name list: A list of unqualified names representing the enclosing scopes, with the innermost name at the head of the list. For example, inside module B where B is inside A and A is at the top level, the scope name list is [ B, A ].

  • Symbol-scope map: A map from symbols to their scopes.

  • Type map: A map from type and constant symbols, expressions, and type names to their types.

  • Use-def map: A map from uses (expressions and qualified identifiers that refer to definitions) to the symbols representing their definitions.

  • Use-def matching list: The list of use-def matchings on the current use-def path. Used during cycle analysis.

  • Use-def symbol set: The set of symbols on the current use-def path. Used during cycle analysis.

  • Used symbol set: The set of symbols used. Used during code generation.

  • Value map: A map from constant symbols and expressions to their values.

  • Visited symbol set: The set of symbols visited so far.

An empty analysis data structure has the following configuration:

  1. The sets, lists, and maps are empty.

  2. The nested scope contains a single empty scope representing the global scope.

Clone this wiki locally