Boost logo

Boost :

Subject: [boost] [proto] grammar compile error
From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2009-07-04 11:50:29


Hello,

When I have a grammar like this:

struct create_table_grammar
  : boost::proto::shift_left
    <
      boost::proto::shift_left
      <
        boost::proto::terminal<tags::create>
        , boost::proto::terminal<tags::table>
>
   , boost::proto::terminal<const char*>
>
{};

And this expression:

create << table << "lala";
Where create and table are terminals with the respective tags.

I have this compile error:
examples/test1.cpp: In function ‘int main()’:
examples/test1.cpp:12: error: no match for ‘operator<<’ in
‘sql::keywords::create << sql::keywords::table’

If I don't inner expressions, then (create << table) works. But I
can't define a more restricted grammar this way.
I want create << table to work only when preceded with another
specific expression.
I wanted create << table to be enabled, but to disable everything else
except (create << table) << "";

Is this possible?

Thanks,

-- 
Felipe Magno de Almeida

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk