ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <>
Subject RE: Problems with ANTLR
Date Thu, 10 Jun 2010 11:41:33 GMT

Good Afternoon
please download source from

unzip/uncompress to temp folder
    public ANTLR3() {
        //commandline.setClassname("org.antlr.Tool");  /* there is no org.antlr.Tool class
        fileUtils = FileUtils.getFileUtils();

place in classpath


contents of ./classes/org/apache/tools/ant/ant/antlr/antlib.xml (first antlib.xml in classpath)
<?xml version="1.0" encoding="utf-8"?>








and snippet from build.xml test test harness (from antlr3-task/
    <property name="m2.antlib.resource" value="."/>
    <property name="m2.antlib.uri" value="antlib:org/apache/tools/ant/antlr/ANTLR3"/>
    <macrodef name="antlr3">
       <attribute name="grammar" default="grammar"/>
       <attribute name="" default="grammar"/>
       <attribute name="package" default="${package}"/>
              <echo message="antlr ${grammar}/@{}" />
              <antlr:ant-antlr3 xmlns:antlr="antlib:org/apache/tools/ant/antlr" 
    <target name="SimpleC" depends="init" >
       <antlr3"SimpleC.g" />


ant -debug SimpleC 

will explain the workings


Juergen can you correct the codebase for antlr.Tool to refactor to org.antlr.Tool so
test harness runs correctly w/o modification from above?


Vielen Danke,
Verzicht und Vertraulichkeitanmerkung

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten
wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist
unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet
keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen
wir keine Haftung fuer den Inhalt uebernehmen.


> Date: Wed, 9 Jun 2010 13:40:22 -0700
> From:
> To:
> Subject: RE: Problems with ANTLR
> 1) I downloaded the today from the antlr home page.
> 2) In the zip is a jar called antlr3_task.jar
> 3) I copied antlr3_task.jar to my eclipse ant plugin lib directory,
> C:\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib
> 4) I put this in my build.xml:
> <antlr:antlr3 xmlns:antlr="antlib:org/apache/tools/ant/antlr"
> target="${src.etc.dir}/parser/catos.g"
> outputdirectory="${}/${target.antlr.parser.dir}">
> <classpath refid="compile.classpath"/>
> </antlr:antlr3>
> 4) When I build I get:
> C:\workspace\ess-networking\build.xml:41: Problem: failed to create task or
> type antlib:org/apache/tools/ant/antlr:antlr3
> Cause: The name is undefined.
> Action: Check the spelling.
> Action: Check that any custom tasks/types have been declared.
> Action: Check that any <presetdef>/<macrodef> declarations have taken place.
> No types or tasks have been defined in this namespace yet
> This appears to be an antlib declaration. 
> Action: Check that the implementing library exists in one of:
> -C:\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145\lib
> -C:\Documents and Settings\nlaparo\.ant\lib
> -a directory added on the command line with the -lib argument
> # wrote:
> > 
> > Hi,
> > 
> > the ant-lib for the antlr3 task can be downloaded from here: 
> >
> > A short description of it's usage is enclosed in the zip-archive
> > (antlr3-task.htm or antlr3-task.doc).
> > Try the examples contained in the zip-archive. There is also an example on
> > how to use the antlr3 task for ant in netbeans.
> > If you still have questions, I will try to answer them.
> > 
> > Kind regards, J├╝rgen
> > 
> -- 
> View this message in context:
> Sent from the Ant - Users mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message