The Tuleap team built a custom query language parser in PHP using PEG.js to enable complex tracker queries with OR operators and time windows. They chose PEG.js as their parser generator after evaluating several PHP parsing tools, defined a grammar using parsing expression grammar (PEG) format, and integrated CodeMirror for syntax highlighting and autocomplete. The solution converts user queries into SQL statements through a syntax tree that's validated and visited, while the editor provides field suggestions and error detection to improve the user experience.

Sort: