Skip to content

fpp locate defs

Rob Bocchino edited this page Jun 28, 2023 · 2 revisions

This tool parses FPP source files and reports the locations of symbol definitions. It is useful when exporting symbols from a directory containing FPP source files.

For example, you can run find dir -name '*.fpp' to find all the FPP files in dir, and you can use the output as the input to fpp-locate-defs. The result will be a manifest of all the FPP symbols defined in dir. You can save this manifest in a file, say dir /exported.fpp. When building a file that depends on dir, say client.fpp, you can do the following:

  • Run fpp-depend dir /exported.fpp client.fpp to compute the file dependencies of client.fpp on specific files in dir.

  • Run fpp-locate-uses -i dir /exported.fpp client.fpp to compute the locations of symbols defined in dir and used in client.fpp.

Options:

  1. -d dir: Specify the base directory for locating files. The default directory is the current directory.

Input: A list fl of files specified on the command line.

Output:

  1. An FPP source file, written to stdout. The source file contains one location specifier for each symbol defined in fl.

Procedure:

  1. Parse each of the files in fl, generating a list tul of translation units. When parsing, recursively resolve include specifiers.

  2. For each definition d appearing in tul write out a location specifier for d relative to the base directory.