home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
browser2.zip
/
INSTALL
< prev
next >
Wrap
Text File
|
1995-02-17
|
9KB
|
256 lines
Copyright (c) 1993-1995 Gerd Moellmann
$Id: INSTALL,v 3.1 1995/02/17 18:21:38 mmann Exp $
C++ SOURCE CODE BROWSER v3.1
INSTALLATION INSTRUCTIONS
MS-DOS users, please read INSTALL.DOS instead
Overview
--------
I am myself working in C++ commercial software projects for several
years now, and in these projects I always missed software support for
two things:
When a new class library is introduced or you have to work on some
source code you haven't written yourself (or written sufficiently long
ago) you need a tool letting you navigate through class hierarchies
and investigate features of the software. Without such a tool you often
end up grep'ing through dozens or even hundreds of files.
Once you are productive, it would be nice to have a tool that knows your
sources and can help you while you are editing source code. Imagine to
be able to jump to the definition of an identifier while you are
editing, or something that can complete long identifier names because it
knows what identifiers are defined in your program...
The design of the C++ class browser reflects these two needs;
therefore the name class browser is really only half the truth.
How does it work?
A fast parser written in C is used to parse C++ source and header
files. The parser generates a database containing information about
identifiers---classes, members, global functions, types etc.
The second part of the C++ browser is a Lisp program. This package
reads the database generated by the parser; it displays its contents
in various forms and allows you to perform operations on it, or with
the help of the knowledge contained in it.
The "navigational" use of the browser is centered around two main
buffer types which define their own major modes:
"Tree buffers" are used to view class hierarchies in tree form. They
allow you to quickly find classes, find or view a class declaration,
perform operations like query replace on sets of files containing
classes, and finally they are used to produce the second buffer form:
member displays.
Members are displayed in "member buffers". The browser distinguishes
between six different types of members; each type is displayed as a
member list of its own:
* Instance member variables,
* Instance member functions,
* Static member variables,
* Static member functions,
* Friends,
* Types (enums, and typedefs defined with class scope.
You can quickly switch member buffers from one list to another, or to
another class, you can include inherited members in a display, you can
set filters, and most important of all you can edit or view member
declarations and definitions with a keystroke.
These two buffer types and the commands they provide support the
"navigational" use of the browser. The second form resembles the
"tags" package for C and some other procedural languages that is part
of the standard Emacs distribution; its commands are not bound to
special buffer types but are most often used while you are editing
your source code.
To list just some of what you can use the @dfn{tags} part of the browser
for:
* Quickly jump to the definition or declaration of an
identifier in your source code.
* Complete identifiers in your source---just type in a few
characters and let Emacs fill in the rest.
* Perform search and query replace operations over some
or all of your source files.
* Show all identifiers matching a regular expression---and
jump to one of them, if you like.
The browser has already been used in projects containing hundreds of
classes. The maximum project size that has been successfully tried so
long was about 500,000 lines of code. With Emacs 18.55 it runs on an
MS-DOS notebook with 4 Mb of RAM and has no problems to handle
projects up to about 70,000 lines of code.
Prerequisites
-------------
To use the source code browser you need at least:
- Emacs 18 or 19 installed on your system,
- a C compiler to compile the C part of the browser (GCC is
fine of course),
- `gzip' unpacker to decompress the source archive,
- a `tar' to unpack the files in the archive.
Installation
------------
It is recommended to install the package outside of the Emacs
directory tree to make upgrading both Emacs or the browser easier.
Choose a place where the browser package should go, make a directory
with a name of your choice, e.g. `browser'
cd xy
mkdir browser
cd browser
Copy the C++ browser archive to this directory and unpack it:
cp wherever/cppbrwsr.tar.gz .
gzip -d cppbrwsr.tar.gz
tar xvf cppbrwsr.tar
rm *.tar
This will create the following files in the `browser' directory:
br-*.el Lisp source files for the Lisp part of the
browser.
cl*.el Lisp source files for the Emacs Common Lisp
compatibility package (this is only needed
if you are Emacs 18, since you should already
have it if you're using Emacs 19).
by*.el Lisp source files for a modified version of the
Emacs 19 optimizing byte compiler. This is only
needed for Emacs 18).
*.c, *.h C source files for the C part of the browser
makefile A makefile for DMAKE 3.8 (you can compile the
C sources without using this).
README A readme file.
INSTALL The file you are currently reading.
INSTALL.DOS Installation instructions for MS-DOS users.
COPYING A copy of the GNU General Public License.
Compiling under OS/2
--------------------
The C part of the browser has been compiled with GNU C (EMX 0.9a) and
IBM C Set++ 2.1 under OS/2 Warp. If you have DMAKE 3.8 available, use
the following commands to compile:
IBM C Set++ -> dmake CC=icc
EMX 0.9a -> dmake
If you don't have DMAKE, use the commands (long lines shown with
backslash at the end):
IBM C Set++ -> icc -Q+ -O -B"/noe" -DOS2=1 -Feebrowse.exe \
lex.c parse.c sym.c setargv.obj
EMX 0.9a -> gcc -O2 -DOS2=1 -DPROTOTYPES \
lex.c parse.c sym.c -o ebrowse.exe
Copy `ebrowse.exe' to a directory in your PATH, e.g. to the `bin'
directory of your Emacs installation.
Compiling under Unix
--------------------
There should be no problems compiling `ebrowse' under UNIX since the
program doesn't contain OS specific code. If you are using an ANSI
compatible compiler, define the macro `PROTOTYPES' on the command
line:
gcc -O2 -DPROTOTYPES lex.c parse.c sym.c -o ebrowse
If there are problems compiling under UNIX I would be interested to
hear of them so that I can fix the sources.
Compiling the Lisp Part (Emacs 19)
----------------------------------
Make sure that your Emacs has the Lisp compatibility package
installed. If necessary, add the compile the files with the prefix
`cl' in your Emacs Lisp directory and add the line
(require 'cl-19 "cl")
to your Emacs startup file `.emacs' (located in your `$HOME'
directory).
To compile the Lisp part of the browser, compile and load the files
br-macro.el
br-struc.el
from inside Emacs (the easiest way to do this in Emacs 19 is to open a
dired buffer and use the command `B'). After loading the compiled
files `br-macro.elc' and `br-struc.elc', compile the rest of the Lisp
files that start with the `br-' prefix.
The optimizing compiler of Emacs 19 will display a number of warnings
during the compilation process, which can be ignored (it warns about
the usage of buffer-local variables, and I didn't find a way to turn
this useless warning off).
Modifying your Emacs Startup File `.emacs'
------------------------------------------
After compiling, modify the Emacs Lisp load path to include the
directory the browser was installed in:
(setq emacs-load-path
(append '("xyz/browser") emacs-load-path))
and add the following lines, following the `require' of the CL-19
package:
(require 'browse "br-brows")
(require 'br-utils)
Installing the Documentation
----------------------------
Compile the Texinfo file `browser.texi' using the command line
makeinfo browser.texi
and modify the info search path to include the browser directory:
(setq Info-directory-list
(append '("xyz/browser") Info-directory-list))
Load the file `dir' located in the `info' directory of your Emacs
installation and add a line at the end of the file (omit the
quotee):
`* Browser: (browser). C++ Browser'
(make sure there is a newline at the end of the file). Save `dir' to
disk. You should now be able to select the browser documentation in
the Info browser of Emacs (`\C-h i).
--- end of file ---