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:

 

http://www.antlr.org/wiki/display/ANTLR3/Building+ANTLR+Projects+with+Maven

 

and modify the sample project that is produced.

 

Jim

 

 

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

 

Hello, 

 

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

 

my_project/

    - 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.

 

Cameron.

 

        




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to