This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: C/C++ codes searching/browsing


This is a nice direction to go in and a much needed utility.

Let me suggest a generalization.

First, let's not think about XML, and instead focus on what precisely is the
information that we wish to provide. Let's consider the possibilities. I
will use a modified XML notation below, where instead of <tag>content</tag>
I will write <tag>(content)

The first and simplest possibility is to provide token information. For
example, <keyword-int>(int), <integer constant value=50>(50), ... This would
be useful for a pretty-printer but it has serious limitations for anything
more significant.

The second level is a generalization of the first to provide grammar
information. For example,
<statement>(<expression-statement>(<lvalue>(x)<assign-op>(=)<integer
constant>(50)<semi-colon>(;))) This information is very useful in asking
almost any question, say where is "x" used as an lvalue in function "foo"

The third level could be a specialization of the second level, that would
provide output with a less complex structure than the grammar, thus making
it easier to use. For example: <function-call name="foo" nargs=5
typelist="int, float, float, int, int">(...[second-level analysis of the
statement "foo(1,7,1.25,3.14,8,1024)"])

There are a lot of design choices here and my suggestion is to think really
hard about what information we want to provide (and we can provide
efficiently), then think of a good notation that is amenable to further
processing. We could have a filter that could reformat the information
generated into XML according to some DTD, but let's not let the notation and
ways of XML restrict the kind of information we provide. My recommendation
is the second level with filters to produce third level output and XML
output. The third-level filters may be developed later on a continuing
basis.

Of course, what actually is implemented ultimately is the choice of the
implementor, so if it is more convenient for Brad to build an XML outputting
program for whatever reason, so be it. Something is better than nothing.

Thank you very much, Brad!

-----Original Message-----
From: Brad King [mailto:brad.king@kitware.com]
Sent: Wednesday, August 02, 2000 2:09 PM
To: gcc@gcc.gnu.org
Subject: Re: C/C++ codes searching/browsing


Hello Everyone,

A few weeks ago I noticed a message on this list asking about a tool to do
.
.
.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]