Date: Fri, 29 Nov 1996 11:24:41 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: julianj@cse.unsw.edu.au (Julian Lawrence Jenkins) Cc: terry@lambert.org, jkh@time.cdrom.com, hackers@freebsd.org Subject: Re: Lex/Yacc question Message-ID: <199611291824.LAA02548@phaeton.artisoft.com> In-Reply-To: <Pine.OSF.3.95.961129105557.8676E-100000@faure.orchestra.cse.unsw.EDU.AU> from "Julian Lawrence Jenkins" at Nov 29, 96 10:58:32 am
next in thread | previous in thread | raw e-mail | index | archive | help
> > 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.
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611291824.LAA02548>
