|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
Grammar signatureThis compiles with error ...
Were is misspelling? Pls help ... I want my grammar to bi with signature some_type(another_type) Is this possible? #include <boost/spirit/include/qi.hpp> #include <iostream> int main() { using boost::spirit::ascii::space; using boost::spirit::ascii::string; using boost::spirit::qi::lit; using namespace boost::spirit::qi::labels; std::string storage("parstxt"); std::string::const_iterator iter = storage.begin(); std::string::const_iterator end = storage.end(); std::string outp; std::string test("adfs"); boost::spirit::qi::rule<std::string::const_iterator,std::string(std::string),b > myrule; myrule = string(_r1); return phrase_parse(iter, end, myrule(test), space,outp); } ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Spirit-general mailing list Spirit-general@... https://lists.sourceforge.net/lists/listinfo/spirit-general |
|
|
Re: Grammar signatureOn Fri, Oct 30, 2009 at 11:33 PM, Dainis Polis <dainisp@...> wrote:
> This compiles with error ... > Were is misspelling? > Pls help ... > I want my grammar to bi with signature some_type(another_type) > Is this possible? > > #include <boost/spirit/include/qi.hpp> > #include <iostream> > > int main() > { > using boost::spirit::ascii::space; > using boost::spirit::ascii::string; > using boost::spirit::qi::lit; > using namespace boost::spirit::qi::labels; > > std::string storage("parstxt"); > std::string::const_iterator iter = storage.begin(); > std::string::const_iterator end = storage.end(); > > std::string outp; > std::string test("adfs"); > > boost::spirit::qi::rule<std::string::const_iterator,std::string(std::string),b > > myrule; > myrule = string(_r1); > return phrase_parse(iter, end, myrule(test), space,outp); > } On your rule<std::string::const_iterator,std::string(std::string),b> line, why do you have a ",b" at the end? That is where your skipper should go, but I see no symbol int he posted code that is named "b". Also, I would bet your parse will fail since the test and storage strings are different. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Spirit-general mailing list Spirit-general@... https://lists.sourceforge.net/lists/listinfo/spirit-general |
|
|
Re: Grammar signatureOvermindDL1 wrote:
>> >> boost::spirit::qi::rule<std::string::const_iterator,std::string(std::string),b >> > myrule; >> myrule = string(_r1); >> Ok this misspelling with b because my mailclient program hust howto wraps string nedd to be boost::spirit::qi::rule<std::string::const_iterator,std::string(std::string), boost::spirit::ascii::space > myrule; >> return phrase_parse(iter, end, myrule(test), space,outp); >> } >> > > On your rule<std::string::const_iterator,std::string(std::string),b> > line, why do you have a ",b" at the end? That is where your skipper > should go, but I see no symbol int he posted code that is named "b". > > Also, I would bet your parse will fail since the test and storage > why? > strings are different. > ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Spirit-general mailing list Spirit-general@... https://lists.sourceforge.net/lists/listinfo/spirit-general |
|
|
Re: Grammar signatureOn Sun, Nov 1, 2009 at 10:46 PM, Dainis Polis <dainis@...> wrote:
> OvermindDL1 wrote: >>> >>> boost::spirit::qi::rule<std::string::const_iterator,std::string(std::string),b >>> > myrule; >>> myrule = string(_r1); >>> > Ok this misspelling with b because my mailclient program > hust howto wraps string nedd to be > > boost::spirit::qi::rule<std::string::const_iterator,std::string(std::string), > boost::spirit::ascii::space > > myrule; > > > > >>> return phrase_parse(iter, end, myrule(test), space,outp); >>> } >>> >> >> On your rule<std::string::const_iterator,std::string(std::string),b> >> line, why do you have a ",b" at the end? That is where your skipper >> should go, but I see no symbol int he posted code that is named "b". >> >> Also, I would bet your parse will fail since the test and storage >> > I just don't worried at the moment about parse result, but compile fails? > why? > >> strings are different. I cannot test compiler that at this moment (at work), but if you can post the error message you get then that can help a lot. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Spirit-general mailing list Spirit-general@... https://lists.sourceforge.net/lists/listinfo/spirit-general |
|
|
Re: Grammar signatureOvermindDL1 wrote:
> > > I cannot test compiler that at this moment (at work), but if you can > post the error message you get then that can help a lot. > Three errors: 1- main.cpp:21: instantiated from here C:/test/boost_trunk/boost/utility/result_of.hpp:79: error: no class template named 'result' in 'struct std::basic_string<char, std::char_traits<char>, std::allocator<char> >' 2- main.cpp:21: instantiated from here C:/test/boost_trunk/boost/mpl/eval_if.hpp:38: error: no type named 'type' in 'struct boost::result_of<std::basic_string<char, std::char_traits<char>, std::allocator<char> >(boost::fusion::unused_type, boost::fusion::unused_type)>' 3- main.cpp:21: instantiated from here C:/test/boost_trunk/boost/spirit/home/support/context.hpp:61: error: no matching function for call to 'as_list(boost::fusion::transform_view<const boost::fusion::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_>, boost::spirit::detail::expand_arg<const boost::fusion::unused_type>, boost::fusion::void_>)' ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Spirit-general mailing list Spirit-general@... https://lists.sourceforge.net/lists/listinfo/spirit-general |
|
|
Re: Grammar signatureAnd also code , which were compiled ...
#include <boost/spirit/include/qi.hpp> #include <iostream> int main() { using boost::spirit::ascii::space; using boost::spirit::ascii::string; using boost::spirit::qi::lit; using namespace boost::spirit::qi::labels; std::string storage("parstxt"); std::string::const_iterator iter = storage.begin(); std::string::const_iterator end = storage.end(); std::string outp; std::string test("adfs"); boost::spirit::qi::rule<std::string::const_iterator,std::string(std::string), boost::spirit::ascii::space_type > myrule; myrule = string(_r1); return phrase_parse(iter, end, myrule(test), space,outp); } Dainis Polis wrote: > OvermindDL1 wrote: > >> I cannot test compiler that at this moment (at work), but if you can >> post the error message you get then that can help a lot. >> >> > Three errors: > 1- > main.cpp:21: instantiated from here > C:/test/boost_trunk/boost/utility/result_of.hpp:79: error: no class > template named 'result' in 'struct std::basic_string<char, > std::char_traits<char>, std::allocator<char> >' > 2- > main.cpp:21: instantiated from here > C:/test/boost_trunk/boost/mpl/eval_if.hpp:38: error: no type named > 'type' in 'struct boost::result_of<std::basic_string<char, > std::char_traits<char>, std::allocator<char> > >(boost::fusion::unused_type, boost::fusion::unused_type)>' > 3- > > main.cpp:21: instantiated from here > C:/test/boost_trunk/boost/spirit/home/support/context.hpp:61: error: no > matching function for call to > 'as_list(boost::fusion::transform_view<const > boost::fusion::vector<std::basic_string<char, std::char_traits<char>, > std::allocator<char> >, boost::fusion::void_, boost::fusion::void_, > boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, > boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, > boost::fusion::void_>, boost::spirit::detail::expand_arg<const > boost::fusion::unused_type>, boost::fusion::void_>)' > > > > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Spirit-general mailing list > Spirit-general@... > https://lists.sourceforge.net/lists/listinfo/spirit-general > > > ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Spirit-general mailing list Spirit-general@... https://lists.sourceforge.net/lists/listinfo/spirit-general |
| Free embeddable forum powered by Nabble | Forum Help |