12 "Silent Bob", actually, it can be drawn an analogy with three programs, which
13 leaded to its creation, ctags, cscope, ctree( first I'll describe them, and
14 their problems, and then - their differences from "Bob").
16 Description of some programs ( on which motives SilentBob was written)
18 Let's take, for example, such well-known program as ctags, probably you've
19 used it and you know it's main point of work. It simply creates special file,
20 which stores information about some source files. Usually it's OS kernels and
21 other big programs, like sendmail or apache. This file contains:
22 1. "Addresses" of all functions, structures, macroses, etc. "Address" means
23 file name + string number (or regular expression, using which an appropriate
24 string can be found). That file, for example, in Vim, can be used to evaluate
25 ":tag <name>" to make a quick switch. Also ctags allows to extract "goodies"
26 from files - simply to find out its contents.
28 csope - very useful program, it doesn't create file, described above, but can
29 do search and has some additional features:
30 1. Interface for "comfortable" search.
31 2. It can trace which functions called and what does they call (one layer
33 3. It also can trace who calls certain functions (one layer "upper")
34 And some other feature, which I have never used...
36 And at last - ctree. Theoreticaly, it can show all above described information
37 several layers "lower". Practically I couldn't turn it on.
39 Problems of existing software
42 For "tags" file creation regular expressions are used, which allows to add
43 other languages, but places a substantial limits:
44 1. Quality of received information is quite low.
45 2. Information, which we receive, in "interactive" mode is not full enough.
46 3. Support for C++ is present, but not quite good.
49 Actually, all ctags problems, plus:
50 1. Base, which actually doesn't needed anybody, but "weights" 150 Mbytes (for
51 Linux 2.6.14 for example)
52 2. Quality of "interactivity" is not good enough
53 3. Support for C++ is absent. This is not good, because problems, which this
54 kind of software is called to solve, lies down to different libraries,
57 In SilentBob this problems are absent. Program uses preprocessor (written by
58 me) either than regular expressions.
60 Main ideas of SilentBob
62 Preprocessor, which is described above, is called "THE_TT" and placed in
64 Actually it's quite simple: it removes all "extras" from C/C++ source. It
65 removes/minimizes all variants of C code notations, removes all extra space
66 symbols and comments, adds additional spaces where it's necessary (for
67 example, before brackets). THE_TT allows to take some part of code and
68 exactly (about 99%) tell you what is it, using minimum of checks.
69 All it works quite fast (for example, 1.6 GHz processor, 256 Mb of RAM - works
70 excellent), which allows to do some interesting things. As far as I know,
71 such kind of code usually is written only to compilers and isn't used for
72 other things, what, as for my view, isn't good enough.
74 Next SilentBob's level - "t_op", "what_is_this" and alike functions. First of
75 them simply allows to enumerate all "operators" of source code, second -
76 checks, what kind of operator do we met. Actually, "what_is_this" isn't
77 quite enough for all, so some additional functions exists... Now, THE_TT and
78 t_op are two separate parts of program. In future I plan to unite them...
80 It took from me for about one month to develop current version (1.0-rc1) and
81 two months for testing, finding out bugs, etc.
84 ("life story", "blog" )
86 SilentBob was written one dark night, when one Siberian fellow tried to
87 understand how sys_poll system call works. After some time of digging the
88 sources and several tanks of drinked beer, this fellow understood, that
89 abilities of Gvim only isn't quite enough. Some tricks was made - they helped
90 a little, but this wasn't the solution.
91 Then, some other popular programs was used. After several tries fellow
92 understood, that he received the access to function he needs. But only one
93 function. If you take into account, that such calls, let's say, not only one
94 in program - you can imaging fellows indignation.