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: address@hidden
Subject: Re: State-machine based syntax highlighting
Date: 8 Dec 2006 13:14:42 -0800
User-agent: G2/1.0

Robert Thorpe wrote:
>
> Doing this with normal parsing technology is difficult.  If the editor
> just feeds every file into the external parser then back into the
> editor then this will be a lot of work.

Yes, this is a problematic part. I was thinking about feeding only code
snippets to the external parser, but even determining what snippet
should be fed from the current source code would need some kind of
parsing, so using external parsers might not be feasible after all.

> Compiler parsers and font-locking/navigating code have different
> intentions.  Compiler parsers must be fast when handling a whole file,
> and they must generate accurate error messages.  Font-locking code must
> be fast when starting at any arbitrary part of the code, and it must
> tolerate incomplete information and errors.

Of course, and I wasn't thinking of using the existing compiler as is,
rather utilizing somehow the existing infrastructure in the compiler if
it's accessible to implement partial parsing. But given the problems
discussed above it may not be the way to go.

If parsing needs to be implemented in the editor and every editor must
have it's own implementation then at least the concepts could be
shared.

I mean there should be a wiki or something about discussing issues of
partial parsing for a particular language (java, c++, etc.), instead of
everyone reinventing the wheel differently.

For example, one could check the current implementation in Eclipse of
java code completion and parsing, before embarking to implement the
same thing again and the same goes for other open source editors
supporting other languages.



reply via email to

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