0

Since the ActionScript target of ANTLR 3.3 is buggy, I tried to compile ANTLR 3.3 to fix the Actionscript runtime target as explained in BUILD.txt and here.

Installed Maven, set the PATH, and followed the instructions to compile ANTLR.

While I actually can make subprojects like gunit using mvn, I fail to build the ANTLR folder.

I call mvn in ANTLR distribution root folder, I get this:

[ERROR]     Child module /Users/KKK/Desktop/Neuer Ordner 4/antlr-3 2.3/antlr3-maven-archetype 
            of /Users/KKK/Desktop/Neuer Ordner 4/antlr-3 2.3/pom.xml does not exist

While distribution doesn't contain a folder antlr3-maven-archetype, it contains a similar folder antlr3-maven-plugin.

Since BUILD.txt states that building ANTLR is trivial, I wonder, I forgot to perform a trivial step ;-)

Could someone assist?

**UPDATE-1 **

Using these instructions: https://fisheye2.atlassian.com/browse/~raw,r=7250/antlr/BUILD.txt

Here is what I did:

Downloaded Maven

Added Maven to path

  export PATH=/Users/sp2/Desktop/antlrtst/maven/bin/:$PATH

Running this in the main distribution directory

  mvn -N install

Reports these problems

[WARNING] Some problems were encountered while building the effective model for org.antlr:antlr-master:pom:3.3
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 179, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 188, column 21
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:findbugs-maven-plugin is missing. @ line 192, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. @ line 250, column 14

... but finally reports

BUILD SUCCESS

Then, I executed this

mvn -Dmaven.test.skip=true

.. which begins to report problems

[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.antlr:antlr-runtime:jar:3.3
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ org.antlr:antlr-master:3.3, /Users/sp2/.m2/repository/org/antlr/antlr-master/3.3/antlr-master-3.3.pom, line 188, column 21
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:findbugs-maven-plugin is missing. @ line 1, column 3642
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. @ org.antlr:antlr-master:3.3, /Users/sp2/.m2/repository/org/antlr/antlr-master/3.3/antlr-master-3.3.pom, line 250, column 14

... adds runtime to repo

[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ antlr-runtime ---
[INFO] Installing /Users/sp2/Desktop/antlrtst/antlr-3 2.3/runtime/Java/target/antlr-runtime-3.3.jar to /Users/sp2/.m2/repository/org/antlr/antlr-runtime/3.3/antlr-runtime-3.3.jar
[INFO] Installing /Users/sp2/Desktop/antlrtst/antlr-3 2.3/runtime/Java/pom.xml to /Users/sp2/.m2/repository/org/antlr/antlr-runtime/3.3/antlr-runtime-3.3.pom
[INFO] Installing /Users/sp2/Desktop/antlrtst/antlr-3 2.3/runtime/Java/target/antlr-runtime-3.3-sources.jar to /Users/sp2/.m2/repository/org/antlr/antlr-runtime/3.3/antlr-runtime-3.3-sources.jar

... tries to build

[INFO] ------------------------------------------------------------------------
[INFO] Building ANTLR Grammar Tool 3.3
[INFO] ------------------------------------------------------------------------

... eventually reports this

[INFO] --- antlr-maven-plugin:2.2:generate (default) @ antlr ---
[INFO] grammar [antlr.g] was up-to-date; skipping
[INFO] performing grammar generation [codegen.g]
ANTLR Parser Generator   Version 2.7.7 (20060906)   1989-2005
**error**: file "/Users/sp2/Desktop/antlrtst/antlr-3 2.3/tool/src/main/antlr2/org/antlr/grammar/v2/codegen.g" not found
[INFO] performing grammar generation [antlr.print.g]

...and this

    [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ antlr ---
    [INFO] Compiling 97 source files to /Users/sp2/Desktop/antlrtst/antlr-3 2.3/tool/target/classes
    [INFO] -------------------------------------------------------------
    **[ERROR] COMPILATION ERROR :** 
    [INFO] -------------------------------------------------------------
    [ERROR] /Users/sp2/Desktop/antlrtst/antlr-3 2.3/tool/src/main/java/org/antlr/codegen/CodeGenerator.java:[37,27] cannot find symbol
    symbol  : class CodeGenTreeWalker
...

.. and finally this after 57 errors

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] ANTLR Master build control POM .................... SUCCESS [0.912s]
[INFO] Antlr 3 Runtime ................................... SUCCESS [1.463s]
[INFO] ANTLR Grammar Tool ................................ **FAILURE** [7.275s]
[INFO] Maven plugin for ANTLR V3 ......................... SKIPPED
[INFO] ANTLR gUnit ....................................... SKIPPED
[INFO] Maven plugin for gUnit ANTLR V3 ................... SKIPPED
[INFO] ------------------------------------------------------------------------

Too bad. I really wonder, why this stuff tends to be that complicated...

Community
  • 1
  • 1
SteAp
  • 11,853
  • 10
  • 53
  • 88
  • http://antlr.markmail.org/message/5e5be2fhn6ipl5rz – Bart Kiers Jun 25 '11 at 21:54
  • Yes, that's mee too. Reposted here, since SE tends to provide very good advice very fast. Bad policy? – SteAp Jun 25 '11 at 23:09
  • whether it's bad policy, is subjective. Personally, I don't like it much: you might have asked the question in even more places. And you might have already received an answer elsewhere that someone else posts here (or the other way around). Sure, I can imagine asking in more than one place if you didn't receive an answer in a while, but then it's IMO good policy to provide links to the cross-posted questions. To emphasize: there's no rule on the SE-family sites that forbids cross-posting questions. I'm just assuming you've received an answer elsewhere already and don't answer here. – Bart Kiers Jun 26 '11 at 08:19
  • @Bart Kiers: Understood! Next time I'll mention my crosspost. Additionally, I'd forward replies from one side to the oder side. Regarding my question: I didn't get helpful hints from the mailinglist. – SteAp Jun 26 '11 at 10:47

1 Answers1

1

Tried this myself. Got the same error.

Commented the offending module in the parent pom.xml

 <!--module>antlr3-maven-archetype</module-->

Built successfully.

Not sure about your requirement, but hopefully you may still achieve it with this workaround.

Edit 1: You can safely ignore all the warnings (related to versions), which are due to running a maven2 pom with maven3.

However you should not be getting this error:

error: file "/Users/sp2/Desktop/antlrtst/antlr-3 2.3/tool/src/main/antlr2/org/antlr/grammar/v2/codegen.g" not found

This file exists in the source distribution. Interestingly your folder shows "antlr-3.2.3", while other messages are related to 3.3. Could it be that you have incorrect/missing source?

Raghuram
  • 51,854
  • 11
  • 110
  • 122
  • Thank you, @Raghuram! I still get errors. Please see UPDATE-1 above. – SteAp Jun 26 '11 at 10:45
  • Interesting point! I wondered too, why the messages show different version. I'll come back, as soon as I find out anything new. Should probably start over again... – SteAp Jun 26 '11 at 16:34
  • Finally, I managed to make the compile work. Removed the Maven repo. Downloaded sources again. Renamed project folder to contain no spaces. Don's ask which one, but one change made it work. Thank you, @Raghuram! Now it's time to check the Actionscript template code... – SteAp Jun 26 '11 at 22:32