boost spirit semantic action parameters

Posted by lurscher on Stack Overflow See other posts from Stack Overflow or by lurscher
Published on 2010-06-18T01:33:24Z Indexed on 2010/06/18 1:43 UTC
Read the original article Hit count: 816

Filed under:
|
|
|

Hi,

in this article about boost spirit semantic actions it is mentioned that

There are actually 2 more arguments being passed: the parser context and a reference to a boolean ‘hit’ parameter. The parser context is meaningful only if the semantic action is attached somewhere to the right hand side of a rule. We will see more information about this shortly. The boolean value can be set to false inside the semantic action invalidates the match in retrospective, making the parser fail.

All fine, but i've been trying to find an example passing a function object as semantic action that uses the other parameters (parser context and hit boolean) but i haven't found any. I would love to see an example using regular functions or function objects, as i barely can grok the phoenix voodoo

© Stack Overflow or respective owner

Related posts about c++

Related posts about parsing