[antlr-interest] Compiling Java source files when using the antlr3-maven-plugin

Jim Idle jimi at temporal-wave.com
Wed Nov 11 11:54:50 PST 2009

Did you add the package statement to the @arser and @lexer header sections? The output files will generated I the correct place, but you need to add the package yourself, just like in Java.


Your best bet is to start here:




and modify the sample project that is produced.





From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Cameron Ross
Sent: Wednesday, November 11, 2009 11:43 AM
To: antlr-interest at antlr.org
Subject: [antlr-interest] Compiling Java source files when using the antlr3-maven-plugin




I have a simple maven project with source files configured as follows:



    - pom.xml

    - src

        - main

            - antlr3

                - my_package

                    - MyGrammar.g

            - java

                - my_package

                    - MyClass.java



When I execute mvn compile my parser and lexer sources are generated properly and reside under target/generated-sources as expected.  However, MyClass.java is not compiled and the process gives me the following error:



target/generated-sources/antlr3/my_package/MyParser.java:[105,13] cannot find symbol

symbol  : constructor MyClass()



Any help would be greatly appreciated.





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20091111/386ecaa1/attachment.html 

More information about the antlr-interest mailing list