[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: comments in lexical definitions
From: |
John W. Millaway |
Subject: |
Re: comments in lexical definitions |
Date: |
Thu, 16 Aug 2001 08:05:58 -0700 (PDT) |
> > > 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/