Define Arlington's predicates using ANTLR? #63
petervwyatt
started this conversation in
Polls
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What do users think about defining Arlington's internal predicate grammar using ANTLR?
This would then mean there is a single "truth" for the syntax of every predicate, while also being able to code-gen parsers in Python, Java, C, C#, etc. This would also replace the manually maintained documentation, which would be integrated into the ANTLR grammar as comments, etc. The current PoCs might also then be migrated to use the code-gen'd parsers (esp. the Python and Java PoCs which are not actively maintained).
Why ANTLR? Because it is environment agnostic, supports code-gen across many programming languages, and has a CLI so introducing new predicates doesn't require a full development cycle. And iText pdfcop for PDF content streams also uses ANTLR.
The main downside is users have to learn how to use and integrate an ANTLR-generated parser, vs rolling your own from the doco.
Other options I think are either more work, less popular and/or less flexible include: yacc/bison, XText, custom DSL.
0 votes ·
Beta Was this translation helpful? Give feedback.
All reactions