ANTLR error 134
<p>I'm trying to build Abstract Syntax Tree for Java in Python with antlr4 package.
I've downloaded Java grammar from
<a href="https://github.com/antlr/grammars-v4/blob/master/java8/Java8.g4" rel="nofollow">https://github.com/antlr/grammars-v4/blob/master/java8/Java8.g4</a></p>

<p>I want to use that grammar file to produce JavaLexer and JavaParser for Python2.</p>

<p>When I say </p>

<pre><code>"$ antlr4 -Dlanguage=Python2 Java8.g4"
</code></pre>

<p>an error occured.That error is</p>

<blockquote>
  <p>error(134): Java8.g4:73:0: symbol type conflicts with generated code in target language or runtime</p>
</blockquote>

<p>NOTE: I've deleted parts with <code>Character.isJavaIdentifierPart()</code>. Because these lines is not proper for python and i will use just ASCII.</p>

<p>Python has built-in function called <code>type</code>. Antlr4 prints an error for line 73 of the grammar:</p>

<pre><code>type
    :   primitiveType
    |   referenceType
    ;
</code></pre>

<p>Looks like there is a name conflict and you have to rename <code>type</code> to something else in your grammar.</p>

java python antlr4