Lexer, recursive-descent parser (AND/OR/NOT, parentheses, implicit AND, IN lists, size/age/date units) and an evaluator that computes filtered subtree sizes in two linear passes without double counting.