|Some flex help. firstname.lastname@example.org (1998-12-27)|
|Flex help received. email@example.com (1999-01-03)|
|From:||firstname.lastname@example.org (R. Clayton)|
|Date:||3 Jan 1999 18:01:51 -0500|
|Organization:||College of Computing, Georgia Tech|
|Keywords:||lex, i18n, comment|
A while back I posted a message asking for suggestions as to why the flex
pattern "\x84........" wasn't matching binary strings as I expected it to.
The answer, once pointed it was pointed out to me, is obvious. On the off-hand
chance that some of you reading this are as dumb as I am, I'll point it out
too: "." doesn't match newlines. If the string has a byte containing the value
10 decimal (which it did), the pattern won't match (it was also suggested that
the null byte would cause the same problem, but, in the version of flex I'm
using, "." does match the byte containing zero).
The fix is to replace "." with "[\x00-\xff]". The size and speed differences
between the correct and incorrect recognizers is negligible (tens of bytes and
100ths of a second on a half-megabyte dvi file).
Thanks to K. Jones (who probably didn't get my reply due to a misconfigured
mail handler) and B. Rayhawk for suggesting the newline problem.
[Oh, duh, I should have seen that. -John]
Return to the
Search the comp.compilers archives again.