help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: State-machine based syntax highlighting


From: Tim X
Subject: Re: State-machine based syntax highlighting
Date: Fri, 08 Dec 2006 19:10:30 +1100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

"address@hidden" <address@hidden> writes:

> Robert Thorpe wrote:
>>
>> If parsing were to be used to support syntax highlighting then maybe
>> some work would have to be done to avoid having to use Elisp.  But I'm
>> not sure since it would still require loads of regexps and they would
>> probably still eat up a lot of the runtime.
>>
>
> That may be true, but the advantage is that parsing actually
> understands code, not just matches it with some regexps, so it could be
> used for much more than syntax highlighting (some kind of error
> checking, code completion, etc.).
>
> I think if there are already parsers written in elisp they should be
> intergrated into the official emacs distribution (e.g. in directory
> lisp/parsers), so that packages can use them to understand the code
> better.
>

Have a look at 

http://cedet.sourceforge.net/

The combination of semantic and cedet is, amongst other things, aimed
at providing parse based functionality for emacs. some of this is (I
think) going to be bundled in with emacs 22. The idea is to provide a
more powerful devleopment environment that can do things like code
completion based on more than just abbrevs and dynamic completion
based on recently used keywords and regexp. 

The problem with parse based analysis is that you need an in-built
parser for all the languages that the editor is used to develop in and
this is not a trivial task. I suspect some sort of plugin architecture
that is able to use stand-alone parses for some language of interest
would probably be the way to go as it is unlikely even a small subset
of the languages devleoped within an emacs environment can have a
parser developed in elisp which is readily maintained.

Tim
-- 
tcross (at) rapttech dot com dot au


reply via email to

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