[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CEDET merge question

From: David Engster
Subject: Re: CEDET merge question
Date: Sat, 12 Sep 2009 18:34:49 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux)

Eric M. Ludlam <address@hidden> 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.


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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]