From: "Eric M. Ludlam" <eric@siege-engine.com>
To: rms@gnu.org
Cc: cyd@stupidchicken.com, raeburn@raeburn.org, deng@randomsample.de,
emacs-devel@gnu.org
Subject: Re: CEDET merge question
Date: Sun, 13 Sep 2009 13:38:51 -0400 [thread overview]
Message-ID: <1252863531.4770.230.camel@projectile.siege-engine.com> (raw)
In-Reply-To: <E1Mms6s-0007Ur-BU@fencepost.gnu.org>
On Sun, 2009-09-13 at 12:39 -0400, Richard Stallman wrote:
> A very similar question to "why not make bison support Emacs Lisp
> output", is "why not have gcc support tagging output".
>
> Could you please explain what you mean by that?
Sure.
Etags, ctags, gnu global, idutils and cscope all have parsers of some
sort that parse C and C++ code. Some use regexp matchers. Others have
primitive parsers.
gcc, of course, has a full language compliant parser which it uses to
compile code. I'm not a gcc expert, but I assume that as it parses, it
keeps track of the various symbols (functions, variables, namespaces,
etc) and where they are. (ie - debug info for gdb).
As such, it should be possible for gcc to easily output text
representing a tags file. Etags style would be fairly simple. The
output of exuberant ctags is more complex. The data needed by CEDET is
more complex still, but is still a subset of everything that gcc needs
to know.
For CEDET, if gcc saw this file:
-------------
int main(int argc, char *argv[]) {
}
-------------
it would be handy (for my application) for it to output:
--------------
(("main" function
(:arguments
(("argc" variable (:type "int") [ 11 20 ])
("argv" variable (:pointer 1 :dereference 1 :type "char")
[ 21 34] ))
:type "int")
[2 38]))
---------------
though, to be honest, any text output that is very regular would be
fine.
The part that makes this imperfect is that in Emacs, a file that needs
parsing may be in the middle of an edit. Handling these cases can be a
bit tricky for my simplified parser, and gcc doesn't have that editing
information available.
To handle this, the CEDET tools have different ways to parse files, such
as "on save", and can track when a file is unparsable and take alternate
actions when that happens.
Eric
next prev parent reply other threads:[~2009-09-13 17:38 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-05 16:28 CEDET merge question Chong Yidong
2009-09-05 17:22 ` David Engster
2009-09-05 20:53 ` Chong Yidong
2009-09-05 23:08 ` David Engster
2009-09-06 15:37 ` Richard Stallman
2009-09-06 17:46 ` Ken Raeburn
2009-09-06 21:11 ` David Engster
2009-09-06 22:26 ` Ken Raeburn
2009-09-07 13:33 ` Richard Stallman
2009-09-12 12:49 ` Eric M. Ludlam
2009-09-12 13:37 ` Miles Bader
2009-09-13 16:39 ` Richard Stallman
2009-09-14 11:22 ` tomas
2009-09-14 12:15 ` Miles Bader
2009-09-14 20:04 ` tomas
2009-09-12 16:34 ` David Engster
2009-09-13 16:39 ` Richard Stallman
2009-09-13 17:38 ` Eric M. Ludlam [this message]
2009-09-14 18:28 ` Richard Stallman
2009-09-13 16:40 ` Richard Stallman
2009-09-07 13:34 ` Richard Stallman
2009-09-08 8:11 ` joakim
2009-09-08 9:07 ` Lennart Borgman
2009-09-08 9:09 ` Lennart Borgman
2009-09-08 14:41 ` Chong Yidong
2009-09-08 15:10 ` joakim
2009-09-08 17:18 ` Chong Yidong
2009-09-08 21:21 ` Romain Francoise
2009-09-08 22:27 ` Chong Yidong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1252863531.4770.230.camel@projectile.siege-engine.com \
--to=eric@siege-engine.com \
--cc=cyd@stupidchicken.com \
--cc=deng@randomsample.de \
--cc=emacs-devel@gnu.org \
--cc=raeburn@raeburn.org \
--cc=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.