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: Perry Smith
Subject: Re: State-machine based syntax highlighting
Date: Thu, 7 Dec 2006 14:24:25 -0600


On Dec 7, 2006, at 12:57 PM, Robert Thorpe 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.

Perry Smith ( address@hidden )
Ease Software, Inc. ( http://www.easesoftware.com )

Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems



reply via email to

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