title: Can ANTLR4 generate shared code when using an imported grammar?
body: <p>I have two languages, call them A and B (with AGrammar.g4, BGrammar.g4, ALexer.g4, and BLexer.g4). B is a superset of A and thus I have B importing A.</p>
  
  <p>I have visitor code that compiles A to language X.</p>
  
  <p>I am writing visitor code to compile B to language X, and want to re-use the A2X code.  However, the generated B.java code re-defines all the nested rule classes that are already in A.java</p>
  
  <p>Is there any way to get B.java to re-use the generated code in A.java so I don't have to duplicate all the A visitor code?</p>