This is the full source code for a blog post on parboiled2.
It contains parboiled2 parsers for a simplified version of Slack Assisted Search. The BNF for our simplified version is:
Input = Term, [ Filter ];
Filter = SearchInChannel | SearchMessagesFrom | SearchOnDate
SearchInChannel = "in:", Term
SearchMessagesFrom = "from:", Term;
SearchOnDate = "on:", Term;
Term = { AlphaNumeric-Character };
If you have a JVM/JDK installed you can run the tests:
./sbt test
Or you can open a REPL and play with the examples:
./sbt console