Re: Syntax highlighting servlet



Kenneth Patrick Turvey <kt-usenet@xxxxxxxxxxxxxxxxxx> wrote:
> Out of curiosity, in case I end up implementing this myself, do most syntax
> highlighting engines use regular expression substitutions, or do they actually
> parse the language being highlighted? Is the extra effort involved in parsing
> worth it?

The vast majority of syntax highlighter only do the lexical analysis
(which you can do with regular expressions). Parsing is definitely
harder and there's no core API to do it (Java 1.4 and later comes with a
regular expression matcher). Whether it's worth it is, of course, your
call... but for casual uses, I'd say no. Anyone doing serious work on
the code will copy it into a development tool anyway.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
.



Relevant Pages

  • String parsing with VB 6.0 (SP4)
    ... Should I be able to use regular expression scripting for string parsing with ... Most of what I find is oriented towards its Web use for parsing ... I've ticked the Project Components MS Script Control 1.0 and got the Script ... A simple example getting a line, using Line Input, regular expression ...
    (microsoft.public.scripting.vbscript)
  • Re: pregexp vs. read
    ... >> since it can only parse a limited subset of grammars. ... This is for a IRC bot I have started to work ... Perhaps my regular expression parser ... parsing a text string. ...
    (comp.lang.lisp)
  • OT:Must Read
    ... but I felt it was worth ... highlighting. ... If you want to understand what the conflict with Muslim fundamentalists ...
    (rec.audio.opinion)
  • Re: RE and Jar are hard to Google for!
    ... "Regular Expression" java jar ... Happy Parsing. ... > open-mouthed kitchen vessel. ...
    (comp.lang.java.programmer)
  • Re: RegEx for parsing peoples names?
    ... > I'm trying to create and regular expression for parsing ... > peoples names. ... I simply want to make sure that a firstname and surname, ...
    (microsoft.public.dotnet.languages.csharp)