help-flex
[Top][All Lists]
Advanced

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

Re: comments in lexical definitions


From: Tobias Ostgathe
Subject: Re: comments in lexical definitions
Date: Wed, 12 Sep 2001 07:13:48 +0200

Great!!!

That's exactly what I needed. I was able to live with an additional
preprocessor, too, but
this is definitely the better way.

Thank you very much for your help

-Tobias
----- Original Message -----
From: "John W. Millaway" <address@hidden>
To: "Tobias Ostgathe" <address@hidden>
Cc: <address@hidden>; "Hans-Bernhard Broeker"
<address@hidden>; "W. L. Estes" <address@hidden>
Sent: Thursday, August 16, 2001 5:05 PM
Subject: Re: comments in lexical definitions


> > > > I'm missing the possibility to include comments in lexical
definition
>
> Flex does allow comments everywhere you could possibly need them. This
> discussion suggests a failure in the flex docs to make the syntax clear.
What's
> the trick, then?
>
> 1. Use traditional C comments, not '//' comments.
> 2. INDENT THE COMMENT.
>
> -John
> (Exhaustive example follows)
>
> %{
>     /* 1  */
> %}
>     /*  2  */
> %option reentrant
> %x STATE_X
>
> %%
>    /* 3 */
> ruleA    /* 4 */ { /* 5 */}
> ruleB    /* 6 */ ECHO; /* 7 */
>    /* 8 */
> <STATE_X>{
> ruleC   ECHO;
>    /* 9 */
> ruleD   ECHO;
> }
>
> %%
> /* 10 */
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/




reply via email to

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