title: Antlr4 Project Directory Structure Issue
body: <p>I'm trying to set up an Antlr4 project using Java's package directory structure.</p>
  <p>The top level directory contains <code>PondParser.g4</code>, <code>PondLexer.g4</code>, and <code>build_script</code>.</p>
  <p><code>build_script</code> is expected to build and run the antlr4 test rig</p>
  <pre><code>{ 
      echo 'clean project' 
      find ./com/sevan/pond/ -type f -delete
  } &amp;&amp; { 
      echo 'launch ANTLR parser generator' 
      java -jar /usr/local/lib/antlr-4.8-complete.jar -package com.sevan.pond  ./PondLexer.g4 -o com/sevan/pond
      java -jar /usr/local/lib/antlr-4.8-complete.jar -package com.sevan.pond  ./PondParser.g4 -o com/sevan/pond
  } &amp;&amp; { 
      echo 'compile .java files'
      javac ./com/sevan/pond/*.java 
  } &amp;&amp; {
      echo 'run test rig with gui'
      java org.antlr.v4.gui.TestRig  ./com/sevan/pond/PondParser prog -gui 
  }
  </code></pre>
  <p>Relevant <code>PondParser.g4</code> header and options:</p>
  <pre><code>parser grammar PondParser;
  
  @header {   
      package com.sevan.pond;
  }
  
  options {
      tokenVocab = PondLexer;
  }
  </code></pre>
  <p>Relevant <code>PondLexer.g4</code> header and options:</p>
  <pre><code>lexer grammar PondLexer ;
  
  @header {   
      package com.sevan.pond;
  }
  </code></pre>
  <p>The build script fails while compiling (<code>javac ./com/sevan/pond/*.java </code>).</p>
  <p>The specific errors are as follows:</p>
  <pre><code>./com/sevan/pond/LexerRules.java:4: error: class, interface, or enum expected
      package com.sevan.pond;
      ^
  ./com/sevan/pond/Pond.java:4: error: class, interface, or enum expected
      package com.sevan.pond;
      ^
  ./com/sevan/pond/PondBaseListener.java:4: error: class, interface, or enum expected
      package com.sevan.pond;
      ^
  ./com/sevan/pond/PondListener.java:4: error: class, interface, or enum expected
      package com.sevan.pond;
      ^
  4 errors
  </code></pre>
  <p>What's missing/wrong here? Any suggestions, links, and answers would be greatly appreciated.</p>
  <hr />
  <h2>Update</h2>
  <p>The four errors above were due to a double package declaration in the generated java files.  This was caused by specifying the package using <code>-package</code> and <code>@header</code>.  After fixing this, however, the test rig still fails with <code>Can't load PondParser as lexer or parser</code>.</p>