Index: libs/spirit/doc/qi_and_karma/employee.qbk =================================================================== --- libs/spirit/doc/qi_and_karma/employee.qbk (revision 49828) +++ libs/spirit/doc/qi_and_karma/employee.qbk (working copy) @@ -15,7 +15,7 @@ demonstrates some features of Spirit2 that makes this easy. In the process, you'll learn about: -* More about attributes +* More attributes * Auto rules * Some more built-in parsers * Directives @@ -26,8 +26,8 @@ [tutorial_employee_struct] -Then, we need to tell __fusion__ about our employee struct to make it a first- -class fusion citizen. If you don't know fusion yet, it is a __boost__ library +Then, we need to tell __fusion__ about our employee struct to make it a +first-class fusion citizen. If you don't know fusion yet, it is a __boost__ library for working with heterogenous collections of data, commonly referred to as tuples. Spirit uses fusion extensively as part of its infrastructure. @@ -61,12 +61,12 @@ employee_parser() : employee_parser::base_type(start) -Initializes the base class. +Initialize the base class. rule quoted_string; rule start; -Declares two rules: `quoted_string` and `start`. `start` has the same template +Declare two rules: `quoted_string` and `start`. `start` has the same template parameters as the grammar itself. `quoted_string` has a `std::string` attribute. [heading Lexeme] @@ -87,7 +87,7 @@ a - b -parses `a` but not `b`. Its attribute is just `A`, the attribute of `a`. `b`'s +parses `a` but not `b`. Its attribute is just `A`; the attribute of `a`. `b`'s attribute is ignored. Hence, the attribute of: char_ - '"' @@ -98,8 +98,8 @@ +a -is the close kin of the kleene star we got so used to in our tutorial. Like it's -kin, the kleene star, its attribute is a `std::vector` where `A` is the +is the close kin of the Kleene star we got so used to in our tutorial. Like its +kin, the Kleene star, its attribute is a `std::vector` where `A` is the attribute of `a`. So, putting all these together, the attribute of +(char_ - '"') @@ -143,9 +143,9 @@ fusion::vector > -But wait, there's one more collapsing rule: If after the attribute is a single -element `fusion::vector`, The element is stripped naked from its container. So, -to make a long story short, the attribute of the expression: +But wait, there's one more collapsing rule: If the attribute is followed by a +single element `fusion::vector`, the element is stripped naked from its container. +To make a long story short, the attribute of the expression: '"' >> +(char_ - '"') >> '"' @@ -159,9 +159,9 @@ r = p[_val = _1]; -If you have a rule definition like above where the attribute of the RHS (right -hand side) of the rule is compatibe with the attribute of the LHS (left hand -side), then you can rewrite it as: +If you have a rule definition such as the above, where the attribute of the RHS +(right hand side) of the rule is compatible with the attribute of the LHS (left +hand side), you can rewrite it as: r %= p;