Boost logo

Boost Users :

Subject: [Boost-users] [Spirit] still stuck on expectation points
From: philip tucker (phhht_at_[hidden])
Date: 2010-04-16 20:24:16


Hello,

Here's a summary of my problem:

      My original fully functioning grammar was this:

      start %= (constitkind >> id >> ':' >> id >> probs) % ","; // WORKS

      where
        - constitkind exposes unsigned,
        - id exposes string,
        - probs exposes a list of doubles,
        - start exposes a list of constituent structures
        (Is that jargon acceptable?)

      It recognizes strings such as

            a:b,
            foo:bar [ 0.00 ],
            extraposed x:y [ 0.00, 0.50, 0.99, 1.0 ],
            optional z:a [ 0.00, 0.50, 0.99, 1.0 ]

      I wanted to replace the grammar with this (note the expectation
      points which replace sequence operators):

          start %= (constitkind > id > ':' > id >> probs) % ","; //
FAILS

      That won't compile. All I can glean from the error report is
that I've
      induced a type mismatch. What's wrong?

      I got as far as this by thrashing:

          start %= (constitkind >> (id > ':') >> id >> probs) %
","; // WORKS

      Why do the parentheses in (id > ':') permit compilation?

Thanks very much for any help you can give me.




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