Skip to content
Permalink
Browse files
[FEATURE] new QgsExpression class that replaces QgsSearchString
The new class fixes various flaws in search strings:
- fixed and simplified grammar in parser
- simplified lexer
- only one evaluation routine (instead of separate getValue/checkAgainst)
- SQL compliant three-value logic (true, false, unknown)
- correct error handling
- easily extensible list of functions, saner evaluation of expressions
- tests included
  • Loading branch information
wonder-sk committed Aug 7, 2011
1 parent 0053426 commit 4d0e59c183e60bd8e58bec849e632e93983c67b8
Showing with 2,025 additions and 2 deletions.
  1. +4 −2 src/core/CMakeLists.txt
  2. +904 −0 src/core/qgsexpression.cpp
  3. +318 −0 src/core/qgsexpression.h
  4. +171 −0 src/core/qgsexpressionlexer.ll
  5. +232 −0 src/core/qgsexpressionparser.yy
  6. +1 −0 tests/src/core/CMakeLists.txt
  7. +395 −0 tests/src/core/testqgsexpression.cpp
@@ -53,6 +53,7 @@ SET(QGIS_CORE_SRCS
qgsdiagram.cpp
qgsdiagramrendererv2.cpp
qgsdistancearea.cpp
qgsexpression.cpp
qgsfeature.cpp
qgsfield.cpp
qgsgeometry.cpp
@@ -216,9 +217,9 @@ IF (WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(BEFORE spatialite/headers/spatialite)
ENDIF (WITH_INTERNAL_SPATIALITE)

ADD_FLEX_FILES(QGIS_CORE_SRCS qgssearchstringlexer.ll)
ADD_FLEX_FILES(QGIS_CORE_SRCS qgssearchstringlexer.ll qgsexpressionlexer.ll)

ADD_BISON_FILES(QGIS_CORE_SRCS qgssearchstringparser.yy)
ADD_BISON_FILES(QGIS_CORE_SRCS qgssearchstringparser.yy qgsexpressionparser.yy)

SET(QGIS_CORE_MOC_HDRS
qgsapplication.h
@@ -286,6 +287,7 @@ SET(QGIS_CORE_HDRS
qgsdistancearea.h
qgscsexception.h
qgsexception.h
qgsexpression.h
qgsfeature.h
qgsfield.h
qgsgeometry.h

0 comments on commit 4d0e59c

Please sign in to comment.