In my app, I get passed in user-generated SOQL query strings and need to validate and modify them. For that, I would need a parser that can extract me chunks They contain many SOQL features like:
- Query Parent Object fields
- Query Child records
- Conditions in own and child relationships
- Aggregate functions
I tried to:
- "hack my own parser" and FAILED
- tried to port an open-source parser from Java to Apex and FAILED
Now I need your help to eighter point me to an existing solution that I didn't find yet or help me understand how to make 1) or 2) work.
Please also don't close-vote this question as too broad. Nobody is harmed when we leave it to hang around. Eventually, someone will be motivated by it to write such a parser.