Boost logo

Boost Users :

From: sps22 (sps22_at_[hidden])
Date: 2003-08-01 12:03:42


Joel:

On your suggestion, I used the debugging and found that if I replace

FILE >> LEFT_BRACE >> *(anychar_p) >> RIGHT_BRACE

by a real rule like

FILE >> LEFT_BRACE >> A_REAL_RULE >> RIGHT_BRACE

then it works OK. What was strange was that the debugger indicated
that the entire input file was consumed by the first original code
and all that was left was "" and it still said parser failed. Any
insight into it?

Thanks.
-Surinder
PS: Could not post the response to the Spirit mailing list.

--- In Boost-Users_at_[hidden], "Joel de Guzman" <djowel_at_g...>
wrote:
> Hi,
>
> Have you tried using the Spirit debugger?
>
> Cheers,
> --
> Joel de Guzman
> joel at boost-consulting.com
> http://www.boost-consulting.com
> http://spirit.sf.net
>
> Surinder Pal Singh <sps22_at_y...> wrote:
> > Hi,
> > I am trying to use Spirit (in the latest Boost 1_30_0)
> > for a project. I want to parse a file whose structure
> > is the following:
> >
> > section1 {
> > something;
> > }
> >
> > I am using the file_iterator to iterate on the input
> > file and then define comment as well as the grammar. I
> > am at my wits end why my parser keeps failing. (When
> > this simple grammar works, I want to make the parser
> > more complex.) My code is attached below. (Note: I
> > used the example in the distribution c_grammar.cpp as
> > the starting point for it.)
> >
> > Thanks.
> >
> > -surinder
> > I have attempted to join the spirit mail list, but
> > have not received the confirmation so far, but please
> > feel free to respond to me at: sps22_at_yahoo_dot_com
> >
> >
> > PS: This input file structure is going to be, of
> > course, more complicated than the example shown above.
> > Inside the setions, I would like to pass on flags and
> > statements to the code. If it is better for me to use
> > another approach to parse this file structure, please
> > suggest me.
> >
> [snip]


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