[fpc-pascal]OT: Syntax Highlighting

James_Wilson at i2.com James_Wilson at i2.com
Tue Nov 13 21:33:27 CET 2001


> You should stick to simple keyword highlighting in the beginning,
> real syntax highlighting is a very complicated business, requiring
> theoretical and practical familiarity with many concepts used in
> compiler design.

> But even only to find keywords, pos() or anything similar is a
> completely impractical approach. What you have to do is to write a
> lexical scanner to scan your input and to turn it into tokens. The
> details also depend on the language you want to display but,
> basically, it is as follows: you have a character variable to keep
> the next character not yet consumed. You write a function to return
> the next token in the input (an abstract value like identifier,
> number, punctuation, etc). This NextToken function examines the
> current-character and decides what to do:

As usual, your assistance was not only very explicit but also extremely 
helpful. But this seems to be how you handle all your replies; you 
dispense a lot of good advice. I find myself in your debt. Again.

And maybe, if I can get this whole thing working properly (the more I 
delve into it the more I realize needs to be done) I'll post it on the FPC 
site!  :-)

Thanks again.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20011113/a753a9be/attachment.html>

More information about the fpc-pascal mailing list