Boost logo

Boost Users :

From: Joel de Guzman (djowel_at_[hidden])
Date: 2003-08-19 02:59:15


I wouldn't know unless I see the whole picture. Which parse function did you call?
Have you tried using the Spirit debugger?

BTW, please post Spirit related questions to Spirit's mailing list:
Spirit-general_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/spirit-general

Thanks!

Cheers,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net
jwwillcox2003 <jwwillcox2003_at_[hidden]> wrote:
> struct usmtf : public grammar<usmtf>
> {
>     template <typename ScannerT>
> 
>     struct definition
>     {
>         definition(usmtf const& self)
>         {
>             message = mainText;
> 
>             exerciseSet = !eol_p >> str_p("EXER")[do_print("EXER")]
>>> ch_p('/') >> *(field >> ch_p('/')) >> ch_p('/');
>             messageIdentifierSet = str_p("MSGID")[do_print("MSGID")]
>>> ch_p('/') >> *(field >> ch_p('/')) >> ch_p('/');
> 
>             field =
>                 lexeme_d
>                 [
>                     +(upper_p - ch_p('/') - eol_p)
>                 ];
> 
>             mainText = exerciseSet >> eol_p >> messageIdentifierSet
>>> end_p;
>         };
> 
>         rule<ScannerT> message, mainText,
>              exerciseSet, messageIdentifierSet, field;
> 
>         rule<ScannerT> const& start() const { return message; }
>     };
> };
> 
> Using this grammar above, it will parse
> EXER/EE/FF//MSGID//
> using
>    mainText = exerciseSet >> messageIdentifierSet >> end_p;
> 
> 
> However, I want it to parse
> EXER/EE/FF//
> MSGID//
> 
> and
>     mainText = exerciseSet >> eol_p >> messageIdentifierSet >> end_p;
> does not work.   Why?  How do I parse what I want?

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net