[comp.archives] [comp.object...] Re: OO Development Environments

sdm@cs.brown.edu (Scott Meyers) (09/02/90)

Archive-name: field/27-Aug-90
Original-posting-by: sdm@cs.brown.edu (Scott Meyers)
Original-subject: Re: OO Development Environments (was: What is Objective C?)
Archive-site: wilma.cs.brown.edu [128.148.31.66]
Archive-directory: /pub/mlm
Reposted-by: emv@math.lsa.umich.edu (Edward Vielmetti)

In article <1716@dinl.mmc.UUCP> noren@dinl.UUCP (Charles Noren) writes:
>  o  cbrowse (from Brown University).  This is part of a very good
>     C++ (and C) development evironment called Field, which includes
>     an integrated development environment that runs on top of
>     X-Windows.  This is available via ftp from Brown University
>     at [128.148.32.66].

Note:  the ftp number is now 128.148.31.66.
                                     ^^
>The problem with the C++ browsers is that none them show the *SOURCE*
>of your C++ programs (except the header file info).

A non-graphical approach we (Brown University) have been exploring to
source browsing is implemented as a package for Gnu emacs.  In this
package, functions to query the FIELD database (the same database used by
cbrowse) are bound to emacs keystrokes, so it is possible to perform
queries that are dependent on the current cursor location.  For example,
given the statement,

      theSPG->_allNodes.insert(node);

you can put your cursor on any of the tokens and ask to see its declaration
or definition.  For example, if the cursor is on "insert" and you invoke
the function "XREF:find-function-def," emacs looks at _allNodes to find out
its declared type (class), then looks in that class for a declaration of a
function called insert.  If it finds it, it then locates the function
definition and opens a new buffer on that file at the approprate line.  You
can also ask to see base and derived classes; complete class interfaces
(i.e., all members defined in all base classes); and lots more.  And of
course you retain all the nifty features of Gnu emacs, i.e., multiple
buffers, electric buffers, etc..  In combination with cbrowse, this offers
a nice environment for seeing high-level relationships (in cbrowse) while
also being able to semantically manipulate source at a detailed level (in
Emacs).

The prototype implementation of the Emacs interface was written by Moises
Lejter, who'll be presenting a paper on it at the C++ at Work conference
next month.  The current implementation is slow and buggy, but still
impressive (or at least interesting).  If you're interested in giving it a
try, it's available via anonymous ftp at the above address in the file
~ftp/pub/mlm/fieldxref.tar.Z.

Scott

PS - For the record, it probably wouldn't be difficult to write code so
     that cbrowse and Emacs communicated via FIELD.  In that case, when a
     class/member was selected in cbrowse, it would notify Emacs, which
     would perform the relevant query and then update its buffer to show
     the current source.  As far as I know, however, no one here is 
     working on that.