|
Boost : |
From: Joel de Guzman (djowel_at_[hidden])
Date: 2003-07-16 18:23:54
Kai-Mikael Jää-Aro <kai_at_[hidden]> wrote:
> I obviously have not understood how spirit rules are supposed to work. The
> simple program below fails to compile (spewing out 42 lines of error
> messages). If I replace the application of 'Id' with int_p directly it works
> OK.
> What am I supposed to do to get the intended effect?
>
>
> #include <iostream>
> #include <boost/spirit.hpp>
>
> using namespace std;
> using namespace boost::spirit;
>
> int main(int *argc, char *argv[])
> {
>
> int ID;
>
> rule<> Id = int_p;
>
> if (parse(argv[1],
> Id [assign(ID)],
> space_p).full)
> {
> cout << "Value = " << ID << endl;
> }
> else
> {
> cout << "Failed\n";
> }
> }
Hi,
See the FAQ "The Scanner Business". It's always a good idea
to scan the FAQ first.
BTW, Spirit has its own mailing list:
Spirit-general mailing list
Spirit-general_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Cheers,
-- Joel de Guzman joel at boost-consulting.com http://www.boost-consulting.com http://spirit.sf.net
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk