-
Notifications
You must be signed in to change notification settings - Fork 31
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-defs
to construct a fileexported.fpp
containing the locations of some exported symbols. -
Run
fpp-depend exported.fpp client.fpp
to generate a list F of files on whichclient.fpp
depends. Turn F into a comma-separated list F1. -
Run
fpp-locate-uses -i
F1client.fpp
to see the locations of symbols exported inexported.fpp
and used inclient.fpp
.
Options:
-
-d
dir: Specify the base directory for locating files. The default directory is the current directory. -
-i
files: 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
-i
option.
Output:
-
An FPP source file, written to stdout. The source file contains one location specifier for each symbol used in fl_tr.
Procedure:
-
Parse each of the files in fl_tr, generating a list tul_tr of translation units. When parsing, recursively resolve include specifiers.
-
Do the same for fl_i, generating a list tul_i.
-
Perform semantic checking on the concatenation of tul_fl and tul_i.
-
For each use u appearing in tul
-
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.
-