help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using flex for source-hilighting


From: Hans-Bernhard Broeker
Subject: Re: using flex for source-hilighting
Date: Sun, 9 Jun 2002 22:07:26 +0200 (MET DST)

On 9 Jun 2002, Janus N. Tøndering wrote:

[...]
> information about each keyword, string, number etc. found. I want the
> start and end file positions of the token matched.

Whether or not that's anywhere near easy to achieve depends on how your
lexer is set up.  Esp. on how your lexer treats things like:

*) line ends in the middle of a semantic entity (like a function header)
*) comments in any place you could imagine
*) context dependencies in the C/C++ grammar
*) preprocessor constructs, including backslash-newline in all the most
   strange places
*) string constants

In general, a lexer is not capable of treating C syntax completely on its
own, because of the arbitrarily deep parenthesis nesting and similar
features of the grammar.

-- 
Hans-Bernhard Broeker (address@hidden)
Even if all the snow were burnt, ashes would remain.




reply via email to

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