Hi all,

(I couldn't find an issue tracker so I'm just sending this problem to
the mailing list. I'm not sure whether it is an ANTLR issue or an
antlr3-maven-plugin issue.)

I have the setup below. If I run it I get the following result:

hi...@centaur ~/workspaces/default/JavaParser $ mvn clean compile ; tree
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - org.example:x:jar:0.0.1-SNAPSHOT
[INFO]    task-segment: [clean, compile]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /home/hilco/workspaces/default/JavaParser/target
[INFO] [antlr3:antlr {execution: default}]
[INFO] ANTLR: Processing source directory
/home/hilco/workspaces/default/JavaParser/src/main/antlr3
ANTLR Parser Generator  Version 3.1.3 Mar 17, 2009 19:23:44
x/X.g
[INFO] [resources:resources]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory
/home/hilco/workspaces/default/JavaParser/src/main/resources
[INFO] [compiler:compile]
[INFO] Compiling 3 source files to
/home/hilco/workspaces/default/JavaParser/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Sat Sep 12 23:30:56 PDT 2009
[INFO] Final Memory: 13M/126M
[INFO] ------------------------------------------------------------------------
.
|-- pom.xml
|-- src
|   `-- main
|       `-- antlr3
|           |-- imports
|           |   `-- L.g
|           `-- x
|               `-- X.g
`-- target
    |-- classes
    |   |-- XLexer.class
    |   |-- X_L.class
    |   `-- x
    |       `-- XParser.class
    `-- generated-sources
        `-- antlr3
            |-- L.tokens
            |-- X.tokens
            |-- home
            |   `-- hilco
            |       `-- workspaces
            |           `-- default
            |               `-- JavaParser
            |                   `-- src
            |                       `-- main
            |                           `-- antlr3
            |                               `-- XLexer.java
            `-- x
                |-- XParser.java
                `-- X_L.java

Note the strange location of XLexer.java. If I comment out "import L;"
and uncomment "LETTER : 'X' ;" everything works as expected and
XLexer.java ends up next to XParser.java.

How do I get "import" to work properly?

Cheers,
Hilco

.
|-- pom.xml
`-- src
    `-- main
        `-- antlr3
            |-- imports
            |   `-- L.g
            `-- x
                `-- X.g

X.g:
grammar X;
import L;
@header {
package x;
}
//LETTER : 'X' ;
x : 'x' LETTER ;

L.g:
lexer grammar L;
LETTER : 'X' ;

pom.xml:
<project
  xmlns="http://maven.apache.org/POM/4.0.0";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";
>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.example</groupId>
  <artifactId>x</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>antlr-runtime</artifactId>
      <version>3.1.3</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.antlr</groupId>
        <artifactId>antlr3-maven-plugin</artifactId>
        <version>3.1.3-1</version>
        <executions>
          <execution>
            <goals>
              <goal>antlr</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

My environment:
Apache Maven 2.1.0 (r755702; 2009-03-18 12:10:27-0700)
Java version: 1.5.0_19
Java home: /opt/sun-jdk-1.5.0.19/jre
Default locale: en_CA, platform encoding: UTF-8
OS name: "linux" version: "2.6.30-gentoo-r6" arch: "i386" Family: "unix"

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

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

Reply via email to