On Wed, 2008-12-03 at 20:26 -0600, Ashok Varikuti wrote:

> Hi List,
> 
> I encapsulated antlr grammar files in a eclipse maven project. The 
> compilation task of grammar files is done at maven compile time. I 
> specified the output directory to be the following :-


Here is a sample configuration for antlr3-maven-plugin version 3.1.1.1,
which is now synced with Maven central (because I just used it ;-).



            <plugin>
                <groupId>org.antlr</groupId>
                <artifactId>antlr3-maven-plugin</artifactId>
                <version>3.1.1.1</version>
                <configuration>
                    
<sourceDirectory>src/main/java/com/temporalwave/parsers/aspdotnet</sourceDirectory>
                    
<outputDirectory>target/generated-sources/aspdotnetjava/com/temporalwave/parsers/aspdotnet</outputDirectory>
                    
<libDirectory>src/main/java/com/temporalwave/parsers/aspdotnet</libDirectory>
                    <excludes>
                        <exclude>commonwalker.g</exclude>
                    </excludes>
                </configuration>
                
                <executions>

                    <execution>
                        <goals>
                            <goal>antlr</goal>
                        </goals>
                    </execution>
                </executions>

            </plugin>


If you do not specify a source and output directory then it looks for
grammar in the ./antlr directory and the output files should be in:

target/generated-sources/nameofyourartifact/antlr

But your package is:


    @header {
    package prefuse.parser.dotparser;
    }
    @lexer::header {
      package prefuse.parser.dotparser;
    }


So you want your grammar files to be in the directory:


   <sourceDirectory>src/main/java/prefuse/parser/dotparser</sourceDirectory>


and your output files should be:


   
<outputDirectory>target/generated-sources/yourartifactname/prefuse/parser/dotparser</outputDirectory>


Then it will all work. Be sure to use version 3.1.1.1 of the plugin if
you have dependent grammars (tokenVocab option) as the 3.1.1 version and
below do not calculate dependencies correctly.

Jim

--~--~---------~--~----~------------~-------~--~----~
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:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address

Reply via email to