Date: Fri, 29 Nov 1996 10:58:32 +1100 (EST) From: Julian Lawrence Jenkins <julianj@cse.unsw.edu.au> To: Terry Lambert <terry@lambert.org> Cc: "Jordan K. Hubbard" <jkh@time.cdrom.com>, hackers@freebsd.org Subject: Re: Lex/Yacc question Message-ID: <Pine.OSF.3.95.961129105557.8676E-100000@faure.orchestra.cse.unsw.EDU.AU> In-Reply-To: <199611282155.OAA01125@phaeton.artisoft.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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; > <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 <state> when in that state. Kaveman
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.3.95.961129105557.8676E-100000>