I’ve been trying to find some material to read on how compilers/parsers are able to detect different versions of a language they’re designed to compile/parse, and how they handle conflicts between the different versions.
So far my search has not turned up anything aside from Semantic Predicates from ANTLR.
However, I intend to write my own parser and I would like to know if there are any general strategies that are applied when parsers aim to support multiple language versions.
In particular I’d like to know:
- How parsers can determine a language version.
- How to handle conflicts between language versions.
If at all possible please provide some examples of open source parsers/compilers that have these capabilities.