<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Parsing Arbitrary Things in Any Sequence</title>
	<atom:link href="http://boost-spirit.com/home/2010/02/17/parsing-arbitrary-things-in-any-sequence/feed/" rel="self" type="application/rss+xml" />
	<link>http://boost-spirit.com/home/2010/02/17/parsing-arbitrary-things-in-any-sequence/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=parsing-arbitrary-things-in-any-sequence</link>
	<description>Home of The Boost.Spirit Library</description>
	<lastBuildDate>Wed, 25 Jan 2012 14:26:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Jamboree</title>
		<link>http://boost-spirit.com/home/2010/02/17/parsing-arbitrary-things-in-any-sequence/comment-page-1/#comment-38705</link>
		<dc:creator>Jamboree</dc:creator>
		<pubDate>Tue, 20 Sep 2011 08:25:43 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=977#comment-38705</guid>
		<description>Sorry for the late reply,

It&#039;s used when you want all the elements to be matched exactly once, e.g.

    Using: strict[char_(&#039;a&#039;) ^ &#039;b&#039; ^ &#039;c&#039;]
    Input: cab -&gt; success
    Input: ca -&gt; fail

You can access the code at https://github.com/jamboree/boost-jamboree-spirit

Yet, I feel the usage of permutation (strict or not) is limited, it can&#039;t deal with the case in which the elements are required to be delimited...</description>
		<content:encoded><![CDATA[<p>Sorry for the late reply,</p>
<p>It&#8217;s used when you want all the elements to be matched exactly once, e.g.</p>
<p>    Using: strict[char_('a') ^ 'b' ^ 'c']<br />
    Input: cab -&gt; success<br />
    Input: ca -&gt; fail</p>
<p>You can access the code at <a href="https://github.com/jamboree/boost-jamboree-spirit" rel="nofollow">https://github.com/jamboree/boost-jamboree-spirit</a></p>
<p>Yet, I feel the usage of permutation (strict or not) is limited, it can&#8217;t deal with the case in which the elements are required to be delimited&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dmuba</title>
		<link>http://boost-spirit.com/home/2010/02/17/parsing-arbitrary-things-in-any-sequence/comment-page-1/#comment-38069</link>
		<dc:creator>dmuba</dc:creator>
		<pubDate>Tue, 06 Sep 2011 12:33:11 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=977#comment-38069</guid>
		<description>Hi Jamboree,

About the strict directive qi::strict[] that you&#039;ve implemented:
What is the situation?

Thanks

Uba</description>
		<content:encoded><![CDATA[<p>Hi Jamboree,</p>
<p>About the strict directive qi::strict[] that you&#8217;ve implemented:<br />
What is the situation?</p>
<p>Thanks</p>
<p>Uba</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamboree</title>
		<link>http://boost-spirit.com/home/2010/02/17/parsing-arbitrary-things-in-any-sequence/comment-page-1/#comment-31391</link>
		<dc:creator>Jamboree</dc:creator>
		<pubDate>Fri, 24 Jun 2011 17:53:54 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=977#comment-31391</guid>
		<description>Now I&#039;ve implemented that via qi::strict[] modifier directive.

See:
http://boost.2283326.n4.nabble.com/Strict-Permutation-Idea-amp-Impl-td3623152.html</description>
		<content:encoded><![CDATA[<p>Now I&#8217;ve implemented that via qi::strict[] modifier directive.</p>
<p>See:<br />
<a href="http://boost.2283326.n4.nabble.com/Strict-Permutation-Idea-amp-Impl-td3623152.html" rel="nofollow">http://boost.2283326.n4.nabble.com/Strict-Permutation-Idea-amp-Impl-td3623152.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hicham</title>
		<link>http://boost-spirit.com/home/2010/02/17/parsing-arbitrary-things-in-any-sequence/comment-page-1/#comment-22967</link>
		<dc:creator>hicham</dc:creator>
		<pubDate>Sat, 05 Mar 2011 20:03:48 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=977#comment-22967</guid>
		<description>Has there been any followup on the mailing list?

I have come to a 2nd case where I&#039;d like to use a &quot;operator&quot; for strict permutation where all the operands are required to appear exactly once.
It was mentioned there were no more c++ operators available for this?

Can a function be used instead?</description>
		<content:encoded><![CDATA[<p>Has there been any followup on the mailing list?</p>
<p>I have come to a 2nd case where I&#8217;d like to use a &#8220;operator&#8221; for strict permutation where all the operands are required to appear exactly once.<br />
It was mentioned there were no more c++ operators available for this?</p>
<p>Can a function be used instead?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hartmut Kaiser</title>
		<link>http://boost-spirit.com/home/2010/02/17/parsing-arbitrary-things-in-any-sequence/comment-page-1/#comment-9643</link>
		<dc:creator>Hartmut Kaiser</dc:creator>
		<pubDate>Thu, 21 Oct 2010 13:03:43 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=977#comment-9643</guid>
		<description>That sounds like an excellent suggestion. Let&#039;s move this discussion to the mailing list, where others might want to comment as well.

Regards Hartmut</description>
		<content:encoded><![CDATA[<p>That sounds like an excellent suggestion. Let&#8217;s move this discussion to the mailing list, where others might want to comment as well.</p>
<p>Regards Hartmut</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nelson</title>
		<link>http://boost-spirit.com/home/2010/02/17/parsing-arbitrary-things-in-any-sequence/comment-page-1/#comment-9592</link>
		<dc:creator>Robert Nelson</dc:creator>
		<pubDate>Wed, 20 Oct 2010 21:26:04 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=977#comment-9592</guid>
		<description>I think a strict parser would be very helpful.  Couldn&#039;t you use the binary + operator, for example.  It seems that strict permutations are very common, and it would be helpful to not have to manually use phoenix functions and have unnecessarily complicated data types; we should not have to use boost::optional for items that are required.  It should also always match items that are first in the list first so that it is possible to have a catch all at the end of the permutation list.  I am not sure if the current implementation does this.  If operators are not available, a library function that takes variable arguments like strict_permutation(&quot;a&quot;,&quot;b&quot;,&quot;c&quot;) would be good.

You should also be able to mix required and non required elements.  For example a + b + -c would match &quot;ab&quot; &quot;ba&quot; &quot;bac&quot; ...
a + b + *char_ would match all strings that included a and b, but you could have different semantic actions for a and b.
This would be really useful for parsing key-value pairs where a couple pairs are required, and there are optional user defined pairs.

You could write the function or operator like this:
rule operator + (rule a, rule b) {return (a &lt;&lt; b) &#124; (b &lt;&lt; a);}

A strict permutation operator or function as described above would be incredible useful.  It would result in cleaner looking code, and work in complicated situations that would be hard to implement using phoenix operators.  Do you think you could implement one in a future release?

Thanks
--Robert Nelson</description>
		<content:encoded><![CDATA[<p>I think a strict parser would be very helpful.  Couldn&#8217;t you use the binary + operator, for example.  It seems that strict permutations are very common, and it would be helpful to not have to manually use phoenix functions and have unnecessarily complicated data types; we should not have to use boost::optional for items that are required.  It should also always match items that are first in the list first so that it is possible to have a catch all at the end of the permutation list.  I am not sure if the current implementation does this.  If operators are not available, a library function that takes variable arguments like strict_permutation(&#8220;a&#8221;,&#8221;b&#8221;,&#8221;c&#8221;) would be good.</p>
<p>You should also be able to mix required and non required elements.  For example a + b + -c would match &#8220;ab&#8221; &#8220;ba&#8221; &#8220;bac&#8221; &#8230;<br />
a + b + *char_ would match all strings that included a and b, but you could have different semantic actions for a and b.<br />
This would be really useful for parsing key-value pairs where a couple pairs are required, and there are optional user defined pairs.</p>
<p>You could write the function or operator like this:<br />
rule operator + (rule a, rule b) {return (a &lt;&lt; b) | (b &lt;&lt; a);}</p>
<p>A strict permutation operator or function as described above would be incredible useful.  It would result in cleaner looking code, and work in complicated situations that would be hard to implement using phoenix operators.  Do you think you could implement one in a future release?</p>
<p>Thanks<br />
&#8211;Robert Nelson</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron</title>
		<link>http://boost-spirit.com/home/2010/02/17/parsing-arbitrary-things-in-any-sequence/comment-page-1/#comment-6530</link>
		<dc:creator>Aaron</dc:creator>
		<pubDate>Tue, 24 Aug 2010 19:13:53 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=977#comment-6530</guid>
		<description>I&#039;ve come to the conclusion that the permutation parser isn&#039;t very useful when picking out expressions from an unbounded large set. For instance, when parsing HTTP headers:
[cpp]
Host: 1.1.1.1:80
Connection: close
Content-Length: 1234
[/cpp]
...via this rule:
[cpp]
rule = connection_header
  ^ content_length_header
  ^ host_header
  ^ omit[+print &gt;&gt; eol] // catch-all
  ;
[/cpp]
...will not behave as expected. It will match the &#039;Host&#039; header and the &#039;Content-Length&#039; header, but the &#039;Connection&#039; header will get eaten up by the catch-all. I don&#039;t know if this is a bug in the spirit implementation (I&#039;m using 2.3) or if it&#039;s intentional, but it makes the permutation parser useless in those cases, especially if you&#039;re trying to fuse/adapt a rule to a struct. Unfortunately, in my experience, almost all of the cases where the permutation parser would otherwise come into use are of this variety, which means I rarely end up using the ^ operator, and I have to take a messy roundabout strategy with lots of explicit semantic actions.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve come to the conclusion that the permutation parser isn&#8217;t very useful when picking out expressions from an unbounded large set. For instance, when parsing HTTP headers:</p>
<pre class="brush: cpp; title: ; notranslate">
Host: 1.1.1.1:80
Connection: close
Content-Length: 1234
</pre>
<p>&#8230;via this rule:</p>
<pre class="brush: cpp; title: ; notranslate">
rule = connection_header
  ^ content_length_header
  ^ host_header
  ^ omit[+print &gt;&gt; eol] // catch-all
  ;
</pre>
<p>&#8230;will not behave as expected. It will match the &#8216;Host&#8217; header and the &#8216;Content-Length&#8217; header, but the &#8216;Connection&#8217; header will get eaten up by the catch-all. I don&#8217;t know if this is a bug in the spirit implementation (I&#8217;m using 2.3) or if it&#8217;s intentional, but it makes the permutation parser useless in those cases, especially if you&#8217;re trying to fuse/adapt a rule to a struct. Unfortunately, in my experience, almost all of the cases where the permutation parser would otherwise come into use are of this variety, which means I rarely end up using the ^ operator, and I have to take a messy roundabout strategy with lots of explicit semantic actions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://boost-spirit.com/home/2010/02/17/parsing-arbitrary-things-in-any-sequence/comment-page-1/#comment-5851</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Thu, 05 Aug 2010 13:12:26 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=977#comment-5851</guid>
		<description>Hi Olaf,

can you please be a little bit more precise? I got the same error, but I am not able to fix it with your hint. Can you post a source that compiles?

Thanks a lot
Patrick</description>
		<content:encoded><![CDATA[<p>Hi Olaf,</p>
<p>can you please be a little bit more precise? I got the same error, but I am not able to fix it with your hint. Can you post a source that compiles?</p>
<p>Thanks a lot<br />
Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olaf</title>
		<link>http://boost-spirit.com/home/2010/02/17/parsing-arbitrary-things-in-any-sequence/comment-page-1/#comment-2527</link>
		<dc:creator>Olaf</dc:creator>
		<pubDate>Sun, 21 Mar 2010 10:02:21 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=977#comment-2527</guid>
		<description>with fusion::all(t, optional_empty()) works</description>
		<content:encoded><![CDATA[<p>with fusion::all(t, optional_empty()) works</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olaf</title>
		<link>http://boost-spirit.com/home/2010/02/17/parsing-arbitrary-things-in-any-sequence/comment-page-1/#comment-2519</link>
		<dc:creator>Olaf</dc:creator>
		<pubDate>Sat, 20 Mar 2010 20:07:02 +0000</pubDate>
		<guid isPermaLink="false">http://boost-spirit.com/home/?p=977#comment-2519</guid>
		<description>if I want to compile this (even with headers, main etc.) I&#039;ve got an compile error
no matching function for call to find_if(const boost::fusion::vector1&lt;boost::optional &gt;&amp;)

Is the shown syntax correct?

Thanks,
Olaf</description>
		<content:encoded><![CDATA[<p>if I want to compile this (even with headers, main etc.) I&#8217;ve got an compile error<br />
no matching function for call to find_if(const boost::fusion::vector1&lt;boost::optional &gt;&amp;)</p>
<p>Is the shown syntax correct?</p>
<p>Thanks,<br />
Olaf</p>
]]></content:encoded>
	</item>
</channel>
</rss>

