[antlr-interest] Generated code dismatch

Johannes Luber jaluber at gmx.de
Mon Nov 10 04:33:09 PST 2008


Jared Bunting schrieb:
> I can confirm that antlr3-maven-plugin from codehaus uses antlr 3.0 to
> generate the code.  Unfortunately, code changes are required to get it
> to work properly with 3.1.1.  Fortunately, Jim Idle has moved the plugin
> to antlr and made those necessary changes.  If you change your plugin's
> groupId to org.antlr and it's version to 3.1.1, your problem should be
> resolved.
> 
> -Jared

That supposes that neither a bug nor newly introduced features prevent
the backporting. In the worst case the OP needs to create a task which
calls the command line version of ANTLR directly.

Johannes
> 
> Johannes Luber wrote:
>> Sergiy Karpenko schrieb:
>>  
>>> Hi all
>>>
>>> There is a problem, I use antlrworks-1.2.1 which use antlr-3.1.1 and it
>>> genrate code well.
>>>
>>> But when I use antlr3-maven-plugin with same antlr-3.1.1 it generates
>>> wrong code
>>>
>>> <dependency>
>>>  <groupId>org.antlr</groupId>
>>>  <artifactId>antlr-runtime</artifactId>
>>>   <version>3.1.1</version>
>>>   <scope>compile</scope>
>>> </dependency>
>>>
>>> <plugin>
>>> <groupId>org.codehaus.mojo</groupId>
>>> <artifactId>antlr3-maven-plugin</artifactId>
>>> <version>1.0</version>
>>> <configuration>
>>> <!--libDirectory>target/generated-sources/antlr/org/exoplatform/services/jcr/impl/core/query/antlr</libDirectory-->
>>>
>>>
>>> <includes>
>>> <include>**/FullText.g</include>
>>> <include>**/SQL2.g</include>
>>> </includes>
>>> </configuration>
>>> <executions>
>>> <execution>
>>> <goals>
>>> <goal>antlr</goal>
>>> </goals>
>>> </execution>
>>> </executions>
>>> </plugin>
>>>
>>> There is
>>> "cannot find symbol : variable _fsp"
>>>
>>> differense between two ganerated code is:
>>>   state._fsp--; in first case
>>> and
>>>   _fsp--;  in second case
>>>
>>> Thanks
>>>     
>>
>> The cause lies in a wrong ANLTR version. Somehow your maven plugin still
>> uses ANTLR 3.0.x. Either the maven plugin is outdated or your classpath
>> for maven is wrong.
>>
>> Johannes
>>  
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>>> Unsubscribe:
>>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>>>
>>>
>>>     
>>
>>
>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> Unsubscribe:
>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>>
>>
>>   
> 



More information about the antlr-interest mailing list