3

Sup bros,

Is there anything out there for C++ which displays the class hierarchies as a tree on the left panel? I've been using VisualWorks Smalltalk for a while, and the way that classes are displayed, and methods broken out, makes it very easy to build a mental picture of what the class does. Sadly, I can't find anything similar for C++. Does Eclipse perhaps have such a mode?

Thanks, frapple_hok

Benjamin Pollack
  • 27,594
  • 16
  • 81
  • 105
  • This is a dupe of http://stackoverflow.com/questions/24109/c-ide-for-linux. – Robert Gamble Nov 30 '08 at 17:50
  • See also http://stackoverflow.com/questions/86676/is-there-a-good-and-free-ide-for-cc-in-linux. – Robert Gamble Nov 30 '08 at 17:51
  • I'd specifically like a class hierarchy view, and if possible, methods broken out a la visualworks smalltalk... I didn't it was all that similar :-( –  Nov 30 '08 at 17:56
  • I'll open this back up since you don't feel the other questions addressed your specific concern but I suggest you modify the title to better reflect what you are looking for to avoid this being closed again. – Robert Gamble Nov 30 '08 at 17:59

3 Answers3

1

Unfortunately C++ doesn't lend itself to this sort of class browser for two reasons:

  • There is no central repository or image with all of the active classes in it. The class definitions are spread around many files.

  • Class definitions and files live in a M:M relationship. Not all of a class is necessarily defined in a single file and one file can have code for more than one class.

On Linux, KDevelop, Eclipse and various others all have C++ support and a greater or lesser degree of support for the introspection that is possible on an arbitrary base of C++ source code.

You might also get some mileage from ctags, which analyses the source code files and identifies the definitions for types, classes, members etc. This can be used with any decent editor such as vim, emacs or many other editors and IDE's. From a source code editor that supports tags, you can place the cursor over a reference and jump to its definition. It's not quite as good as Inspect but you don't really have the concept of a running image. The closest you will get to that is a debugger such as DDD.

ConcernedOfTunbridgeWells
  • 64,444
  • 15
  • 143
  • 197
  • Nice theory but wrong, Object Master did a superb implementation of this over twenty years ago, dealing seamlessly with the storage of code in files, parsing as it went and including individual method structural checking - you couldn't save a malformed method! http://www.artima.com/weblogs/viewpost.jsp?thread=158259 – Andy Dent May 26 '11 at 02:38
0

There are at least two options I'm aware of:

  1. OO Browser, whose entire purpose is to bring Smalltalk-style browsers to other languages. I do not know how well the project is maintained, but despite its rather lackluster appearance, it worked extremely well the last time I tried to use it (which would've been about three years ago).
  2. Code Browser, which is designed to provide generic ways to navigate through, and manage, complex code hierarchies. It provides many ways to view code, but one of them is indeed the Smalltalk browser model (e.g., take a look at this screen shot of the Code Browser editing itself)
Benjamin Pollack
  • 27,594
  • 16
  • 81
  • 105
  • Thanks for the links. Unfortunately, Code Browser looks fabulous but requires a huge amount of work - it includes very little automated parsing (see its folder tool) and achieves all that lovely Smalltalk-style browsing by having much markup in the source file. Worse, whilst the source is available it is written in a niche programming language - Zinc. – Andy Dent Feb 19 '12 at 14:34
0

Caveat emptor: I've never used this tool myself. (Though perhaps I'll start...)

From long experience I've learned that I can put "emacs" + anything into google and find it. (Literally anything! Some people have waayyy too much free time on their hands...)

In this case, "emacs class browser" turns up EBROWSE, which might be what you are looking for.

In terms of a "left panel", emacs supports splitting a single window up vertically (split-window-vertically) or horizontally (split-window-horizontally) however you like. Or using multiple windows if you prefer (make-frame-command).

In terms of more typical IDE features, emacs supports font-locking (colorizing), make integration (jump to error), gdb integration (debugging), language-based auto-indent, TAGS [etags] (jump to tag definition), diff'ing two files (or file against revision), checkin/checkout to/from source code revision systems, spell-checking, etc. (I'm sure other stackoverflow entries have highlighted emacs's many features. Or try slashdot. Definitely check out the "complete" function! (require 'completion) And perhaps "align-regexp" too!)

Mr.Ree
  • 8,320
  • 27
  • 30