The output of processing multiple grammars from mutliple folders ends up in one 
folder.
---------------------------------------------------------------------------------------

                 Key: MANTLRTHREE-9
                 URL: http://jira.codehaus.org/browse/MANTLRTHREE-9
             Project: Maven 2.x Antlr3 Plugin
          Issue Type: Bug
    Affects Versions: 1.0
         Environment: Maven version: 2.0.7
Java version: 1.6.0_03
OS name: "linux" version: "2.6.18-gentoo-r6" arch: "amd64"

            Reporter: Benjamin Keil
            Assignee: David Holroyd


Multiple grammars all end up in the same package (folder), even though the .g 
files are in different packages.

For instance, in my project, I have these grammars:
{quote}
src/main/antlr/lumina/lucene/penelope/Penelope.g
src/main/antlr/lumina/lucene/reconstructedfield/ReconstructedField.g
src/main/antlr/lumina/lucene/lexisnexis/LexisNexisTree.g
{quote}

My configuration is simple:
{quote}
<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>antlr3-maven-plugin</artifactId>
        <version>1.0-beta-1</version>
        <executions>
                <execution>
                        <goals>
                                <goal>antlr</goal>
                        </goals>
                </execution>
        </executions>
</plugin>
{quote}

Each starts with appropriate headers. For example Penelope.g contains these 
lines:
{quote}
@header {
        package lumina.lucene.penelope;
}

@lexer::header {
        package lumina.lucene.penelope;
}
{quote}

And ReconstructedField.g contains these lines:
{quote}
@header {
        package lumina.lucene.reconstructedfield;
        import java.util.List;
        import java.util.ArrayList;
}

@lexer::header {
        package lumina.lucene.reconstructedfield;
}
{quote}

With maven-anltr3-plugin-1.0-beta-1, I get the expected result, each parser in 
its own package:
{quote}
target/generated-sources/antlr/lumina/lucene/lexisnexis/LexisNexisTreeParser.java
target/generated-sources/antlr/lumina/lucene/lexisnexis/LexisNexisTree.tokens
target/generated-sources/antlr/lumina/lucene/lexisnexis/LexisNexisTree__.g
target/generated-sources/antlr/lumina/lucene/lexisnexis/LexisNexisTreeLexer.java
target/generated-sources/antlr/lumina/lucene/reconstructedfield/ReconstructedFieldParser.java
target/generated-sources/antlr/lumina/lucene/reconstructedfield/ReconstructedField.tokens
target/generated-sources/antlr/lumina/lucene/reconstructedfield/ReconstructedField__.g
target/generated-sources/antlr/lumina/lucene/reconstructedfield/ReconstructedFieldLexer.java
target/generated-sources/antlr/lumina/lucene/penelope/PenelopeParser.java
target/generated-sources/antlr/lumina/lucene/penelope/Penelope.tokens
target/generated-sources/antlr/lumina/lucene/penelope/Penelope__.g
target/generated-sources/antlr/lumina/lucene/penelope/PenelopeLexer.java
{quote}

With maven-antlr3-plugin-1.0, all of the parsers end up in one package.  Here 
is the output of generate-sources:

{quote}
$ mvn generate-sources
[INFO] Scanning for projects...
[INFO] snapshot com.businesssemantics.lumina:lumina-parent:5.0.0-SNAPSHOT: 
checking for updates from snapshots
WAGON_VERSION: 1.0-beta-2
[INFO] 
----------------------------------------------------------------------------
[INFO] Building Lumina Site
[INFO]    task-segment: [generate-sources]
[INFO] 
----------------------------------------------------------------------------
[INFO] artifact org.apache.maven.plugins:maven-compiler-plugin: checking for 
updates from codehaus
[INFO] artifact org.apache.maven.plugins:maven-site-plugin: checking for 
updates from codehaus
[INFO] [antlr3:antlr execution: default]
[INFO] Processing grammar 
/home/bkeil/lumina-site/src/main/antlr/lumina/lucene/reconstructedfield/ReconstructedField.g
[INFO] Processing grammar 
/home/bkeil/lumina-site/src/main/antlr/lumina/lucene/lexisnexis/LexisNexisTree.g
[INFO] Processing grammar 
/home/bkeil/lumina-site/src/main/antlr/lumina/lucene/penelope/Penelope.g
{quote}

Perhaps it's important that Penelope is the last grammar processed, because all 
of the files end up in the Penelope folder:

{quote}
target/generated-sources/antlr/lumina/lucene/penelope/ReconstructedFieldParser.java
target/generated-sources/antlr/lumina/lucene/penelope/ReconstructedField.tokens
target/generated-sources/antlr/lumina/lucene/penelope/ReconstructedField__.g
target/generated-sources/antlr/lumina/lucene/penelope/ReconstructedFieldLexer.java
target/generated-sources/antlr/lumina/lucene/penelope/LexisNexisTreeParser.java
target/generated-sources/antlr/lumina/lucene/penelope/LexisNexisTree.tokens
target/generated-sources/antlr/lumina/lucene/penelope/LexisNexisTree__.g
target/generated-sources/antlr/lumina/lucene/penelope/LexisNexisTreeLexer.java
target/generated-sources/antlr/lumina/lucene/penelope/PenelopeParser.java
target/generated-sources/antlr/lumina/lucene/penelope/Penelope.tokens
target/generated-sources/antlr/lumina/lucene/penelope/Penelope__.g
target/generated-sources/antlr/lumina/lucene/penelope/PenelopeLexer.java
{quote}

Even though the source points to the correct package:

{quote}
package lumina.lucene.lexisnexis;

import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

import org.antlr.runtime.tree.*;

public class LexisNexisTreeParser extends Parser
{quote}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to