I am working on a legacy project which needs to be upgraded to use Java8. During the upgrade we are facing issues with ANTL3.3 as it not compatible with Java8.
Now because of certain dependencies we cannot upgrade ANTLR version and ANTLR is used to generate Java files from Grammar(.g) files.
Now, in the ANT - build.xml. I want to divide it in 2 parts.
In which ANTLR target is run wherein the Grammar files being converted to Java files using. During this part I want to use Java1.7.
ANTLR - Garmmar ===Java1.7===> output generated Java filesOnce Java files generated with 1.7 it should be compiled with existing Java files using Java8 and then final package should be prepared.
Generated Java files + existing java source code ===Java8===> Compile classes
Presumable you use the
javaAnt task to generate lexer- and parser classes from your.ggrammar file, then you could use thejvmattribute to point to your 1.7 Java binary:where
<classpath ...points to your ANTLR 3.3 JAR (and other classes you need might need in the classpath):