From owner-freebsd-hackers Thu Nov 28 15:59:04 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id PAA19334 for hackers-outgoing; Thu, 28 Nov 1996 15:59:04 -0800 (PST) Received: from albeniz.orchestra.cse.unsw.EDU.AU (root@albeniz.orchestra.cse.unsw.EDU.AU [129.94.242.13]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id PAA19329 for ; Thu, 28 Nov 1996 15:59:01 -0800 (PST) Received: From faure With LocalMail ; Fri, 29 Nov 96 10:58:42 +1100 From: Julian Lawrence Jenkins To: Terry Lambert Date: Fri, 29 Nov 1996 10:58:32 +1100 (EST) X-Sender: julianj@faure.orchestra.cse.unsw.EDU.AU cc: "Jordan K. Hubbard" , hackers@freebsd.org Subject: Re: Lex/Yacc question In-Reply-To: <199611282155.OAA01125@phaeton.artisoft.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Thu, 28 Nov 1996, Terry Lambert wrote: > I've written a number of parsers, too. Nonen of them needed: > > KEYWORD rest of stuff to end of line Try: > %s HELO > > %% > > helo BEGIN HELO; > .*\n {BEGIN INITIAL; printf("\n\n%s\n\n", yytext);} This works in flex, dont know about other lexes. It defines a state and will only recognise lines preceded with when in that state. Kaveman