Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!nysernic!itsgw!batcomputer!cornell!svax!peckham From: peckham@svax.cs.cornell.edu (Stephen Peckham) Newsgroups: comp.unix.wizards Subject: Lex Bugs? Message-ID: <1729@svax.cs.cornell.edu> Date: Wed, 21-Oct-87 11:38:56 EDT Article-I.D.: svax.1729 Posted: Wed Oct 21 11:38:56 1987 Date-Received: Fri, 23-Oct-87 07:44:52 EDT Reply-To: peckham@svax.cs.cornell.edu (Stephen Peckham) Distribution: comp Organization: Cornell Univ. CS Dept, Ithaca NY Lines: 29 I've run across two problems using lex that appear to be bugs. First, if the first rule in the lex specification is "\<|" (without quotes), the generated code won't compile. (A "case" outside of a switch is generated.) No lex error is given for the "|" operator followed by the end-of-line. Second, a specification with the lookahead operator doesn't work correctly, and depends on the order of rules. An excerpt follows: %% ([\ \n]*)/("<") {BEGIN C;} ([\ \n]*) {BEGIN S;} "<" "<|" {BEGIN W;} On input "<| <..." the following tokens are returned: "<|" (rule 4) " " (rule 1) "<" (rule 1)--this sure looks fishy. If I move rule 3 (...) to the beginning of the specification, then the third token returned is "<", and it is returned by the moved rule. Of course, this rule should have matched in the first place. I'm running a Sep 15 1986 version of lex on a Sun 3/50. Are these known bugs, or am I misunderstanding something? If someone is interested, I can send more details. Steve Peckham peckham@svax.cs.cornell.edu