Reputation: 193
I'd like to use the xref information from a GPS Ada project to generate lists of the variables defined for each package spec and body. I need to exclude any variables defined inside of subprograms.
I can see this information in GPS's "Project View" which shows the literals, package, pragmas, types, and variables defined in each file. However, the information is not selectable for cut/paste. How do I generate this in text form?
Upvotes: 3
Views: 387
Reputation: 25511
GPS is customised using Python. The provided scripts are in {installation}/share/gps/library
; it looks as though unused_entities.py
might be a good start. Or, there's a chapter on "Customizing and Extending GPS" in the GPS documentation.
[Edit]
Or, even better, look at the example globals.py
in {installation}/share/examples/gps/python
. A quick poke through the documentation (accessed in GPS via Help/Python extensions) suggests you're looking for GPS.Entities e
where e.category()
is "object"
.
Upvotes: 2
Reputation: 8522
SciTools' Understand product can extract this information, although it's rather pricey. Though if you're working with a mound of legacy code, it's well worth the money--it has saved my bacon on more than one occasion.
Upvotes: 2
Reputation: 6430
Since you mention GPS, have you tried Tools->Documentation->Generate project? This will generate html, with hyperlinks etc, similar to Javadoc.
Upvotes: 2