« Return to Thread: [proto] grammar compile error

[proto] grammar compile error

by Felipe Magno de Almeida :: Rate this Message:

Reply to Author | View in Thread

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
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

 « Return to Thread: [proto] grammar compile error