2
0
mirror of https://github.com/boostorg/spirit.git synced 2026-01-19 04:42:11 +00:00

improve documentation for semantic actions in %=

Also see https://github.com/boostorg/spirit/issues/411
This commit is contained in:
Godmar Back
2018-10-26 09:21:14 -04:00
parent 4be6e2d033
commit 9774844992
2 changed files with 8 additions and 6 deletions

View File

@@ -123,10 +123,11 @@ not defined in __qi_nonterminal__.
[[`r = p;`] [Rule definition. This is equivalent to `r %= p`
(see below) if there are no semantic actions attached
anywhere in `p`.]]
[[`r %= p;`] [Auto-rule definition. The attribute of `p` should be
compatible with the synthesized attribute of `r`. When `p`
[[`r %= p;`] [Auto-rule definition. The attribute of `p` must be
compatible with the synthesized attribute of `r`. If `p`
is successful, its attribute is automatically propagated
to `r`'s synthesized attribute.]]
to `r`'s synthesized attribute. Semantic actions, if present,
may not change the attribute's type.]]
[[`r.name()`] [Retrieve the current name of the rule object.]]
[[`r.name(name)`] [Set the current name of the rule object to be `name`.]]
]

View File

@@ -431,10 +431,11 @@ a: Unused, b: Unused --> (a ^ b): Unused``]]
[[`r.name()`] [Getting the name of a rule]]
[[debug(r)] [Debug rule `r`]]
[[`r = p;`] [Rule definition]]
[[`r %= p;`] [Auto-rule definition. The attribute of `p` should be
compatible with the synthesized attribute of `r`. When `p`
[[`r %= p;`] [Auto-rule definition. The attribute of `p` must be
compatible with the synthesized attribute of `r`. If `p`
is successful, its attribute is automatically propagated
to `r`'s synthesized attribute.]]
to `r`'s synthesized attribute. Semantic actions, if present,
may not change the attribute's type.]]
[[
``