T
truelixin
1>
2> #include <boost/spirit/core.hpp>
3>
4> using namespace boost::spirit;
5>
6> rule<> expr, identity;
7>
8> expr = identity % '+';
9> identity = ch_p('X') | ch_p('Y');
10>
11> int main()
12> {
13> parse_info<> info = parse("X+Y", expr);
14> }
Just this simple program, I use VC8, but can't compile it.
------ Build started: Project: BoostSpiritTest, Configuration: Debug
Win32 ------
Compiling...
main.cpp
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(8) : error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(8) : error C2371: 'expr' : redefinition;
different basic types
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(6) : see declaration of 'expr'
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(8) : error C2440: 'initializing' : cannot
convert from 'boost::spirit::sequence<A,B>' to 'int'
with
[
A=boost::spirit::rule<>,
B=boost::spirit::kleene_star<boost::spirit::sequence<boost::spirit::chlit<char>,boost::spirit::rule<>>>
]
No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(9) : error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(9) : error C2371: 'identity' : redefinition;
different basic types
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(6) : see declaration of 'identity'
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(9) : error C2440: 'initializing' : cannot
convert from 'boost::spirit::alternative<A,B>' to 'int'
with
[
A=boost::spirit::chlit<char>,
B=boost::spirit::chlit<char>
]
No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called
Build log was saved at "file://d:\MyDocuments\Visual Studio
2005\Projects\BoostSpiritTest\BoostSpiritTest\Debug\BuildLog.htm"
BoostSpiritTest - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==========
2> #include <boost/spirit/core.hpp>
3>
4> using namespace boost::spirit;
5>
6> rule<> expr, identity;
7>
8> expr = identity % '+';
9> identity = ch_p('X') | ch_p('Y');
10>
11> int main()
12> {
13> parse_info<> info = parse("X+Y", expr);
14> }
Just this simple program, I use VC8, but can't compile it.
------ Build started: Project: BoostSpiritTest, Configuration: Debug
Win32 ------
Compiling...
main.cpp
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(8) : error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(8) : error C2371: 'expr' : redefinition;
different basic types
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(6) : see declaration of 'expr'
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(8) : error C2440: 'initializing' : cannot
convert from 'boost::spirit::sequence<A,B>' to 'int'
with
[
A=boost::spirit::rule<>,
B=boost::spirit::kleene_star<boost::spirit::sequence<boost::spirit::chlit<char>,boost::spirit::rule<>>>
]
No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(9) : error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(9) : error C2371: 'identity' : redefinition;
different basic types
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(6) : see declaration of 'identity'
d:\mydocuments\visual studio 2005\projects\boostspirittest
\boostspirittest\main.cpp(9) : error C2440: 'initializing' : cannot
convert from 'boost::spirit::alternative<A,B>' to 'int'
with
[
A=boost::spirit::chlit<char>,
B=boost::spirit::chlit<char>
]
No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called
Build log was saved at "file://d:\MyDocuments\Visual Studio
2005\Projects\BoostSpiritTest\BoostSpiritTest\Debug\BuildLog.htm"
BoostSpiritTest - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==========