QueryUtils.parseAndVisit() currently cannot handle rule conditions that combine AND and OR operators with parentheses to define precedence. When both are present, the generated QueryVisitor includes simple, AND, and OR queries at the same level, causing the evaluation logic to always prioritize simple queries.
Example of a problematic condition:
java.annotation is 'org.springframework.boot.autoconfigure.SpringBootApplication' AND
(java.annotation is 'org.springframework.web.bind.annotation.RestController' OR
java.annotation is 'org.springframework.stereotype.Service')
Expected
- Parentheses and operator precedence should be properly parsed.
- The resulting structure should represent the logical tree of the condition (nested AND/OR).
- The evaluation logic in
scan() should correctly combine results according to that tree.
Tasks
- Extend the grammar (
Query.g4) to support nested logical expressions.
- Update
QueryUtils.parseAndVisit() to build a hierarchical query tree.
- Adjust
QueryVisitor and related evaluation logic to process nested AND/OR combinations.
QueryUtils.parseAndVisit()currently cannot handle rule conditions that combineANDandORoperators with parentheses to define precedence. When both are present, the generatedQueryVisitorincludes simple, AND, and OR queries at the same level, causing the evaluation logic to always prioritize simple queries.Example of a problematic condition:
Expected
scan()should correctly combine results according to that tree.Tasks
Query.g4) to support nested logical expressions.QueryUtils.parseAndVisit()to build a hierarchical query tree.QueryVisitorand related evaluation logic to process nested AND/OR combinations.