Implement Query parser.