~ubuntu-branches/debian/lenny/ecb/lenny

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<html lang="en">
<head>
<title>ECB - the Emacs Code Browser</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name=description content="ECB - the Emacs Code Browser">
<meta name=generator content="makeinfo 4.2">
<link href="http://www.gnu.org/software/texinfo/" rel=generator-home>
</head>
<body>
<p>
Node:<a name="Using%20semanticdb">Using semanticdb</a>,
Previous:<a rel=previous accesskey=p href="Tree-buffer-styles.html#Tree-buffer%20styles">Tree-buffer styles</a>,
Up:<a rel=up accesskey=u href="Tips-and-tricks.html#Tips%20and%20tricks">Tips and tricks</a>
<hr><br>

<h3>Using semanticdb to jump to type-tags defined in other files</h3>

<p>In OO-languages like CLOS, eieio and C++ there can be type-tags in the
method-buffer which are somehow virtual because there is no definition
in the current source-file. But such a virtual type collects all its
outside defined members like methods in C++ which are defined in the
<code>*.cc</code> file whereas the class-definition is defined in the
associated header-file. ECB uses semanticdb to open the definition-file
of such a tag and to jump to the definition of this tag. Same for
parent-tags in the methods-buffer. This feature can only work
correctly if semanticdb is well configured!

<p>Here is a C++-example:

<p>This class is defined in a file <code>ParentClass.h</code>:

<br><pre>class ParentClass
{
protected:
  int p;
};
</pre>

<p>This class is defined in a file <code>ClassWithExternals.h</code>

<br><pre>#include "ParentClass.h"

class ClassWithExternals : public ParentClass
{
private:
  int i;

public:
  ClassWithExternals();
  ~ClassWithExternals();
};
</pre>

<p>Both the constructor and the desctructor of the class
"ClassWithExternals" are defined in a file
<code>ClassWithExternals.cc</code>:

<br><pre>#include "test.h"

ClassWithExternals::ClassWithExternals(int i,
                                       boolean b,
                                       char c)
{
  return;
}

void
ClassWithExternals::~ClassWithExternals()
{
  return;
}
</pre>

<p>ECB displays the contents of <code>ClassWithExternals.cc</code> in its methods-buffer like
follows:

<br><pre>[-] [Includes]
 `- test.h
[-] ClassWithExternals
 |  +ClassWithExternals (+i:int, +b:class boolean, +c:char):ClassWithExternals
 `- +~ClassWithExternals ():void
</pre>

<p>Both the constructor and the desctructor of the class
"ClassWithExternals" are grouped under their class-type. ECB now
uses semanticdb to jump to the definition of class
"ClassWithExternals" when you click onto the type-node
"ClassWithExternals" in the methods-buffer.

<p>The contents of <code>ClassWithExternals.h</code> are displayed like
follows:

<br><pre>[-] [Includes]
 `- ParentClass.h
[-] ClassWithExternals:class
 |  [-] [Parents]
 |   `- ParentClass
 |  [-] [Variables]
 |   `- -i:int
 |  +ClassWithExternals ():ClassWithExternals
 |  +~ClassWithExternals ():void
 `- [+] [Misc]
</pre>

<p>ECB uses semanticdb to jump to the definition of the class
"ParentClass" when you click onto the node "ParentClass".

<p>To enable this feature <code>global-semanticdb-minor-mode</code> must be
enabled and semanticdb must be correctly configured. This means
mainly that the option <code>semanticdb-project-roots</code> must be setup
well. See the manual of semanticdb for further informations about
this.

</body></html>