CQL::Parser is a Perl module for parsing Common Query Language statements.
CQL is a formal language for representing queries to information retrieval systems such as web indexes, bibliographic catalogs and museum collection information. The design objective is that queries be human readable and writable, and that the language be intuitive while maintaining the expressiveness of more complex languages.
CQL::Parser will allow you validate statements, and parse them into a parse tree which you can then programatically walk and use. For your convenince there are methods for converting the CQL parse tree into Swish and Lucene queries as well as XCQL (an XML representation of CQL).use CQL::Parser;
my $parser = CQL::Parser->new();
my $root = $parser->parse('dc.creator="clinton"');
my $swish = $root->toSwish();
my $lucene = $root->toLucene();
my $xcql = $root->toXCQL();