[Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

classic Classic list List threaded Threaded
31 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Frank Hein
Hello,

I am quite new to Spirit. Great work. :)

I found that (x %y) is not semantically equal to (x >> *(y >> x)). The documentation says otherwise.
I'd consider this a bug. Otherwise documentation would have to be changed at several places.
Below is a fully working example.

Using MSVC 2015, Boost 1.61, Win32 build.

Regards, Frank


    //-------------------------------------------------------------------
    //  x % y not semantically equivalent to x >> *(y >> x)

    //#define BOOST_SPIRIT_DEBUG
    #include <io.h>
    #include <boost/spirit/include/qi.hpp>
    #include <boost/spirit/repository/include/qi_confix.hpp>
    #include "../compiler/skipper.hpp"
    #define BOOST_SPIRIT_DEBUG
    namespace qi = boost::spirit::qi;

    namespace parser {

        template <typename Iterator>
        struct ident : qi::grammar<Iterator, std::string()>
        {
            ident();
            void test();
            using t_rule = qi::rule<Iterator, std::string()>;
            t_rule id_using_kleene, id_using_string, id_using_symbols, id_using_lit;
            std::vector<t_rule*> rules = { &id_using_kleene, &id_using_string, &id_using_symbols, &id_using_lit };
               
            qi::symbols<char, std::string> syms;
        };

        template <typename Iterator>
        ident<Iterator>::ident(): ident::base_type(id_using_kleene)
        {
            syms.add("::", "::");

            id_using_kleene = qi::lexeme[(qi::alpha | '_') >> *(qi::alnum | '_')
                >> *(qi::string("::") >> (qi::alpha | '_') >> *(qi::alnum | '_'))];
           
            id_using_string = qi::lexeme[(qi::alpha | '_') >> *(qi::alnum | '_') % qi::string("::")];
            id_using_symbols = qi::lexeme[(qi::alpha | '_') >> *(qi::alnum | '_') % syms];
            id_using_lit = qi::lexeme[(qi::alpha | '_') >> *(qi::alnum | '_') % qi::lit("::")];

            BOOST_SPIRIT_DEBUG_NODES((id_using_kleene)(id_using_string)(id_using_symbols)(id_using_lit))

        }

        template <typename Iterator>
        void ident<Iterator>::test() {
            std::string to_parse = "willy::anton";
            for( std::size_t i = 0; i < rules.size(); i++) {
                std::string result;
                auto b(to_parse.begin()), e(to_parse.end());
                bool success = qi::phrase_parse(b, e, *rules[i], qi::space, result);
                if (success && b == e) {
                    std::cout << (*rules[i]).name() << " success. Result: " << result << std::endl;
                }
                else {
                    std::cout << (*rules[i]).name() << " failed." << std::endl;
                }
            }
            std::cout << std::endl << "Expected behaviour would be result == \"willy::anton\" in all three cases but lit." << std::endl;
        }
    }

    typedef std::string::const_iterator iterator_type;


    int main()
    {
        parser::ident<iterator_type> ident;
        ident.test();

        return 0;
    }
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Lee Clagett-2
On Wed, 25 May 2016 19:44:19 +0200
Frank Hein <[hidden email]> wrote:

> Hello,
>
> I am quite new to Spirit. Great work. :)
>
> I found that (x %y) is not semantically equal to (x >> *(y >> x)).
> The documentation says otherwise.
> I'd consider this a bug. Otherwise documentation would have to be
> changed at several places.
> Below is a fully working example.
>

The expressions are semantically equal, as demonstrated in your
program. All of the generated parsers accept an identical set of inputs.
However, this example shows that the attributes exposed by the parsers
differ, and this is accurately documented too. So, the documentation is
correct AFAIK, but perhaps someone with a better grasp of formal parsing
terminology could correct me. And maybe an explanation of the
differences between language semantics and attributes could be added
somewhere?

Lee

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Frank Hein
This would mean that qi::lit was semanitically equivalent with qi::string (under certain (usage) conditions).  This should be mentioned somewhere in docs. 

When talking about qi semantics I mean what attributes do I get. Same attributes, same semantics. I think we do not talk about same thing here. 

You are right. I am not talking about semantics of the parsed language but about the semantics of qi itself. What does  a programmer expect to get if you use a particular idiom?

I expect to get a string when i use the string parser explicitly. 

Frank

Frank Hein

Geschäftsführer
maxence business consulting gmbh 

phone +49-(0)-2133-2599-0
fax +49-(0)-2133-2599-29
cell +49-(0)-151-54 74 29 89
internet [hidden email]
skype fhmaxence

Am Weißen Stein 1
Stürzelbergcenter
D - 41541 Dormagen 
Sitz der Gesellschaft: Dormagen
Handelsregister: HRB 8966, Neuss
Geschäftsführer: Dipl.-Inform. Frank Hein
www.maxence.de


Von meinem iPhone gesendet

Am 27.05.2016 um 05:07 schrieb Lee Clagett <[hidden email]>:

On Wed, 25 May 2016 19:44:19 +0200
Frank Hein <[hidden email]> wrote:

Hello,

I am quite new to Spirit. Great work. :)

I found that (x %y) is not semantically equal to (x >> *(y >> x)).
The documentation says otherwise.
I'd consider this a bug. Otherwise documentation would have to be
changed at several places.
Below is a fully working example.


The expressions are semantically equal, as demonstrated in your
program. All of the generated parsers accept an identical set of inputs.
However, this example shows that the attributes exposed by the parsers
differ, and this is accurately documented too. So, the documentation is
correct AFAIK, but perhaps someone with a better grasp of formal parsing
terminology could correct me. And maybe an explanation of the
differences between language semantics and attributes could be added
somewhere?

Lee

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Frank Hein
In reply to this post by Lee Clagett-2
There is no particular warning in the docs telling me that the output of qi::string (btw. as well as the output of any other (attribute producing (of course)) parser can be "eaten up" when used with the % operator. 

Frank Hein

Geschäftsführer
maxence business consulting gmbh 

phone +49-(0)-2133-2599-0
fax +49-(0)-2133-2599-29
cell +49-(0)-151-54 74 29 89
internet [hidden email]
skype fhmaxence

Am Weißen Stein 1
Stürzelbergcenter
D - 41541 Dormagen 
Sitz der Gesellschaft: Dormagen
Handelsregister: HRB 8966, Neuss
Geschäftsführer: Dipl.-Inform. Frank Hein
www.maxence.de


Von meinem iPhone gesendet

Am 27.05.2016 um 05:07 schrieb Lee Clagett <[hidden email]>:

On Wed, 25 May 2016 19:44:19 +0200
Frank Hein <[hidden email]> wrote:

Hello,

I am quite new to Spirit. Great work. :)

I found that (x %y) is not semantically equal to (x >> *(y >> x)).
The documentation says otherwise.
I'd consider this a bug. Otherwise documentation would have to be
changed at several places.
Below is a fully working example.


The expressions are semantically equal, as demonstrated in your
program. All of the generated parsers accept an identical set of inputs.
However, this example shows that the attributes exposed by the parsers
differ, and this is accurately documented too. So, the documentation is
correct AFAIK, but perhaps someone with a better grasp of formal parsing
terminology could correct me. And maybe an explanation of the
differences between language semantics and attributes could be added
somewhere?

Lee

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Frank Hein
In reply to this post by Lee Clagett-2
Don't get me wrong, please. You actually do not need the % operator at all. As far as I understand it,  it is intended to be a way to express x >> *(y >> x) shorter and therefore more elegant. 

If that (and I actually just believe and not know that) was the intention to introduce an otherwise obsolete operator, this intention is missed. If they want you to use one for the other one must behave aus the other in any case. That's my notion of same sematics here. 

X % Y is not a fully featured replacement for X >> *( Y >> X). But once you know that, it's ok and you just drop % (until you find a case where it's special  behaviour is needed). Not ok for me at least is that each and any user has to find that out the hard way by trial and error that both Idioms are not the same. 

That's because you do not expect the reason of your problem to be right at this place. This is one of the last places to search. 

Frank Hein

Geschäftsführer
maxence business consulting gmbh 

phone +49-(0)-2133-2599-0
fax +49-(0)-2133-2599-29
cell +49-(0)-151-54 74 29 89
internet [hidden email]
skype fhmaxence

Am Weißen Stein 1
Stürzelbergcenter
D - 41541 Dormagen 
Sitz der Gesellschaft: Dormagen
Handelsregister: HRB 8966, Neuss
Geschäftsführer: Dipl.-Inform. Frank Hein
www.maxence.de


Von meinem iPhone gesendet


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Joel de Guzman
In reply to this post by Frank Hein
On 27/05/2016 2:36 PM, Frank Hein wrote:
> There is no particular warning in the docs telling me that the output of qi::string (btw.
> as well as the output of any other (attribute producing (of course)) parser can be "eaten
> up" when used with the % operator.

As always, I'd welcome contributions to the documentation. Feel free to
issue some PRs and I'll consider them.

Regards,
--
Joel de Guzman
http://www.ciere.com
http://boost-spirit.com
http://www.cycfi.com/


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Frank Hein

Rather than documenting the bug I'd provide a fix.

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general


smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Lee Clagett-2
On Fri, 27 May 2016 19:03:46 +0200
Frank Hein <[hidden email]> wrote:

> Rather than documenting the bug I'd provide a fix.

There is no bug. If the intent was to expose `b` in `a % b` then
the documentation in the list operator would be stated differently. The
heading "expression semantics" might need some clarification in that it
only covers the inputs accepted by the generated parser, but the parser
does not extract identical attributes from those inputs. More
importantly, fixing this "bug" could break existing code:

   int_ % char_(",;")

would currently expose a `Container<int>`; a change would have to
expose an `int` and `char` in a container.

Lee

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Lee Clagett-2
In reply to this post by Frank Hein
On Fri, 27 May 2016 08:36:24 +0200
Frank Hein <[hidden email]> wrote:

> There is no particular warning in the docs telling me that the output
> of qi::string (btw. as well as the output of any other (attribute
> producing (of course)) parser can be "eaten up" when used with the %
> operator.
>

This is not true, from the list operator documentation:

    Attributes

      See Compound Attribute Notation.

      Expression            Attribute
      a % b                 a: A, b: B --> (a % b): vector<A>
                            a: Unused, b: B --> (a % b): Unused

Which clearly states that `b` in the expression `a % b` is not exposed
as an attribute.

Lee

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Frank Hein

Ok. You are right. Verbously is explained in warming up sections somewhere that one can use a%b as an abbreviation for a>>*(b >> a). Which you can't if you need b.  Anyway, you are right. Thanks for pointing that out.

Frank :)
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general


smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Frank Hein
In reply to this post by Lee Clagett-2
With the current implementation expected parser output gets discarded when used with %. Allthough
it is documented as you pointed out this is somewhat strange at least.

You are right, a fix would break  int_ % char_(",;").

But if you don't want the char_(",;") attribute I would recommend to use lit instead of char_.

Often enough if happened, that bugs became features for good reasons. I do not know if this
is justified here. The use of % gets significantly limited for the sake of what?

Frank





From:        Lee Clagett <[hidden email]>
To:        [hidden email],
Date:        27.05.2016 20:07
Subject:        Re: [Spirit-general] [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))




On Fri, 27 May 2016 19:03:46 +0200
Frank Hein <[hidden email]> wrote:

> Rather than documenting the bug I'd provide a fix.

There is no bug. If the intent was to expose `b` in `a % b` then
the documentation in the list operator would be stated differently. The
heading "expression semantics" might need some clarification in that it
only covers the inputs accepted by the generated parser, but the parser
does not extract identical attributes from those inputs. More
importantly, fixing this "bug" could break existing code:

  int_ % char_(",;")

would currently expose a `Container<int>`; a change would have to
expose an `int` and `char` in a container.

Lee

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports.
https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Joel de Guzman
In reply to this post by Frank Hein
On 28/05/2016 7:46 AM, Frank Hein wrote:
> Ok. You are right. Verbously is explained in warming up sections somewhere that one can
> use a%b as an abbreviation for a>>*(b >> a). Which you can't if you need b.  Anyway, you
> are right. Thanks for pointing that out.

Admin hat on, please avoid snipping away context and please avoid
top posting. Thanks!

   (http://www.boost.org/community/policy.html)

Regards,
--
Joel de Guzman
http://www.ciere.com
http://boost-spirit.com
http://www.cycfi.com/


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Lee Clagett-2
In reply to this post by Frank Hein
On Sat, 28 May 2016 02:36:42 +0200
Frank Hein <[hidden email]> wrote:

> With the current implementation expected parser output gets discarded
> when used with %. Allthough
> it is documented as you pointed out this is somewhat strange at least.
>
> You are right, a fix would break  int_ % char_(",;").
>
> But if you don't want the char_(",;") attribute I would recommend to
> use lit instead of char_.
>

Yes, if the behavior of the list parser were changed everyone using it
could adapt. But why should everyone be required to review their usage
of the list operator because you want the attribute for the separator
exposed?

> Often enough if happened, that bugs became features for good reasons.
> I do not know if this
> is justified here. The use of % gets significantly limited for the
> sake of what?
>
> Frank
>

If the list parser does not meet your expectations or needs, then it is
an inconvenience to you but not necessarily a "bug that became a
feature". Joel has not said anything specifically about this topic, but
I am fairly certain the intent of the list parser was to omit the
separator from the exposed attribute. In the majority of cases
the separator value is irrelevant. For cases where this is not true,
the more verbose way of producing the identical parser is still
available.

Lee

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Frank Hein



> Am 29.05.2016 um 17:31 schrieb Lee Clagett <[hidden email]>:
>
> On Sat, 28 May 2016 02:36:42 +0200
> Frank Hein <[hidden email]> wrote:
>
>> With the current implementation expected parser output gets discarded
>> when used with %. Allthough
>> it is documented as you pointed out this is somewhat strange at least.
>>
>> You are right, a fix would break  int_ % char_(",;").
>>
>> But if you don't want the char_(",;") attribute I would recommend to
>> use lit instead of char_.
>
> Yes, if the behavior of the list parser were changed everyone using it
> could adapt. But why should everyone be required to review their usage
> of the list operator because you want the attribute for the separator
> exposed?

No, you were right. The char_(",;") functionality would be discarded without replacement. I did not see that first. lit works different to char_. Something like lit_char_ would be needed to to be able to model the current behaviour with a modified %. I think this would be inappropriate.

>> Often enough if happened, that bugs became features for good reasons.
>> I do not know if this
>> is justified here. The use of % gets significantly limited for the
>> sake of what?
>>
>> Frank
>
> If the list parser does not meet your expectations or needs, then it is
> an inconvenience to you but not necessarily a "bug that became a
> feature". Joel has not said anything specifically about this topic, but
> I am fairly certain the intent of the list parser was to omit the
> separator from the exposed attribute. In the majority of cases
> the separator value is irrelevant. For cases where this is not true,
> the more verbose way of producing the identical parser is still
> available.
>
It is an inconvenience, not more. I just wanted to help because I thought I found a bug in the core. I was wrong.

Spirit parser implementation is more or less straight-forward once you get confident with the mechanism to integrate them without polluting the qi namespace. So I can add what I need without changing qi.

Frank




> Lee
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
> _______________________________________________
> Spirit-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/spirit-general
>

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general


smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Joel de Guzman
In reply to this post by Lee Clagett-2
On 29/05/2016 11:28 PM, Lee Clagett wrote:
> If the list parser does not meet your expectations or needs, then it is
> an inconvenience to you but not necessarily a "bug that became a
> feature". Joel has not said anything specifically about this topic, but
> I am fairly certain the intent of the list parser was to omit the
> separator from the exposed attribute. In the majority of cases
> the separator value is irrelevant. For cases where this is not true,
> the more verbose way of producing the identical parser is still
> available.

It is the intent, yes. Indeed, in the majority of cases the separator
value is irrelevant. That has been the case with Qi and now with X3.
As always, the goal is to make it easy for the majority of cases, and
if possible, provide other means for other cases. I think that is what
we have here.

If this is unclear, then it is a documentation matter and thus I
will welcome any contributions to explain the issue better.

Regards,
--
Joel de Guzman
http://www.ciere.com
http://boost-spirit.com
http://www.cycfi.com/


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: [Spirit Qi %] (x%y) not semantically equivalent to (x >> *(y >> x))

Frank Hein


Frank Hein

Geschäftsführer
maxence business consulting gmbh 

phone +49-(0)-2133-2599-0
fax +49-(0)-2133-2599-29
cell +49-(0)-151-54 74 29 89
internet [hidden email]
skype fhmaxence

Am Weißen Stein 1
Stürzelbergcenter
D - 41541 Dormagen 
Sitz der Gesellschaft: Dormagen
Handelsregister: HRB 8966, Neuss
Geschäftsführer: Dipl.-Inform. Frank Hein
www.maxence.de


Von meinem iPhone gesendet

Am 30.05.2016 um 01:23 schrieb Joel de Guzman <[hidden email]>:

On 29/05/2016 11:28 PM, Lee Clagett wrote:
If the list parser does not meet your expectations or needs, then it is
an inconvenience to you but not necessarily a "bug that became a
feature". Joel has not said anything specifically about this topic, but
I am fairly certain the intent of the list parser was to omit the
separator from the exposed attribute. In the majority of cases
the separator value is irrelevant. For cases where this is not true,
the more verbose way of producing the identical parser is still
available.

It is the intent, yes. Indeed, in the majority of cases the separator
value is irrelevant. That has been the case with Qi and now with X3.
As always, the goal is to make it easy for the majority of cases, and
if possible, provide other means for other cases. I think that is what
we have here.

I completely understand. I really thought, I found a bug. That should have been addressed. But I was wrong. 


All questions are answered. Sorry for any inconvenience I caused. 

Frank


If this is unclear, then it is a documentation matter and thus I
will welcome any contributions to explain the issue better.

Regards,
--
Joel de Guzman
http://www.ciere.com
http://boost-spirit.com
http://www.cycfi.com/


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: expected_function

Frank Hein
In reply to this post by Lee Clagett-2
If you are still looking for an expect directive for qi 2

https://github.com/mxc-commons/MxcQitoo

Rgds, Frank
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: expected_function

Joel de Guzman
On 14/06/2016 10:43 AM, Frank Hein wrote:
> If you are still looking for an expect directive for qi 2
>
> https://github.com/mxc-commons/MxcQitoo
>

Nice! Wouldn't it make sense if we just added this to Qi? ;-)

Regards,
--
Joel de Guzman
http://www.ciere.com
http://boost-spirit.com
http://www.cycfi.com/


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: expected_function

Frank Hein


> Am 14.06.2016 um 07:20 schrieb Joel de Guzman <[hidden email]>:
>
>> On 14/06/2016 10:43 AM, Frank Hein wrote:
>> If you are still looking for an expect directive for qi 2
>>
>> https://github.com/mxc-commons/MxcQitoo
>
> Nice! Wouldn't it make sense if we just added this to Qi? ;-)

Really? Feel free. :) Would be a great honor.

Regards, Frank


> Regards,
> --
> Joel de Guzman
> http://www.ciere.com
> http://boost-spirit.com
> http://www.cycfi.com/
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
> _______________________________________________
> Spirit-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/spirit-general
>

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general


smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: expected_function

Frank Hein
In reply to this post by Joel de Guzman



> Am 14.06.2016 um 07:20 schrieb Joel de Guzman <[hidden email]>:
>
>> On 14/06/2016 10:43 AM, Frank Hein wrote:
>> If you are still looking for an expect directive for qi 2
>>
>> https://github.com/mxc-commons/MxcQitoo
>
> Nice! Wouldn't it make sense if we just added this to Qi? ;-)
>
Allthough I changed the readme twice to reflect that the operator is now / (instead of +=) this doc change did not make it to Github. Don't know why. Will sync again asap.

The change was necessary because of C++ operator precedence. += has lower prio than sequence, so parenthesis would have been required often. The idea to just replace % where needed requires divides.

Regards, Frank

> Regards,
> --
> Joel de Guzman
> http://www.ciere.com
> http://boost-spirit.com
> http://www.cycfi.com/
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
> _______________________________________________
> Spirit-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/spirit-general
>

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general


smime.p7s (6K) Download Attachment
12