[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6. Language-Specific Notes

This chapter summarizes OO-Browser details that are specific to each language. There are no Smalltalk specifics.

6.1 C Specifics  
6.2 C++ Specifics  
6.3 CLOS Specifics  
6.4 Eiffel Specifics  
6.5 Java Specifics  
6.6 Objective-C Specifics  
6.7 Python Specifics  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.1 C Specifics

The br-c-tags-flag variable controls whether or not C constructs are included within C and C-based language Environments. By default, this flag is true except on operating systems where the OO-Browser cannot find a UNIX-type shell such as `sh' or `csh'. In those cases, C constructs cannot be categorized by the OO-Browser. Use `M-x br-toggle-c-tags RET' to toggle the value of this variable. If you set it false before building an Environment, then C constructs will not be included in the Environment.

If you wish to build an Environment whose source code is entirely C, ensure that the br-c-tags-flag is enabled and then select C++ when asked for the language to browse.

C constructs are grouped into default classes for browsing. The elements of each default class are the instances of the associated construct within the Environment. Use normal element/feature commands to browse each instance.

 
         DEFAULT CLASS    C CONSTRUCT
         --------------------------------------
         [constant]       #define constant
         [enumeration]    enum {}
         [enum_label]     label_name
         [function]       non-member function()
         [macro]          #define macro()
         [structure]      struct {}
         [type]           typedef {}
         [union]          union {}
         [variable]       <type> global_variable_name;

Within C, C++, or Objective-C code, an Action Key click on a reference to a global C identifier will display the identifier's definition.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2 C++ Specifics

See section 6.1 C Specifics, for details on C-specific support within C++ Environments.

6.2.1 C++ Listing Entries  
6.2.2 Source Code Element Selection  
6.2.3 C++ Settings  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.1 C++ Listing Entries

C++ entities are categorized when shown within OO-Browser listing buffers. Classes are shown by name, without any prefix. Features are shown by name but are preceded by a special character that indicates the kind of feature. The following table describes each prefix:

>
precedes pure virtual functions, which are specified but not defined within this class;
%
precedes friend functions and classes, which have access to the class' private parts;
+
precedes constructors and destructor functions;
-
precedes any other type of member function;
&
precedes static attributes (one attribute per class);
=
precedes instance attributes (one attribute per object instance).

The following paragraphs discuss each of these types of features in more detail.

C++ pure virtual function declarations, which specify method interfaces but no implementations, appear in class feature listings. Their function names are preceded by the "> " string to identify them as pure virtual (deferred) functions. Pure virtuals may be treated like any other member functions within the browser. Since they lack definitions within their base classes, their declarations are shown when a view or edit command is given.

Friend functions and friend classes give members of another class access to the private parts of their class. Friend functions and classes appear in class feature listings preceded by the "% " string. The keys, {v} or {e}, display the friend declaration within the current class. Use {V} (br-view-friend) in a listing window to view the definition of the friend itself. If you use {e}, which leaves point on the friend declaration, a press of the Action Key will then move to the definition of the friend itself.

Methods and operators for creating and destroying objects are preceded by the "+ " string in listing buffers. All other method listing entries are preceded by the "- " string.

Static attributes (data members instantiated once per class) are shown preceded by the "& " string regardless of their types. Instance attributes (data members instantiated at each object creation) are shown preceded by the "= " string regardless of their types.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.2 Source Code Element Selection

Once you have loaded an Environment, whether or not the OO-Browser user interface is on screen, you can use the Action Key to follow a variety of references within the code. Simply press the Action Key on an identifier or C++ construct and its associated definition or list of possible definitions or its declaration (if no definitions exist within the Environment) will be displayed for you to inspect or edit. More specifically:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.3 C++ Settings

By default, `class', `struct' and `union' definitions all constitute class definitions to the C++ OO-Browser. If you prefer some other criteria, you will need to modify the definition of c++-class-keyword in the `br-c++.el' file.

If you find that the browser is not scanning some of your C++ source files, you may be using file suffixes which it does not recognize. Examine the value of c++-src-file-regexp and add to it any special file suffixes that you use.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.3 CLOS Specifics

6.3.1 Method Handling  
6.3.2 CLOS Settings  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.3.1 Method Handling

In CLOS, methods may have explicitly typed parameters of the form, `(<parameter-name> <class>)'; these are called specialized parameters. Each such parameter defines the method within `<class>'. Thus, a single method definition can generate methods associated with many classes. The OO-Browser lets you navigate to a method definition from any of the classes for which it is defined, since a method is included as an element of each of its constituent classes.

CLOS permits compile-time computation of the `<class>' of a specialized parameter through use of the expression, `(eql <form>)'. Since the OO-Browser cannot perform this computation, it treats such a parameter as non-specialized.

Methods may also contain non-specialized parameters of the form, `<parameter-name>'. The type of each such parameter defaults to the built-in root class, `t'. But a method is included in the class `t' by the OO-Browser only if none of its parameters are specialized. Otherwise, methods with more specific types which happened to include one or more non-specialized parameters would appear to not have a more specific type than `t'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.3.2 CLOS Settings

The OO-Browser automatically works with CLOS class and method definitions. But Lisp contains many other standard object types such as functions, macros and variables which you may wish to browse. These are handled through a configuration variable as explained below.

The clos-element-type-alist variable determines the Lisp definition constructs that the browser looks for and the associated default class under which instances of each construct type are grouped. Each element in the association list is a dotted pair whose first part is the function name string that defines an instance of a particular type, e.g. `"defun"'.

The second part is a default class name, a string, under which to assign each instance of the type, e.g. `"function"'. The OO-Browser always displays default class names with square brackets around them, e.g. `[function]', to distinguish them from classes defined within the Environment.

Here is the standard value of clos-element-type-alist.

 
(("defconstant"  . "constant")
 ("defconst"     . "constant")
 ("defun"        . "function")
 ("defgeneric"   . "generic")
 ("defmacro"     . "macro")
 ("defpackage"   . "package")
 ("defparameter" . "parameter")
 ("defsetf"      . "setfunction")
 ("defstruct"    . "structure")
 ("deftype"      . "type")
 ("defvar"       . "variable")
 ("fset"         . "function"))

The clos-def-form-with-args-regexp is a regular expression which includes a subset of the first items from the dotted pairs of clos-element-type-alist, namely those which require an argument list to uniquely distinguish them from other elements, e.g. functions.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4 Eiffel Specifics

Eiffel support has now been updated to Eiffel version 3, to the best of our knowledge. If you find any problems, please report them to <oo-browser-bugs@xemacs.org>.

6.4.1 Eiffel Listings  
6.4.2 Source Code Element Selection  
6.4.3 Eiffel Settings  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4.1 Eiffel Listings

Eiffel entities are categorized when shown within OO-Browser listing buffers. Classes are shown by name, without any prefix. Features are shown by name but are preceded by a special character that indicates the kind of feature. The following table describes each prefix:

-
precedes regular routines;
=
precedes attributes;
1
precedes once routines, which create shared objects;
>
precedes deferred features, which are specified but not defined within this class;
/
precedes external features, which are defined in a non-Eiffel language.

A detailed summary of a class may be generated with point on a class entry by pressing {i} (br-entry-info). By default, this shows a summary including the parents, attributes, routines and routine call summaries of the class. The command `M-x eif-info-use-short RET' instead causes the {i} key to run the Eiffel `short' command on the class, thereby displaying its specification. The command `M-x eif-info-use-flat RET' enables use of the `flat' command to the complete feature set of a class. `M-x eif-info-use-calls RET' resets the key to generate default summaries once again.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4.2 Source Code Element Selection

You can jump from an Eiffel element reference to its definition by clicking the Action Key on the reference. Selection of a feature name in an export clause displays the feature definition, even if it is renamed several times within ancestors. Parent classes may be browsed in a similar manner by clicking on their names in an inheritance or declaration clause.

The following example of locating a renamed feature is taken from an actual set of Eiffel library classes:

 
The user selects feature `subwindow' of POPUP_MENU
   inherited from WINDOW which renames `child' to `subwindow'
      inherited from TWO_WAY_TREE which renames `active' to `child'
         inherited from TWO_WAY_LIST
            inherited from LINKED_LIST which defines `active'.

The browser displays the feature active and explain to the user that feature subwindow of class POPUP_MENU is inherited from feature active of class LINKED_LIST. Location of this sort of feature definition would be incredibly tedious without programmatic support.

The algorithm used to locate features is dynamic, so if another class is inserted into the inheritance structure given above, the feature definition will still be found.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.4.3 Eiffel Settings

Emacs has a feature called error parsing which lets you quickly jump to the line of code that supposedly triggered an error. See section `Compilation Errors' in the XEmacs Manual, for information on error parsing. Some object-oriented language compilers display the name of the class and line number with each error message but do not include the filename containing the class source code. Emacs then has no way of parsing the error message. The browser class location facilities enable you to perform error parsing across any set of classes in a single Environment, given only this type of message. Interactive Software Engineering's Eiffel compiler is an example of a compiler that (at least at one time) produced this type of error. The code for parsing ISE Eiffel error messages is included in `eif-ise-err.el'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5 Java Specifics

The OO-Browser browses Java classes, interfaces, methods, and attributes. Earlier sections of this manual explain how to browse these entities. This section documents Java language specifics, including variable settings.

By default, Java Environments also include C constructs encountered when building each Environment. See section 6.1 C Specifics, for details on C-specific support within Java Environments.

Java entities are categorized when shown within OO-Browser listing buffers. Classes are shown by name, without any prefix. Interfaces are delimited by <angled brackets>. The following table describes the prefixes that preced each feature listing entry:

=
precedes attributes;

-
precedes regular methods;

+
precedes methods associated with creating and destroying objects;

>
precedes abstract method declarations; Abstract (deferred) methods may be treated like any other methods within the browser. Since there is no definition for such methods, their declarations are shown whenever an edit or view request is issued.

/
precedes native methods, to indicate that such methods are divided between Java and another language; Native methods are like abstract methods in that only their interfaces are specified in Java. Unlike abstract methods, their method bodies are defined in external languages such as C to allow for machine-specific dependencies.

Java interface specifications, which define formal protocols to which classes must conform, are treated just like class definitions in browser listings. All the methods of such interfaces are abstract, however.

6.5.1 Java Interfaces  
6.5.2 Source Code Element Selection  
6.5.3 Java Settings  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.1 Java Interfaces

A Java interface specifies a formal protocol (set of method signatures and attributes) to which a class (the implementor) that uses the interface must conform. A class conforms to the interface by inheriting its attributes and by implementing the method bodies whose calling signatures are given by the interface. The class' descendants automatically conform to the interface through inheritance; they are considered descendants of the interface but not implementors of it. One interface may inherit from a list of other interfaces and thereby expand the set of methods which a conforming class must implement.

The OO-Browser can list and browse the source for:

the interfaces to which a class or an interface conforms
(press {P} on a class or interface listing entry);

all interfaces in an Environment
(press {f} on the [interface] default class entry);

the implementors of a interface
(press {I} on a interface listing entry).

See section 2.10 Browsing Protocols, for more details.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.2 Source Code Element Selection

You can jump from a Java class method declaration to its definition by clicking the Action Key when within the declaration. If a method is inherited from another class, a message at the bottom of the frame will announce the defining class whenever its definition is requested.

Parent classes and interfaces may be browsed in a similar manner by clicking on their names in an inheritance or declaration clause. It is therefore important to click on the method name part of a declaration when that is the element desired.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.3 Java Settings

The regular expression java-class-keyword defined in `br-java.el' determines which keywords are used to locate class and interface definitions within the Java OO-Browser.

If you find that the browser is not scanning some of your Java source files, you may be using file suffixes which it does not recognize. Examine the value of java-src-file-regexp and add to it any special file suffixes that you use.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.6 Objective-C Specifics

See section 6.1 C Specifics, for details on C-specific support within Objective-C Environments.

The OO-Browser browses Objective-C classes, methods, categories and formal protocols. Earlier sections of this manual explain how to browse these entities. This section documents Objective-C language specifics, including variable settings.

Objective-C entities are categorized when shown within OO-Browser listing buffers. Classes are shown by name, without any prefix. Categories are delimited by (parentheses), while protocols are delimited by <angled brackets>. Methods are shown by name but are preceded by a special character that indicates the kind of method. The following table describes each prefix:

-
precedes instance methods;
+
precedes class (factory) methods that affect the factory object for the class.

6.6.1 Objective-C Categories  
6.6.2 Objective-C Protocols  
6.6.3 Source Code Element Selection  
6.6.4 Objective-C Settings  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.6.1 Objective-C Categories

An Objective-C category is an internal class grouping that specifies and implements a set of related class features. The aggregation of all of the categories defined by a class and its ancestors represents the complete class definition.

The OO-Browser can list and browse the source for:

the categories of a class
(press {C} on a class listing entry);

all class categories in an Environment
(press {f} on the [category] default class entry);

the classes which implement a category
(press {I} on a category listing entry).

See section 2.9 Browsing Categories, for more details.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.6.2 Objective-C Protocols

An Objective-C protocol is an interface specification (set of method signatures) to which a class (the implementor) that uses the protocol must conform. A class conforms to the protocol by implementing the method bodies whose calling signatures are given by the interface. The class' descendants automatically conform to the protocol through inheritance; they are considered descendants of the protocol but not implementors of it. One protocol may inherit from a list of other protocols and thus expand the set of methods which a conforming class must implement.

The OO-Browser can list and browse the source for:

the protocols to which a class or a protocol conforms
(press {P} on a class or protocol listing entry);

all protocols in an Environment
(press {f} on the [protocol] default class entry);

the implementors of a protocol
(press {I} on a protocol listing entry).

See section 2.10 Browsing Protocols, for more details.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.6.3 Source Code Element Selection

You can jump from an Objective-C class method declaration to its definition by clicking the Action Key when within the declaration. If a method is inherited from another class, a message at the bottom of the frame will announce the defining class whenever its definition is requested.

Parent classes and protocols may be browsed in a similar manner by clicking on their names in an inheritance or declaration clause. It is therefore important to click on the method name part of a declaration when that is the element desired.

Include files may be browsed by selecting their inclusion declarations (#import ...) or (#include ...) within a source file. Include files delimited by double quotes are searched for in the following places: first, the directory of the current source file, then the directories listed in the variable objc-include-dirs, and then in any directories included in the current environment.

Include files delimited by angled brackets are searched for in the following places: first, the directories listed in the variable objc-include-dirs, then the directories listed in the variable objc-cpp-include-dirs, and then in any directories included in the current environment. The variable objc-cpp-include-dirs should be set to a list of the standard directories searched by your Objective-C pre-processor. Each directory entry must end with a directory separator. On UNIX systems, this is the `/' character.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.6.4 Objective-C Settings

The regular expression objc-class-keyword defined in `br-objc.el' determines which keywords are used to locate class and protocol definitions within the Objective-C OO-Browser.

If you find that the browser is not scanning some of your Objective-C source files, you may be using file suffixes which it does not recognize. Examine the value of objc-src-file-regexp and add to it any special file suffixes that you use.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.7 Python Specifics

See section 6.1 C Specifics, for details on C-specific support within Objective-C Environments.

The OO-Browser can list and browse the source for the following Python constructs:

packages
(press {f} on the [package] default class entry to list all of the packages in the Environment, each of which is preceded)

modules
(press {f} on the [module] default class entry to list all of the modules in the Environment)

classes
(press {f} on a class entry to see its methods; there is no support for browsing its instance variables except by viewing the class' __init__ method definition)

functions
(press {f} on the [function] default class entry to list the non-member functions defined in the Environment; this includes C functions)

globals
(press {f} on the [global] default class entry to list all of the globals defined in the Environment)

Note that nested classes are not recognized by the browser, nor are run-time modifications to classes.

Documentation for the Python listing entry on the current line may be displayed with the {i} (br-entry-info) command. This displays documentation for packages, modules, classes, functions and methods. It utilizes the `pydoc.el' interface to the Python pydoc library, when available, to provide extended documentation but it will nevertheless display basic documentation strings if this package is not installed.

An Action Key press on a Python import or from statement will display the source of the item under point, which may be a module, class, method, function or variable name, if the source is found within the current Environment. First, the module is searched for within the current Environment directories. If it is not found, it is searched for within the paths listed in the variable, python-import-dirs, which is initialized to the value of the PYTHONPATH environment variable or if that is not defined, to `/usr/local/lib/python'.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by XEmacs shared group account on December, 19 2009 using texi2html 1.65.