Problem with Flex and QNX

Vern Paxson vern at hati.cs.cornell.edu
Wed Aug 30 01:23:56 AEST 1989


In article <598 at qcc-hal.UUCP> andrew at qcc-hal.UUCP (Andrew Kostiuk) writes:
>I am trying to port Flex to the QNX Operating System ("UNIX-like" O/S
>for PCs) and am having some problem.
>
>QNX (in its infinite wisdom) has decided to use the 0x1E character as a
>new-line as opposed to the standard 0x0A.  This I believe caused Flex to
>decide that there is an illegal character in the input and the scanner
>"jammed".
>
>After poking around in Flex, I think the "problem" in in the "Equivalent
>Class" array used to map input characters to equvalent classes.  
>Unfortunately this array is generated by flex itself (as opposed to being
>hardcoded) and it is not obvious how to "fix" this for the QNX environment.

Try this.  Copy initscan.c somewhere safe.  Then edit initscan.c and
change the 10th (start counting at 0) entry of the yy_ec[] array from
3 to 1; change the 30th entry (i.e., 0x1e) from 1 to 3.  Edit the
routine myesc() in misc.c so that \n translates into 0x1e (maybe the QNX
C compiler will already do this for you).  Do a "make first_flex" and now 
flex should treat 0x1e as new-line and 0x0a as j-random control character.

		Vern

	Vern Paxson			      vern at cs.cornell.edu
	Computer Science Dept.		      decvax!cornell!cs!vern
	Cornell University		      



More information about the Comp.sources.bugs mailing list