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. Perry Smith ( pedz@easesoftware.com ) Ease Software, Inc. ( http://www.easesoftware.com ) Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems