Subject: Re: Syntax for WWW-Authenticate

From: [email-masked]
Date: Thu, 9 Dec 1999 02:24:24 +0530

hgs> Because a parser cannot split the header first and then parse each one
hgs>  individually. This is the only instance in HTTP where a parser needs
to
hgs>  "look ahead" or "back up". Generally, since Fortran, language-writers
hgs>  have tried to avoid this, for a good reason.
hgs>  This makes writing a generic parser much more difficult than it
should
hgs>  be, for no gain in functionality.

Hi,
I dont really know if you state this with hand written parsers in mind ,
rule based generated parsers in mind or both.
The fact seems to be, that quite a few different set of problems come up
depending on which approach you use.
In some specific cases the greedy-search approach for lex coupled with its
support for only 1 lookahead makes life a little trickier
and in many other cases, parsing messages becomes very easy. So your
problems differ depending on your parser approach.
If you are using a rule based parser which neither backtracks nor allows
you a lookahead > 1  then you have to tweak some rules which is an
elementary issue for handwritten code - and in other cases, rule based
grammars allow you a whole lot more of flexibility for other messages.

Anyway suppose we consider  (in sipurl)

sip: aaaaaaaa   :     1234@yyyyyyy:1234

Im assuming the above is valid since ":" is a sep. in user:passwd and LWS
should be allowed b/w separators.

So when you reach token aaaaaaa how do you know its a user or a host
without looking ahead for @ ?
(since user:passwd is optional)

However, if current parsers dont allow the above and assume no LWS b/w
colons in user:passwd then thats another thing.
But since some of your bakeoff tests have generic comments like "LWS b/w
all separators" then above is valid ?

So what I mean is that, you might have to lookahead  ( or tweak rules) in
many other cases too. Which is why I did not think www-auth
was any different in difficulty.

Regds
Arjun

--
Arjun Roychowdhury @ Hughes Software Systems