[comp.os.os9] Flex on OS-9

jh@materna.uucp (Juergen Hackenbroich) (09/21/89)

Hallo,

I just tried to compile 'flex' on our os-9 machine, but I got
some problems...

1. I only managed to compile a version will accepts its own
scan.l but with \l instead of \n (*x/os-9). But this version
doesn't create a correct scanner, the output is not in the
correct order.
2. When correction the order of the output of (1) I can compile
the scanner but this time it doesn't accept scan.l because there
seem to be problems with determining end of line after end of rules.
3. When I kill some parts of scan.l the system crashes with '171:
E$DAMAGE'.

All this behaviour seems to me like a problem with internal data
structures. Some tables are of type short which is known to cause
some problems in os-9 compilers, but I didn't find any suspicous
statement.

Thanks for any hints,

hacki
-- 
Juergen Hackenbroich            | Tel. +49 (231) 51908-20
Dr. Materna GmbH                | jh@materna.uucp
Vosskuhle 38
D-4600 Dortmund 1

dibble@cs.rochester.edu (Peter C. Dibble) (09/23/89)

The distributed flex initscan.c file will only work on systems that
use a LF for newline.

To port initscan.c to OS-9 find the array yy_ec in initscan.c.
						   copy the value in the yy_ec[10] to yy_ec[13].
That's it.  Now CR is equivalent to LF.  When you use flex to make
your own scanner you'll find that LF is not equivalent to CR, but
that's OK, the initscan.c fix is only a quick-and-dirty.


Peter