Boost logo

Boost Users :

Subject: Re: [Boost-users] boost.spirit.qi : how to disable semantic actions
From: olivier musse (olivier.musse_at_[hidden])
Date: 2010-06-12 15:54:46


Hi Hartmut,

First of all, many thanks for your answer.
I'm really new to spirit so I have no idea how to do that myself except
managing a flag to have a different behavior in implemented semantic
actions and this will be hard to manage for operators.

Perhaps there is another solution to my purpose :
I have implemented a simple interpretor for a domain specific langage
(like basic) based on semantic actions.
What I would like is to check the syntax so without performing any
action and I found it stupid to dublicate the grammar without the actions.

I would also like to disable actions for loop implementation in my
simple langage. In fact I use the raw directive to get the string
associated to the block inside the loop and parse this block (it
containes semantic actions) as many times as the loop size. The issue
is that the semantic actions associated to the block sub rules are
called even if the loop size is 0 and I have to manage this case in my
langage. On that point, perhaps i'am also not using spirit in the right
way. If you have any advices, they are welcome.

Regards

Oli

>> I'am using spirit::qi for developping a parser. Thanks boost for this
>> great job.
>> My issue is that I would like to test the syntax of my grammar before
>> performing semantic actions. Is these any way to do that, I mean parse a
>> string without performing the defined semantic actions ?
>> Thanks in advance for any help
>>
> There isn't such a thing in Spirit. But you're the second one to ask so I
> assume it has some value to implement something allowing to achieve this
> behavior (a directive? i.e. noactions[...] would inhibit the execution of
> all semantic actions for the embedded parser). I believe this is possible
> without too much effort. I'll see what I can do.
>
> Regards Hartmut
>
> ---------------
> Meet me at BoostCon
> www.boostcon.com
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
>
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net