Error handling and annotation in Boost.Spirit X3

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

Error handling and annotation in Boost.Spirit X3

Orient
This post was updated on .
What is the strategy to instrument the AST node structures with boost::spirit::x3::position_tagged and when boost::spirit::x3::rule ID template parameter must have an on_success or on_error memeber functions? Is there any difference for variant and not-variant types? When I should provide both on_error and on_success member functions? How propagates an error through different nodes? Should I provide on_error and/or on_success for variant node and its bounded types, or only for one of them? Which one? How to complitely avoid an boost::spirit::x3::expectation_failure exception?
Is there correct example for grammar, like mini-C or conjure (I suspect, that examples from boost/examples not too correct)?
Reply | Threaded
Open this post in threaded view
|

Re: Error handling and annotation in Boost.Spirit X3

Joel de Guzman
On 9/13/14, 4:23 PM, Orient wrote:
> What is the strategy to instrument the AST node structures with
> boost::spirit::x3::position_tagged and when boost::spirit::x3::rule ID
> template parameter must have an on_success or on_error memeber functions? Is
> there any difference for variant and not-variant types?

None.

> When I should
> provide both on_error and on_success member functions?

on_error when you want to do something when an error is found
on_success like semantic actions, but without polluting the grammar

> How propagates an
> error throw different nodes?

See docs on error handling. It's the same with Qi
(e.g. http://tinyurl.com/lpwlnkc)

> Should I provide on_error and/or on_success for
> variant node and its bounded types, or only for one of them? Which one?

Depends on what you want to do. Try it and play round with it
to get familiarity. It's easy to understand once you use it.

> Is there correct example for grammar, like mini-C or conjure (I suspect,
> that examples from boost/examples not too correct)?

The X3 examples should be good. Do you see any problems with them?
Also, you might want to check out Baptiste's on going work on X3:
(http://tinyurl.com/lfjgsxn)

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


------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: Error handling and annotation in Boost.Spirit X3

Orient
Joel de Guzman wrote

> On 9/13/14, 4:23 PM, Orient wrote:
>> What is the strategy to instrument the AST node structures with
>> boost::spirit::x3::position_tagged and when boost::spirit::x3::rule ID
>> template parameter must have an on_success or on_error memeber functions?
>> Is
>> there any difference for variant and not-variant types?
>
> None.
>
>> When I should
>> provide both on_error and on_success member functions?
>
> on_error when you want to do something when an error is found
> on_success like semantic actions, but without polluting the grammar
>
>> How propagates an
>> error throw different nodes?
>
> See docs on error handling. It's the same with Qi
> (e.g. http://tinyurl.com/lpwlnkc)
>
>> Should I provide on_error and/or on_success for
>> variant node and its bounded types, or only for one of them? Which one?
>
> Depends on what you want to do. Try it and play round with it
> to get familiarity. It's easy to understand once you use it.
>
>> Is there correct example for grammar, like mini-C or conjure (I suspect,
>> that examples from boost/examples not too correct)?
>
> The X3 examples should be good. Do you see any problems with them?
> Also, you might want to check out Baptiste's on going work on X3:
> (http://tinyurl.com/lfjgsxn)
>
> Regards,
> --
> Joel de Guzman
> http://www.ciere.com
> http://boost-spirit.com
> http://www.cycfi.com/
>
>
> ------------------------------------------------------------------------------
> Want excitement?
> Manually upgrade your production database.
> When you want reliability, choose Perforce
> Perforce version control. Predictably reliable.
> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
> _______________________________________________
> Spirit-general mailing list

> Spirit-general@.sourceforge

> https://lists.sourceforge.net/lists/listinfo/spirit-general

First link make recursion.



--
View this message in context: http://boost.2283326.n4.nabble.com/Error-handling-and-annotation-in-Boost-Spirit-X3-tp4667515p4682890.html
Sent from the spirit-general mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general