unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Engster <deng@randomsample.de>
To: eric@siege-engine.com
Cc: cyd@stupidchicken.com, raeburn@raeburn.org, rms@gnu.org,
	emacs-devel@gnu.org
Subject: Re: CEDET merge question
Date: Sat, 12 Sep 2009 18:34:49 +0200	[thread overview]
Message-ID: <87vdjoruja.fsf@engster.org> (raw)
In-Reply-To: <1252759780.4770.76.camel@projectile.siege-engine.com> (Eric M. Ludlam's message of "Sat, 12 Sep 2009 08:49:40 -0400")

Eric M. Ludlam <eric@siege-engine.com> writes:
> On Mon, 2009-09-07 at 09:33 -0400, Richard Stallman wrote:
>> CEDET uses Bison grammars which are extended through "Optional Lambda
>>     Expressions" (OLE). They produce the actual tags, which are the basic
>>     objects resulting from the parsing stage. I don't think this can be
>>     easily replaced by Bison itself or Guile.
>> 
>> Why is it hard to add these to Bison?
>> It can handle embedded C code, so why not embedded Lisp code?
>> It should be straightforward to make such changes.

[...]

> A very similar question to "why not make bison support Emacs Lisp
> output", is "why not have gcc support tagging output".
>
> If gcc supported a tagging output format with the details needed for
> CEDET to get its job done, it could just call out to gcc instead of
> parsing it in Emacs.  CEDET would then magically support a lot more
> languages.

Yes, I think that would be the way to go. Some time ago, I looked at a
way to add Fortran 90/95 parsing to CEDET. It seems there's no free
Bison grammar out there, but there is for example g95-xml [1], which
apparently reuses the g95 parser and produces a XML output file, which
could then be converted to Emacs Lisp tags. Also, in gfortran, there is
a debug option '-fdump-parse-tree', which seems to produce an output
almost usable by Semantic (most importantly, it's missing any source
code information like line numbers, etc.).

Similar to g95-xml, there's gcc-xml [2], which uses gcc's C++ parser to
output a XML file. But it seems its development has stalled, and it
currently can't parse templates, for example.

One problem with this approach is how the parser reacts to 'code in
progress', meaning syntactically incorrect code which is, for example,
lacking some closing statements. I think that g95-xml just aborted in
this case, which is why I never went further with this project.

-David

[1] http://sourceforge.net/projects/g95-xml/
[2] http://www.gccxml.org/HTML/Index.html




  parent reply	other threads:[~2009-09-12 16:34 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 [this message]
2009-09-13 16:39           ` Richard Stallman
2009-09-13 17:38             ` Eric M. Ludlam
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vdjoruja.fsf@engster.org \
    --to=deng@randomsample.de \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=eric@siege-engine.com \
    --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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).