[Spirit2 - docs] Notes from reading "Tutorials" section

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Spirit2 - docs] Notes from reading "Tutorials" section

Tobias Schwinger-2
Hi,

here are the notes I took reading the "Tutorials" section of the Spirit2
docs.

It was a pleasant read (so the overall positive impression does not get
obscured by the picky "warning level").

Hope all can be decoded and helps making things better.

Regards,
Tobias





Warming up

  o Advertise operator% for lists... Shows new users common tasks are
    taken care of in terms of simple syntax

  o Introduction of operators for creating complex parsers could use
    a link to the part of the Quick reference for the curious reader.

Semantic actions

  o Misleading quotes "{integer}". The block should be enough quoting,
    actually.

  o Too many ways to bind might be confusing. Why demonstrate using
    Bind and Lambda if Phoenix is the preferred way to bind?
    Might be OK to mention this stuff later, but I wouldn't want to
    know it all that early as a new user. Or something like "if you
    are familiar...".
    A friend of mine who has been using Spirit (1) told me that he
    seriously got confused by the numerous ways to bind actions, at
    first.

Roman numerals

  o An example for the Signature template argument where it's first
    mentioned would be nice.
    Further might be helpful to more explicitly state that Rules can
    take input and produce output (and operators therefore, maybe).
    The terms "inherited/synthesized attribute" and "result/args" are
    could be explained simpler and clearer, I think (took me quite a
    while to decode what you actually mean).

Employee - Parsing into structs

  o Sequence Attibute: I'd prefer to know that a fusion::vector is
    "a fixed-size sequence of possibly differently typed elements"
    (or so) rather than begin "a tuple" (clearer).

  o Attribute Collapsing: Can I discard an attribute explicitly?
  o Attribute Collapsing: Do string literals produce attributes?

  o Auto Rules: Adding "note operator %=" (or so) could be helpful
    (one changed character might get overlooked, easily)

Mini XML - ASTs!

  o Explaining very briefly what at_c<0> actually does, seems a
    better idea than just referring to Fusion/Phoenix docs. Also
    should mention the names of the member variables accessed in
    the mini_xml structure.

  o Of Alternates and Variants: Hyperlink to Boost.Variant should be
    added.

Mini XML - Error Handling
 
  o What is on_error - an inherited member function template? Wonder
    whether it compiles with anything but MSVC for likely being a
    "dependent name"...

  o 'retry' and 'accept' being sorta unclear. How would I implement
    error recovery? Move the iterator inside the handler? If so, should
    be said explicitly.

  o Expectation Points: Hard to understand - too much techy jargon.
    Could  be explained simpler with natural language: "The point where
    we know for we belong into the rule, for sure. Everything beyond is
    expected to be in its place." (or so).
    IIRC I used the wording "separating the identifying part of a rule"
    proposing this feature (less lengthy, but probably too techy, also).



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Spirit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-devel