help-flex
[Top][All Lists]
Advanced

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

Re: Suppress copying characters to yytext?


From: Hans-Bernhard Broeker
Subject: Re: Suppress copying characters to yytext?
Date: Thu, 26 Apr 2001 18:04:06 +0200 (MET DST)

On Thu, 26 Apr 2001, Dave Dutcher wrote:

> Second, I would like to be able to have Flex use certain characters in a
> regular expression to match the expression but suppress copying the
> characters to yytext.  

You can do that with a start condition and trailing context rules. I.e.
roughly like this:

<INITIAL>\"     BEGIN(IN_STRING)

<IN_STRING>[^\n]*/\"    { 
                        /* yytext is the interior of the string, now */
                        BEGIN(INITIAL)
                        }

-- 
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]