Antlr5: Getting past target agnostic?
The problem with ANTLR–due to a headache left over from Yacc/Bison days–is how do we specify the disambiguating semantics for parsing? In ANTLR4, disambiguating predicates are written in the target language that the parser is generated for. So, if we want a parser for a different target language, we have to rewrite the predicates.
So, last year, we started to consider how to write ANTLR grammars without duplicating all that code: What is a target-agnostic grammar? and is there a way to fix it. A PR was added for action templates functionality in Antlr4, and proposed for ANTLR5.
But, is this solution a good one??