Kai-Mikael Jää-Aro <[EMAIL PROTECTED]> wrote:
> Joel de Guzman wrote:
>
>> Kai-Mikael Jää-Aro <[EMAIL PROTECTED]> 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?

[snip]

>> See the FAQ "The Scanner Business". It's always a good idea
>> to scan the FAQ first.
>
> I have read, but not understood.  I change the rule<> to
> rule<phrase_scanner_t>, but I am still not allowed to perform the assignment.
> I suspect that I am supposed to supply further arguments to the rule<> in
> order to specify its return type so that the assignment gets properly
> interpreted, so I have carefully gone through the manual pages for "The
> Rule", "Semantic Actions" and "Predefined Actions", with quick dips into
> other sections, but I have not found examples of how to do it.

Hi again,

Would this solve your problem?

    int ID;
    rule<phrase_scanner_t> Id = int_p[assign(ID)];
    parse(argv[1], Id space_p);

BTW, did I mention that Spirit has its mailing list?

    [EMAIL PROTECTED]
    https://lists.sourceforge.net/lists/listinfo/spirit-general

HTH,
--
Joel de Guzman
joel at boost-consulting.com
http://www.boost-consulting.com
http://spirit.sf.net

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to