semantic action problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

semantic action problem

Eugene Varshavsky
Klemens,
Thank you for the quick reply,

Sorry for posting a screen shot in the first place...

I am attaching the code this time. It is an exact copy from the Spirit
tutorial at:
http://ciere.com/cppnow15/x3_docs/spirit/tutorials/semantic_actions.html

I am using:
Visual Studio Community 2015
Version 14.0.24720.00 Update 1

File call.hpp appears to be part of boost.spirit, it is located at:
C/.../Boost/boost_1_62_0/boost/spirit/home/x3/core

Using x3::_attr in main for the lambda did not seem to help.

Thank you,
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

feature_descriptor_main.cpp (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: semantic action problem

Klemens Morgenstern
The good new is: the example is fine and works on gcc 6. The bad news
is, it doesn't on msvc, so this seems to be the problem here. I tried a
global declaration, i.e. this:

auto f = [](auto& ctx) { std::cout << x3::_attr(ctx) << std::endl; };
x3::rule<class test_rule> test_rule;
auto test_rule_def = '{' >> x3::int_[f] >> '}';
BOOST_SPIRIT_DEFINE(test_rule);

But that only changed the error type. So you could switch to mingw 6.2
and would be able to use it, but maybe someone knows how to get it to
work on msvc.



Am 04.12.2016 um 19:44 schrieb Eugene Varshavsky:

> Klemens,
> Thank you for the quick reply,
>
> Sorry for posting a screen shot in the first place...
>
> I am attaching the code this time. It is an exact copy from the Spirit
> tutorial at:
> http://ciere.com/cppnow15/x3_docs/spirit/tutorials/semantic_actions.html
>
> I am using:
> Visual Studio Community 2015
> Version 14.0.24720.00 Update 1
>
> File call.hpp appears to be part of boost.spirit, it is located at:
> C/.../Boost/boost_1_62_0/boost/spirit/home/x3/core
>
> Using x3::_attr in main for the lambda did not seem to help.
>
> Thank you,
> 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
|

Re: semantic action problem

tomkulaga
There are known problems with MSVC and sprirt X3 especially when it comes to the define macro. Someone has posted a modifies macro on these mailing lists to fix this particular issue. 

On 5 Dec. 2016 6:27 am, "Klemens Morgenstern" <[hidden email]> wrote:
The good new is: the example is fine and works on gcc 6. The bad news
is, it doesn't on msvc, so this seems to be the problem here. I tried a
global declaration, i.e. this:

auto f = [](auto& ctx) { std::cout << x3::_attr(ctx) << std::endl; };
x3::rule<class test_rule> test_rule;
auto test_rule_def = '{' >> x3::int_[f] >> '}';
BOOST_SPIRIT_DEFINE(test_rule);

But that only changed the error type. So you could switch to mingw 6.2
and would be able to use it, but maybe someone knows how to get it to
work on msvc.



Am 04.12.2016 um 19:44 schrieb Eugene Varshavsky:
> Klemens,
> Thank you for the quick reply,
>
> Sorry for posting a screen shot in the first place...
>
> I am attaching the code this time. It is an exact copy from the Spirit
> tutorial at:
> http://ciere.com/cppnow15/x3_docs/spirit/tutorials/semantic_actions.html
>
> I am using:
> Visual Studio Community 2015
> Version 14.0.24720.00 Update 1
>
> File call.hpp appears to be part of boost.spirit, it is located at:
> C/.../Boost/boost_1_62_0/boost/spirit/home/x3/core
>
> Using x3::_attr in main for the lambda did not seem to help.
>
> Thank you,
> 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
Reply | Threaded
Open this post in threaded view
|

Re: semantic action problem

Eugene Varshavsky
It works now.
Someone on Stack Overflow suggested that I get Update 3 for the VS. So I did, and the code began to work...


On 12/4/2016 3:10 PM, Tom Kulaga wrote:
There are known problems with MSVC and sprirt X3 especially when it comes to the define macro. Someone has posted a modifies macro on these mailing lists to fix this particular issue. 

On 5 Dec. 2016 6:27 am, "Klemens Morgenstern" <[hidden email]> wrote:
The good new is: the example is fine and works on gcc 6. The bad news
is, it doesn't on msvc, so this seems to be the problem here. I tried a
global declaration, i.e. this:

auto f = [](auto& ctx) { std::cout << x3::_attr(ctx) << std::endl; };
x3::rule<class test_rule> test_rule;
auto test_rule_def = '{' >> x3::int_[f] >> '}';
BOOST_SPIRIT_DEFINE(test_rule);

But that only changed the error type. So you could switch to mingw 6.2
and would be able to use it, but maybe someone knows how to get it to
work on msvc.



Am 04.12.2016 um 19:44 schrieb Eugene Varshavsky:
> Klemens,
> Thank you for the quick reply,
>
> Sorry for posting a screen shot in the first place...
>
> I am attaching the code this time. It is an exact copy from the Spirit
> tutorial at:
> http://ciere.com/cppnow15/x3_docs/spirit/tutorials/semantic_actions.html
>
> I am using:
> Visual Studio Community 2015
> Version 14.0.24720.00 Update 1
>
> File call.hpp appears to be part of boost.spirit, it is located at:
> C/.../Boost/boost_1_62_0/boost/spirit/home/x3/core
>
> Using x3::_attr in main for the lambda did not seem to help.
>
> Thank you,
> 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


------------------------------------------------------------------------------

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