I'm having difficulty with Lemon's operator precedence.

Given SQLite's operator precedence table where it's presumably
interpreted with lowest precedence tokens at the top to the
highest precedence tokens at the bottom:

  %left OR.
  %left AND.
  %right NOT.
  %left IS MATCH LIKE_KW BETWEEN IN ISNULL NOTNULL NE EQ.
  %left GT LE LT GE.
  %right ESCAPE.
  %left BITAND BITOR LSHIFT RSHIFT.
  %left PLUS MINUS.
  %left STAR SLASH REM.
  %left CONCAT.
  %left COLLATE.
  %right UMINUS UPLUS BITNOT.

Why doesn't the BITNOT operator '~' have the highest precedence?

  SQLite version 3.5.2
  Enter ".help" for instructions
  sqlite> select ~1 - ~5;
  -8
  sqlite> select (~1) - (~5);
  4

Is precedence not determined by the order of the %left/%right 
lines in parse.y?  If not, how might one assign BITNOT the highest 
precedence?

MySQL, by comparison:

  mysql> select ~1 - ~5;
  +---------+
  | ~1 - ~5 |
  +---------+
  |       4 |
  +---------+

  mysql> select (~1) - (~5);
  +-------------+
  | (~1) - (~5) |
  +-------------+
  |           4 |
  +-------------+

MySQL operator precedence:
http://dev.mysql.com/doc/refman/5.0/en/operator-precedence.html

MS SQL Server precedence:
http://msdn2.microsoft.com/en-us/library/ms190276.aspx



      
____________________________________________________________________________________
Be a better sports nut!  Let your teams follow you 
with Yahoo Mobile. Try it now.  
http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to