emacs-devel
[Top][All Lists]
Advanced

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

Re: CEDET merge question


From: Eric M. Ludlam
Subject: Re: CEDET merge question
Date: Sat, 12 Sep 2009 08:49:40 -0400

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.

I don't know how bison works, but I would assume that bison parses basic
C code (thus replacing $1 with some other piece of code.)  In the same
way, it would need to be taught about Emacs Lisp, Scheme, or any other
language someone might want.

Bison also outputs the code needed for traversing the generated parser
table.  When creating more than one parser in one application (ie - any
scripting language case) this would be detrimental since it is basically
the same code for every parser, which is wasteful.

That said, I do think that it is possible, and maybe even desirable to
do such a thing.  The end result, however, would involve rather extreme
changes to bison, and possibly flex if flex is also used.

As others have pointed out, there are newer parser technologies
available too such as PEG.  How much of that is fad vs fabulous, I don't
really know.  What I do know is that the CEDET tools don't care much
about the specifics of the parser.  The parser tools it does have are to
make it easy to create new parsers so Emacs can support a large number
of languages.

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.

There are a huge number of tools out there trying to do what gcc does,
like ctags, etags, ectags, cscope, gnu global, doxygen, and idutils.
What's worse is that none of them work well.

Of course, an Emacs Lisp parser can do lots of other things besides
create tags.  That's just what it is currently used for.

Eric




reply via email to

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