Boost logo

Boost :

From: joel de guzman (isis-tech_at_[hidden])
Date: 2001-05-30 21:31:51

From: "joel de guzman":
> As an aside, barely a week after Spirit was introduced,
> people are starting to use it in such applications. In
> particular, Bruce Florman sent in a URI parser using
> Spirit: and a BNF grammar straight out of appendix
> A of RFC 2396.
> "To avoid predeclaring all the rules, I needed to reverse
> the order, and obviously I had to insert the sequencing
> operators and change the notation for optional constructs,
> but otherwise the code came straight out of the document."
> -Bruce
> Here's a sample output from Bruce's test program:
> /////////////////////////////////////////////////////////
> A Simple URI Parser ...
> /////////////////////////////////////////////////////////
> Type a Uniform Resource Identifier (or q to quit) ...
> <>
> http matched scheme
> matched userinfo
> groups matched domainlabel
> yahoo matched domainlabel
> com matched domainlabel
> com matched toplabel
> matched hostname
> matched host
> matched hostport
> matched server
> group matched segment
> boost matched segment
> message matched segment
> 12608 matched segment
> group/boost/message/12608 matched path_segments
> /group/boost/message/12608 matched abs_path
> //
> <file://> matched net_path
> //
> <file://> matched hier_part
> <> matched absoluteURI
> <> matched URI_reference
> <> parses
> OK

"...output lines, like " matched userinfo" and "com matched
reflect actions from productions that were subsequently backtracked over.
if I want to really create an object representing a parsed URL, I need to
arrange that
nothing be "committed" until the parse completes altogether..."

Valid points re: semantic actions and backtracking in Spirit.
This was first noted by Larry Evans.
I am tackling the issue now in the form of Contexts.

-Joel de Guzman

Boost list run by bdawes at, gregod at, cpdaniel at, john at