I have a application that allows the user to enter a series of nested filtering commands.
E.g "Name starts with x or ((Description contains y or Property1 is On) and Property2 > 100)"
I can preprocess this and distill it down to a string in the form of an expression of True and False's
ie, To "True or ((False or True) and False)"
Is there a simple way to have this final expression evaluated without having to write a complex evaluator myself?
Or does anyone know of some example code that will do this?
I have seen a method of evaluating this by compiling a dummy function at runtime but as I need to process this against possibly thousands of records that solution is too slow.
BTW These are not all fields in a database so I cannot use Queries or SQL etc.
Thanks in advance
Trev
E.g "Name starts with x or ((Description contains y or Property1 is On) and Property2 > 100)"
I can preprocess this and distill it down to a string in the form of an expression of True and False's
ie, To "True or ((False or True) and False)"
Is there a simple way to have this final expression evaluated without having to write a complex evaluator myself?
Or does anyone know of some example code that will do this?
I have seen a method of evaluating this by compiling a dummy function at runtime but as I need to process this against possibly thousands of records that solution is too slow.
BTW These are not all fields in a database so I cannot use Queries or SQL etc.
Thanks in advance
Trev