semantic action problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

semantic action problem

Eugene Varshavsky
Greetings,

I started with spirit 2 days ago and ran in to a small problem. Part of the actions.cpp example from the X3 tutorial is not working.

I am using Visual Studio, I copied actions.cpp completely and exactly, made sure to include right path info into Visual Studio. So far everything seems to work except the semantic action. Visual Studio reports error that it is expecting the semantic action functions to provide arguments, see attached image. Yet, the original code does not have any arguments for semantic action functions.

I tried to the following:
1. removing or commenting out [print_action()] and [f] from the code made it compile and run without errors
2. with semantic actions commented, if I add the value as the forth parameter to parse function, it gets the right value
3. double checked that some test lambda and template do in fact work fine on my system

What am I doing wrong? Do I need to specify somewhere that I want to use semantic actions?

Many thanks,
Eugene



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: semantic action problem

Klemens Morgenstern
First thing you're doing wrong is to post a screenshot and not code. If you want help, you should enable us to try your code out, which is rather hard, going by a screenshot.
Secondly, you didn't tell us which version of Visual Studio you are using.
Also the error seems to point to call.hpp:57 - what's there?

Then you probaly need to write using x3::_attr; into the the main function for the lambda.

Other than that, the code looks fine too me, which compilers did you try it on?

I'm also not sure spirit.x3 is even supported by the current msvc.
Greetings,

I started with spirit 2 days ago and ran in to a small problem. Part of the actions.cpp example from the X3 tutorial is not working.

I am using Visual Studio, I copied actions.cpp completely and exactly, made sure to include right path info into Visual Studio. So far everything seems to work except the semantic action. Visual Studio reports error that it is expecting the semantic action functions to provide arguments, see attached image. Yet, the original code does not have any arguments for semantic action functions.

I tried to the following:
1. removing or commenting out [print_action()] and [f] from the code made it compile and run without errors
2. with semantic actions commented, if I add the value as the forth parameter to parse function, it gets the right value
3. double checked that some test lambda and template do in fact work fine on my system

What am I doing wrong? Do I need to specify somewhere that I want to use semantic actions?

Many thanks,
Eugene




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Loading...