Date: Mon, 2 Dec 1996 11:35:37 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: mbarkah@hemi.com (Ade Barkah) Cc: terry@lambert.org, hackers@freebsd.org Subject: Re: Lex/Yacc question Message-ID: <199612021835.LAA10927@phaeton.artisoft.com> In-Reply-To: <199612020756.AAA17064@hemi.com> from "Ade Barkah" at Dec 2, 96 00:56:12 am
index | next in thread | previous in thread | raw e-mail
> Terry Lambert wrote:
>
> > <ST_HELO>[\r\n] {
> > BEGIN INITIAL;
> > return HELO_END;
> > }
> >
> > The use of a "HELO_END" token lets us recognize the end of the statement
> > for a partial statement (HELO STR_DOMAIN HELO_END is otherwise ambiguous).
>
> You can also avoid states if you want to... for example, in your rfc821.l:
[ ... ]
> | command: /* nothing*/
> | | command incomplete_helo
> | | command helo_command
> | { yyerrok; }
> | ;
[ ... ]
I found in implementation for an interactive parser, this tends to fail.
Specifically, using the "-i" option to get a case insensitive parser
(instead of specifying [Hh][Ee][Ll][Oo]) results in your string that
you assemble from '.' returns coming back case converted.
I actually though this was bad from several perspectives, not only
for the adulteration of the "name@domain.com (Long Name)" and the
"Long Name <name@domain.com>" "Long Name" strings (which is bad enough
by itself), but that state can not be avoided entirely.
Specifically, there is an 821->822 provision for "X-authentication-warning:"
and for "Apparently-To:" based on the HELO state and the "RCPT TO:",
respectively.
There is also an exclusive state requirement for mail content processing
(un-byte-stuffing leading '.' characters, etc.).
I found that in practice, the state machine would hang until the next
command (shift/reduce conflict) when using a command that was a prefix
of another command.
One caveat: I am using the 'lex' compatability mode (except for the "-i",
which is flex specific), so your mileage may vary...
Terry Lambert
terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612021835.LAA10927>
