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: Robert Thorpe
Subject: Re: State-machine based syntax highlighting
Date: 8 Dec 2006 02:01:12 -0800
User-agent: G2/1.0

Perry Smith wrote:
> On Dec 7, 2006, at 12:57 PM, Robert Thorpe wrote:
> > spamfilteraccount@gmail.com wrote:
> >> Stefan Monnier wrote:
> >>>
> >>> Actually, font-locking *is* implemented in C.  The elisp part
> >>> usually takes
> >>> a negligible amount of time.  The problem start appearing when the
> >>> functionality of the C code is not sufficient and you start
> >>> trying to parse
> >>> the code in elisp, which is slow.
> >>
> >> Good to know. I thought font-lock was implemented in elisp and didn't
> >> bother to check.
> >
> > Precisely speaking...
> > The code that determines what rules are used to font-lock text is in
> > Elisp.
> > The regexp engine that finds the things to be font-locked is in the
> > core of Emacs.
> > The colourisation is implemented in the Emacs core.
>
> Instead of a state machine, how about a lalr parser?  It would be a fun
> project to take the lalr table generation logic from bison, smash it
> into emacs, along with some predefined actions and hooks back
> into emacs.  The grammers could be loaded when needed.

Yes.  I've thought about doing that myself, even better would be the
GLR parser system in recent versions of Bison.  It is capable of
parsing any context-free grammar.  I haven't got enough time to work on
such a thing for Emacs myself though, unfortunately.



reply via email to

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