[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: start of line ?
From: |
Johnny_xia |
Subject: |
Re: start of line ? |
Date: |
Fri, 7 Mar 2003 08:56:01 +0800 |
It is better to handle comment in flex. For example add the following rule in
flex.
[B|C|E].*$ { return COMMENT; }
This way bison only sees the COMMENT token.
Regards,
Johnny.
"Urdaneta, Alfonso E (N-Summitt Technologies)" <address@hidden> on
03/07/2003 07:08:05 AM
To: "'address@hidden'" <address@hidden>
cc: (bcc: Johnny Xia/WSH/Wistron)
Subject: start of line ?
This document is classified as Normal
The language I'm parsing has comments like so.
either a 'B', a 'C', or an 'E' at the start of a line, then anything, then a
'$'.
I'm thinking the only way to look for this in bison is to have flex return
START_COMMENT when it finds a newline followed by a B, etc. so it would be
comment: START_COMMENT anything_i_want DOLLAR
;
This will work I think, but I can't help but feel like this is a kludge.
Any better ideas out there ?
Alfonso.
_______________________________________________
address@hidden http://mail.gnu.org/mailman/listinfo/help-bison
- start of line ?, Urdaneta, Alfonso E (N-Summitt Technologies), 2003/03/06
- Re: start of line ?,
Johnny_xia <=