On Fri, Feb 27, 2009 at 03:29:55PM +0000, corvid wrote:
On Fri, Feb 27, 2009 at 02:26:03PM +0000, corvid wrote:
Committed. I hoped to be able to make that code a bit shorter, but could not find a reasonable solution...
Yeah. In any case, it's just going to get worse/rearranged again for negative numbers...
Exactly. I started my simplification attempts, added negative number support - and blew it all up :) I'm really considering a flex based scanner now. What do you think?
I only touched flex very briefly for a class at school long ago, and I don't remember anything from the experience, but the idea interests me since it has to be less trouble than trying to do it by hand...
I think we just need to try it. Attached is a minimal standalone example based on the "Lexical scanner" from the appendix of the CSS 2.1 spec. To compile it use: flex cssscanner.l gcc -o cssscanner lex.yy.c -lfl It reads from stdin. Cheers, Johannes