Spirit semantic actions and closures
Hi I have a question about semantic actions which generate the equivalent of synthesized attributes. It seems that the right hand side of the expression below rule = element [rule.val = val_type(some_params)]; will require the type of val in the closure associated with rule to be val_type which has a constructor which looks like val_type::val_type(some_params). Its not clear to me however how I would synthesize an attribute which is a pointer to some type. For example, in the closure I would like the type of synthesized attribute to be val_type* and for the right hand side of assignment above to be val_type(some_params)() which returns a val_type* where the following was true of the () operator : const val_type* val_type::operator () {do something and eventually return a val_type*;} I'd be very grateful if someone could clue me in on how I might do this. thanks venkat
Hi, You might want to post Spirit support related messages to Spirit's mailing list so that others can be able to help you out besides me and that other Spirit users might find the discussion useful. _______________________________________________ Spirit-general mailing list Spirit-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spirit-general I took the liberty to post your message there. I'll post follow-up questions related to your inquiry there. Regards, -- Joel de Guzman joel at boost-consulting.com http://www.boost-consulting.com http://spirit.sf.net venkatram_krishnaswamy wrote:
Hi
I have a question about semantic actions which generate the equivalent of synthesized attributes.
It seems that the right hand side of the expression below
rule = element [rule.val = val_type(some_params)];
will require the type of val in the closure associated with rule to be val_type which has a constructor which looks like val_type::val_type(some_params).
Its not clear to me however how I would synthesize an attribute which is a pointer to some type. For example, in the closure I would like the type of synthesized attribute to be val_type* and for the right hand side of assignment above to be val_type(some_params)() which returns a val_type* where the following was true of the () operator :
const val_type* val_type::operator () {do something and eventually return a val_type*;}
I'd be very grateful if someone could clue me in on how I might do this.
thanks
venkat
participants (2)
-
Joel de Guzman
-
venkatram_krishnaswamy