Spirit: pt_parse doesn't compile when using phrase_scanner_t for rules

Hi,
I've read FAQ question number one about the free parse() function not
compiling when and I've managed to get that to work by using
rule

Steve Folly wrote:
Hi,
I've read FAQ question number one about the free parse() function not compiling when and I've managed to get that to work by using rule
as suggested. However, I need to use the pt_parse method to create a parse tree. I'm obviously missing something really obvious because now pt_parse wont compile, even though I'm using a phrase_scanner_t because of the space_p skip parser.
The easiest advice is: don't directly pass rules to any parse function. Instead, wrap them inside a grammar. BTW, please post SPirit related questions to: Spirit-general mailing list Spirit-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spirit-general HTH, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net

On 11/2/04 3:39 am, in article 4029A3FF.70503@boost-consulting.com, "Joel de
Guzman"
Steve Folly wrote:
Hi,
I've read FAQ question number one about the free parse() function not compiling when and I've managed to get that to work by using rule
as suggested. However, I need to use the pt_parse method to create a parse tree. I'm obviously missing something really obvious because now pt_parse wont compile, even though I'm using a phrase_scanner_t because of the space_p skip parser.
The easiest advice is: don't directly pass rules to any parse function. Instead, wrap them inside a grammar.
A-ha! I nearly guessed as much, but it was late at night and wanted to see what replies there were by the morning! :) In that case, may I make a suggestion about the docs - where FAQ question 1 says "In light of this issue, it is best to avoid rules as arguments to the parse functions", you might want to add something along the lines of what you just said above: "Instead, wrap them inside a grammar". It wasn't immediately obvious for a newbie, since most of the initial examples *do* pass rules to the parse functions!
BTW, please post SPirit related questions to: Spirit-general mailing list Spirit-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spirit-general
OK, I shall do that. -- Regards, Steve. PS. Congrats on an excellent piece of software - I'm beginning to wonder how I ever would have managed without it! :)
participants (2)
-
Joel de Guzman
-
Steve Folly