Skip to content

Commit

Permalink
Fixed operator precedence (#2308)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12578 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Dec 22, 2009
1 parent 5f4256a commit 9fc31d4
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/core/qgssearchstringparser.yy
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,21 @@ void addToTmpNodes(QgsSearchTreeNode* node);
//%error-verbose

// operator precedence
// all operators have left associativity
// (right associtativity is used for assignment)
%left '^'
%left '*' '/'
%left '+' '-'
%left UMINUS // fictious symbol (for unary minus)
%left COMPARISON
// all operators have left associativity, i.e. 1+2+3 traslates to (1+2)+3
// the order of operators here determines their precendence

%left AND
%left OR
%left AND
%left NOT

%left COMPARISON

%left '+' '-'
%left '*' '/'
%left '^'
%left UMINUS // fictious symbol (for unary minus)


%%

root: search_cond { /*gParserRootNode = $1;*/ }
Expand Down

0 comments on commit 9fc31d4

Please sign in to comment.