in reply to Advanced Search form database queries

The question "is this the best approach" is hard to answer as you don't give any indication what you consider the best. Best as in "userfriendly", "fast", "most flexible", "easy on the database server", "maintable"?

As for parsing, one could use Parse::RecDescent. That's very easy to write a grammar for, but it's not going to be fast. For a simple AND/OR/NOT language, it's easy to write an LR(1) or LL(1) grammar, and those can be parsed much faster. You could use Parse::YAPP, or write a custom parser. You might even want to do it in C. It depends on what kind of trade-offs you are going to make between running time and programming time.

Abigail

  • Comment on Re: Advanced Search form database queries