From nshaylor@tcp.co.ukWed Sep 11 14:59:48 1996
Date: Tue, 10 Sep 1996 00:28:24 GMT
From: Nik Shaylor <nshaylor@tcp.co.uk>
To: ejberk@Princeton.EDU
Subject: Bug of feature?

Hi Elliot,

I have a few more things for you regarding JavaLex.

1. The "%notunix" directive does not do what I thought it would. I expected it
to cause all '\r' characters to be ignored. I appears to cause '\r' characters
to be counted as newlines like '\n' is.

2. Even with the "%full" directive the output scanner cannot handle characters
with ASCII values over 127. This is because yy_lookahead, yy_advance(), and
YYEOF are all defined as being of type byte. As byte are signed in Java the
construction:

    yy_next_state = yy_nxt[yy_rmap[yy_state]][yy_cmap[yy_lookahead]];

fails with an array bound exception because yy_lookahead is negative. If you
define the three above items as int and "& 0xFF" the characters output by
yy_advance() the problem will be solved.

3. I have not looked very hard at the following, but I think there may be a
problem with the 'start of line' symbol (^). It looks like it is being taken
as a 'just passed end of line' symbol. 

4. The yy_getchar() routine returns the number of characters from the start of
the file. It would be far more useful (to me at any rate) for it to return the
number of characters since the last '\n'.

5. There appears to be no way to put comments into the input file?

Hope this helps make your great program even better.

Nik Shaylor.
