From owner-freebsd-hackers Fri Nov 29 10:42:03 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id KAA27916 for hackers-outgoing; Fri, 29 Nov 1996 10:42:03 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id KAA27907 for ; Fri, 29 Nov 1996 10:42:01 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id LAA02548; Fri, 29 Nov 1996 11:24:41 -0700 From: Terry Lambert Message-Id: <199611291824.LAA02548@phaeton.artisoft.com> Subject: Re: Lex/Yacc question To: julianj@cse.unsw.edu.au (Julian Lawrence Jenkins) Date: Fri, 29 Nov 1996 11:24:41 -0700 (MST) Cc: terry@lambert.org, jkh@time.cdrom.com, hackers@freebsd.org In-Reply-To: from "Julian Lawrence Jenkins" at Nov 29, 96 10:58:32 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > 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. Thanks; this is the tersest example yet. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.