Browsing a Library
Browsing a Library
This chapter illustrates Ada-ASSURED's library browsing features using
sample code provided for the purpose.
The library browser uses a database that lists the locations of named Ada constructs. Such databases are generated and maintained using separate utility programs aa.tags and maketags. File aahome/files/demo.tags contains a sample database.
Load this database into Ada-ASSURED as follows:
Query-based Browsing
Command find-name
provides a query-based browser that is useful for finding a definition
or specification in existing code when you are unsure of its name or
location. The search can be narrowed by restricting attention in
various ways: the qualified form of names, the sort of entity sought
(e.g., procedure, function, etc.), the kind of declaration (e.g.,
specification, definition, etc.), and the visible library context.
Hypertext browsing helps you find declarations by simply clicking on names in the code. Two commands are provided:
The find-spec command is bound to Alt+Select. The find-definition command is bound to Control+Select.
To locate a specification, press the Alt (or Meta) key and click Select (the left mouse button) on the name. To locate a definition, press the Control key and click Select on the name. If the name can be resolved to a unique definition, the appropriate file is opened (if necessary) and scrolled to the declaration. If the name is ambiguous, the find-name browser is popped up with an entry for each match. Names browsing is not supported for variables.
The find-spec and \commandfind-definition commands are both bound to items on the Menu (right mouse button) menu.
To locate a specification, click Menu (the right mouse button) on the name, then select Find Spec on the menu that pops up. To locate a definition, click Menu on the name, then select Find Definition on the menu that pops up. If the name can be resolved to a unique definition, the appropriate file is opened (if necessary) and scrolled to the declaration. If the name is ambiguous, the find-name browser is popped up with an entry for each match. Names browsing is not supported for variables.
X View/Buffers/Coerce Buffer... MS Window/Coerce Buffer...
The library browser's default mode for opening files can be changed by toggling Browse as TEXT in the Tools/Names Browsing menu.
Creating a Names Database
Program aa.tags makes a names database from a list of Ada source
files. Program maketags makes a names database for an entire Ada
library. Whereas aa.tags is independent of the Ada compiler you
are using, maketags depends on the specific library structure used
by your Ada compiler. For further details, see the man entries for
aa.tags and maketags.