Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!labrea!jade!ucbvax!LBL-RTSG.ARPA!vern%lbl-helios From: vern%lbl-helios@LBL-RTSG.ARPA (Vern Paxson) Newsgroups: comp.lang.c Subject: Re: whats wrong with this lex grammer? (help) Message-ID: <8709221935.AA01430@lbl-helios> Date: Tue, 22-Sep-87 15:35:24 EDT Article-I.D.: lbl-heli.8709221935.AA01430 Posted: Tue Sep 22 15:35:24 1987 Date-Received: Thu, 24-Sep-87 06:27:01 EDT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: vern%lbl-helios.arpa@lbl-rtsg.arpa Lines: 20 Regarding the lex pattern: "(*"([^*]|("*"/[^)]))*"*)" printf("&%s&\n", yytext); ^ | Lex does not handle trailing context properly inside of ()'s. Essentially you can only have one instance of trailing context in a pattern, and it splits the pattern into two halves, the stuff-to-be-matched and the stuff-that-must-follow. This limitation is well rooted in the overall DFA approach lex uses for pattern matching, so don't expect it to go away. The limitations mentioned by Esmond Pitt in comp.unix.wizards (that ^ and $ are not matched inside ()'s) have a similar origin. Vern Vern Paxson vern@lbl-csam.arpa Real Time Systems ucbvax!lbl-csam.arpa!vern Lawrence Berkeley Laboratory (415) 486-6411