Repository navigation
fpp locate uses
This tool parses FPP source files and reports the locations of symbols used in the files. It is useful for diagnostic purposes.
As an example, you can do the following:
-
Run
fpp-locate-defsto construct a fileexported.fppcontaining the locations of some exported symbols. -
Run
fpp-depend exported.fpp client.fppto generate a list F of files on whichclient.fppdepends. Turn F into a comma-separated list F1. -
Run
fpp-locate-uses -iF1client.fppto see the locations of symbols exported inexported.fppand used inclient.fpp.
Options:
-
-ddir: Specify the base directory for locating files. The default directory is the current directory. -
-ifiles: Import files. These files are read in for their symbols, but uses in the files are not reported.
Input:
-
A list fl_tr of files specified on the command line.
-
A list fl_i of files to import, specified as arguments to the
-ioption.
Output:
-
An FPP source file, written to stdout. The source file contains one location specifier for each symbol used in fl_tr.
Procedure:
-
Parse the concatenation of fl_tr and fl_i, generating a translation unit list tul.
-
Perform semantic checking on tul, yielding tul'.
-
Let tul_tr' be the elements of tul' corresponding to fl_tr.
-
For each use u appearing in tul_tr'
-
Look up the definition d corresponding to u.
-
Add the symbol corresponding to d to the used symbol set S.
-
-
For each symbol s in S
-
Use the parent symbol map to get the qualified name of s.
-
Write out a location specifier for the definition corresponding to s.
-