Yaroslav Taben
13563202f0
Add not operator into ParserDefinition
...
This allows our parser to properly recognize not
operator in queries with correct precedence.
2015-06-06 10:27:36 -07:00
Yaroslav Taben
2e60177f12
Add NotPredicate for EntityFilters
...
This predicate simply negates its operand.
2015-06-06 10:20:28 -07:00
Yaroslav Taben
548e65f620
Swap operand order for instance_of operator
...
The previous order made sense when the operand was
called is_instance. With this name, using
"entity.type instance_of types.thing" makes much more
sense than the other way around.
2015-06-05 20:38:06 -07:00
Erik Ogenvik
0953bdc133
Provide more info in error message.
2015-05-24 11:25:08 +02:00
Erik Ogenvik
76a47338fb
Fixed incorrect cast.
2015-05-24 10:54:11 +02:00
Erik Ogenvik
1f91ff5709
Changed the "is_instance" op to "instance_of".
...
It just feels more natural.
2015-05-02 22:18:48 +02:00
Erik Ogenvik
9af513658a
Added include needed by earlier gcc versions.
2015-05-02 15:15:42 +02:00
Erik Ogenvik
344724e9b2
Added include for invalid_argument.
...
Seems to be needed on older gcc versions.
2015-05-02 13:34:47 +02:00
Erik Ogenvik
bd4f70705d
Initialize in correct order.
2015-04-18 22:31:07 +02:00
Yaroslav Taben
0d1a3428b3
Fixed potential segfault by preventing creation of bad predicates.
...
Check for null Consumer is now performed regardless of operator.
Mainly because types can also be checked using equality sign.
2014-09-27 18:50:54 -04:00
Yaroslav Taben
c6d9bbf950
Added support for self.* types of query
2014-09-20 15:52:59 -04:00
Yaroslav Taben
c72a704d93
Added contains_recursive definition in the parser definition.
2014-09-08 16:35:26 -04:00
Yaroslav Taben
66b41e3a86
Added ContainsRecursiveFunctionProvider class.
...
This class will be used to handle queries that use
contains_recursive method which takes 2 arguments
1. A consumer that returnes container (i.e. entity.contains)
2. Any predicate (i.e. entity.type=types.barrel)
The method returns true iff there exists an entity
within the container that matches the condition
2014-09-08 16:13:18 -04:00
Yaroslav Taben
268e74c51a
Added Contains provider and corresponding tests
2014-09-07 16:21:08 -04:00
Yaroslav Taben
ad0aa918d7
Moved filter's Predicate classes into separate files
2014-09-05 19:43:32 -04:00
Yaroslav Taben
fa665ed57b
Added support for numeric entity ID matching.
2014-08-25 14:26:30 -04:00
Yaroslav Taben
c5001cf3fa
Changed parser to use an instance of a provider factory for segments
...
Modified the client code to comply to this change
2014-08-15 13:53:17 -04:00
Yaroslav Taben
85533d3771
Created a MindProviderFactory to handle mind-related queries
2014-08-15 13:22:05 -04:00
Yaroslav Taben
8502943d6c
Added support for memory.* query in ProvidersFactory
2014-08-13 13:07:46 -04:00
Yaroslav Taben
87921e399b
Changed MemoryProvider to use QueryContext
2014-08-13 12:33:53 -04:00
Yaroslav Taben
f80fb518b1
Added MemoryProvider and MindQueryContext struct
...
This is intended to handle memory related queries from mind code
2014-08-11 23:29:51 -04:00
Yaroslav Taben
136d94e9ae
Removed unused components
2014-08-11 18:11:10 -04:00
Yaroslav Taben
bed9a7cdc0
Added use of symbol table for comparison operators in the parser
2014-08-11 17:40:00 -04:00
Yaroslav Taben
5180f938a3
Added support for boolean values in parser definition
2014-08-11 16:46:54 -04:00
Yaroslav Taben
5fff6d659a
Added ability to specify multiple types for is_instance operator
...
Syntax example: entity.type is_instance types.boulder|types.barrel
Changed existing test cases to comply with new syntax rules
2014-08-05 13:55:57 -04:00
Yaroslav Taben
c088f11b50
Added support for "[]" list notation for int/float/str in parser
2014-08-04 17:37:55 -04:00
Yaroslav Taben
28248f15e4
Added support for "in" operator in the parser definition
2014-08-04 14:48:39 -04:00
Yaroslav Taben
6ee6907d23
Added support for In operator in ComparerPredicate.
...
Minor fixups in implementation of other operators
2014-08-04 14:40:18 -04:00
Yaroslav Taben
fbd349e069
Fixed search for nonexisting type using "is_instance" operator.
...
Currently, the query is considered to be invalid in such case.
2014-08-01 16:15:15 -04:00
Yaroslav Taben
8f02efb26e
Added support for contains operator in ParserDefinition.
2014-08-01 15:49:58 -04:00
Yaroslav Taben
066ef0fcd1
Added implementation for CONTAINS operator in ComparerPredicate.
2014-08-01 15:43:41 -04:00
Yaroslav Taben
f8100fb210
Added support for "and" "or" operators in parser definition.
...
These operators require at lest one space before and after.
2014-08-01 15:17:30 -04:00
Yaroslav Taben
9ece166659
Changed current Filter class to use the new filter structure
...
Updated the test cases to match the new syntax.
2014-07-30 16:42:51 -04:00
Yaroslav Taben
9fcd4474da
Added new parser definition.
2014-07-30 16:33:04 -04:00
Yaroslav Taben
1e2a3496cf
Added implementation for additional comparison operators
...
operators ">, >=, <, <=" only support numeric comparison.
2014-07-30 13:28:17 -04:00
Erik Ogenvik
b112448e07
WIP filter example.
2014-07-27 22:10:02 +02:00
Yaroslav Taben
eef7afc6b2
Allowed for function-type expression in the filter query
...
Currently, only distance is allowed. The functionality is yet to be
implemented.
2014-07-24 11:58:03 -04:00
Yaroslav Taben
fced3581cb
Fixed comparison operators in BBox Case.
...
Bitwise or was used by accident.
2014-07-23 12:57:49 -04:00
ytaben
940c8e8187
Fixed compilation errors
2014-07-23 11:18:59 -04:00
Yaroslav Taben
c5bb9613b3
Improved implementation of OutfitCase
...
Outfit case now actually serves as a "bridge" case
where we simply use an entity from outfit to
match consecutive cases.
2014-07-22 18:36:44 -04:00
Yaroslav Taben
907c49ccef
Changed parsing process to parse directly into ParsedCondition
...
Intermediate condition struct is not unused
2014-07-14 12:28:29 -04:00
Yaroslav Taben
7868c7a9c8
Implemented functionality of "in" and "all" search in lists
...
Added corresponding test cases
2014-07-14 11:57:00 -04:00
Yaroslav Taben
c046272a09
Added support for nested outfit and other cases within outfit
...
Added test cases for the new features.
2014-07-10 14:30:21 -04:00
Yaroslav Taben
d9cb837f6d
Changed the expression structure to Boost::Variant based AST
...
Added new docs, various code optimization and improved redability.
2014-07-07 20:27:15 -04:00
Yaroslav Taben
734b4ec3b9
Added BBox case and test cases for it.
...
Updated and added new docs
Made other fixups
2014-06-27 15:27:01 -04:00
Yaroslav Taben
d8b3df6699
Added implementation of OutfitCase and test cases for it
...
Added accessor for entity in OutfitCase
2014-06-25 14:16:16 -04:00
Yaroslav Taben
5ef4544db5
Implemented precedence rules ("&" operators evaluated first)
...
Search function now accepts LocatedEntity* vector.
This is likely a temporary solution, as it doesn't support
parenthesis and can be written in a neater way.
2014-06-17 17:44:13 -04:00
Yaroslav Taben
9f17d4d0df
Made various fixes and improved implementation of multiple methods.
...
Added proper destructor methods.
Fixed various bugs within cases and comparers.
Added support for soft/hard type comparison.
Fixed/moved case grammar definitions.
Added a general framework for memory cases.
2014-06-13 13:17:38 -04:00