You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by David Nemer <da...@gmail.com> on 2009/04/29 00:18:38 UTC

Problems with ANTLR

Hey Everyone,

I'm trying to build my project with ANT, and I'm getting the following
error:

Reason: /scratch2/nemer/test/build.xml:47: Problem: failed to create task or
type antlr
Cause: the class org.apache.tools.ant.taskdefs.optional.ANTLR was not found.
        This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
        -ANT_HOME/lib
        -the IDE Ant configuration dialogs

Do not panic, this is a common problem.
The commonest cause is a missing JAR.

This is not a bug; it is a configuration problem

I tried to download the ant-nodeps-1.7.1.jar to the ANT_HOME/lib, but still
doesn't work!

Can anyone help me here!! I'm stuck and can't seem to find the solution!

Cheers,
--
David Nemer
Sent from Kaiserslautern, RP, Germany

AW: Problems with ANTLR

Posted by Ja...@rzf.fin-nrw.de.
<antlr> is not a task from Ant - it is one of the ANTLR parser generator.
Therefore you have to download the task implementation from the ANTLR website and 
provide it to Ant via "-lib" or one of the other suggested ways.

That's what the error message means.


Jan

>-----Ursprüngliche Nachricht-----
>Von: David Nemer [mailto:davidnemer@gmail.com] 
>Gesendet: Donnerstag, 30. April 2009 01:17
>An: Ant Users List
>Betreff: Re: Problems with ANTLR
>
>Anyone???
>
>--
>David Nemer
>Sent from Kaiserslautern, RP, Germany
>
>On Wed, Apr 29, 2009 at 12:18 AM, David Nemer 
><da...@gmail.com> wrote:
>
>> Hey Everyone,
>>
>> I'm trying to build my project with ANT, and I'm getting the 
>following
>> error:
>>
>> Reason: /scratch2/nemer/test/build.xml:47: Problem: failed 
>to create task
>> or type antlr
>> Cause: the class org.apache.tools.ant.taskdefs.optional.ANTLR was not
>> found.
>>         This looks like one of Ant's optional components.
>> Action: Check that the appropriate optional JAR exists in
>>         -ANT_HOME/lib
>>         -the IDE Ant configuration dialogs
>>
>> Do not panic, this is a common problem.
>> The commonest cause is a missing JAR.
>>
>> This is not a bug; it is a configuration problem
>>
>> I tried to download the ant-nodeps-1.7.1.jar to the 
>ANT_HOME/lib, but still
>> doesn't work!
>>
>> Can anyone help me here!! I'm stuck and can't seem to find 
>the solution!
>>
>> Cheers,
>> --
>> David Nemer
>> Sent from Kaiserslautern, RP, Germany
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Problems with ANTLR

Posted by # <ju...@web.de>.
The example build files should work now. The enclosed archive ant-antlr3.jar
has to be part of the classpath or should be copied into the
apache-ant-1.8.0/lib directory (which I prefer). Also be sure to have the
antlr-3.2.jar in the classpath or let the environment variable ANTLR_HOME
point to the directory which contains it.
Try the d2u example enclosed in the antlr3-task.zip for a quick check. Use
ant build.xml if antlr-3.2.jar is part of the classpath or ant -f
build.xml.antlr_home when ANTLR_HOME points to the directory which contains
antlr-3.2.jar. 

Kind regards
Juergen

http://old.nabble.com/file/p28931002/antlr3-task.zip antlr3-task.zip 


# wrote:
> 
> I will have a thorough look at the antlr3 task for ant next week,
> especially the build files and the documentation.
> 
> Viele Grüße
> Jürgen
> 
> 
> mgainty wrote:
>> 
>> 
>> Good Afternoon
>>  
>> please download antlr3-task.zip source from
>> http://www.antlr.org/share/1169924912745/antlr3-task.zip 
>> unzip/uncompress to temp folder
>> in org.apache.tools.ant.antlr.ANTLR3.java
>> change
>>     public ANTLR3() {
>>         commandline.setVm(JavaEnvUtils.getJreExecutable("java"));
>>         //commandline.setClassname("org.antlr.Tool");  /* there is no
>> org.antlr.Tool class */
>>         commandline.setClassname("antlr.Tool");
>>         fileUtils = FileUtils.getFileUtils();
>>     }
>> recompile
>> 
>> place org.apache.tools.ant.antlr.ANTLR3 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"?>
>> 
>> <antlib>
>> 
>>   <taskdef
>> 
>>     name="ant-antlr3"
>> 
>>     classname="org.apache.tools.ant.antlr.ANTLR3"
>> 
>>     />
>> 
>> </antlib>
>> 
>>  
>> 
>> and snippet from build.xml test test harness (from
>> antlr3-task/simplecTreeParser.tp):
>>     <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="grammar.name" default="grammar"/>
>>        <attribute name="package" default="${package}"/>
>>        <sequential>
>>               <echo message="antlr ${grammar}/@{grammar.name}" />
>>               <antlr:ant-antlr3
>> xmlns:antlr="antlib:org/apache/tools/ant/antlr" 
>>                   target="${grammar}/@{grammar.name}" 
>>                   outputdirectory="${src}/@{package}"
>>                   libdirectory="${src}/@{package}"
>>                   multithreaded="${multithreaded}"
>>                   report="${report}"
>>                   depend="${depend}"
>>                   profile="${profile}">
>>               </antlr:ant-antlr3>
>>         </sequential>
>>     </macrodef>
>>     
>>     <target name="SimpleC" depends="init" >
>>        <antlr3 grammar.name="SimpleC.g" />
>>     </target>
>> 
>>  
>> 
>> ant -debug SimpleC 
>> 
>> will explain the workings
>> 
>>  
>> 
>> Juergen can you correct the codebase for antlr.Tool to refactor to
>> org.antlr.Tool so org.apache.tools.ant.antlr.ANTLR3 test harness runs
>> correctly w/o modification from above?
>> 
>>  
>> 
>> Vielen Danke,
>> Martin  
>> ______________________________________________ 
>> 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: nlaparo@yahoo.com
>>> To: user@ant.apache.org
>>> Subject: RE: Problems with ANTLR
>>> 
>>> 
>>> 1) I downloaded the antlr3-task.zip 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.gen.java.dir}/${target.antlr.parser.dir}">
>>> <classpath refid="compile.classpath"/>
>>> </antlr:antlr3>
>>> 
>>> 4) When I build I get:
>>> BUILD FAILED
>>> 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: 
>>> > http://antlr.org/share/1169924912745/antlr3-task.zip
>>> > 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:
>>> http://old.nabble.com/Problems-with-ANTLR-tp23287211p28835592.html
>>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>> 
>>  		 	   		  
>> _________________________________________________________________
>> The New Busy is not the too busy. Combine all your e-mail accounts with
>> Hotmail.
>> http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Problems-with-ANTLR-tp23287211p28931002.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Problems with ANTLR

Posted by # <ju...@web.de>.
I will have a thorough look at the antlr3 task for ant next week, especially
the build files and the documentation.

Viele Grüße
Jürgen


mgainty wrote:
> 
> 
> Good Afternoon
>  
> please download antlr3-task.zip source from
> http://www.antlr.org/share/1169924912745/antlr3-task.zip 
> unzip/uncompress to temp folder
> in org.apache.tools.ant.antlr.ANTLR3.java
> change
>     public ANTLR3() {
>         commandline.setVm(JavaEnvUtils.getJreExecutable("java"));
>         //commandline.setClassname("org.antlr.Tool");  /* there is no
> org.antlr.Tool class */
>         commandline.setClassname("antlr.Tool");
>         fileUtils = FileUtils.getFileUtils();
>     }
> recompile
> 
> place org.apache.tools.ant.antlr.ANTLR3 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"?>
> 
> <antlib>
> 
>   <taskdef
> 
>     name="ant-antlr3"
> 
>     classname="org.apache.tools.ant.antlr.ANTLR3"
> 
>     />
> 
> </antlib>
> 
>  
> 
> and snippet from build.xml test test harness (from
> antlr3-task/simplecTreeParser.tp):
>     <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="grammar.name" default="grammar"/>
>        <attribute name="package" default="${package}"/>
>        <sequential>
>               <echo message="antlr ${grammar}/@{grammar.name}" />
>               <antlr:ant-antlr3
> xmlns:antlr="antlib:org/apache/tools/ant/antlr" 
>                   target="${grammar}/@{grammar.name}" 
>                   outputdirectory="${src}/@{package}"
>                   libdirectory="${src}/@{package}"
>                   multithreaded="${multithreaded}"
>                   report="${report}"
>                   depend="${depend}"
>                   profile="${profile}">
>               </antlr:ant-antlr3>
>         </sequential>
>     </macrodef>
>     
>     <target name="SimpleC" depends="init" >
>        <antlr3 grammar.name="SimpleC.g" />
>     </target>
> 
>  
> 
> ant -debug SimpleC 
> 
> will explain the workings
> 
>  
> 
> Juergen can you correct the codebase for antlr.Tool to refactor to
> org.antlr.Tool so org.apache.tools.ant.antlr.ANTLR3 test harness runs
> correctly w/o modification from above?
> 
>  
> 
> Vielen Danke,
> Martin  
> ______________________________________________ 
> 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: nlaparo@yahoo.com
>> To: user@ant.apache.org
>> Subject: RE: Problems with ANTLR
>> 
>> 
>> 1) I downloaded the antlr3-task.zip 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.gen.java.dir}/${target.antlr.parser.dir}">
>> <classpath refid="compile.classpath"/>
>> </antlr:antlr3>
>> 
>> 4) When I build I get:
>> BUILD FAILED
>> 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: 
>> > http://antlr.org/share/1169924912745/antlr3-task.zip
>> > 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:
>> http://old.nabble.com/Problems-with-ANTLR-tp23287211p28835592.html
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>> 
>  		 	   		  
> _________________________________________________________________
> The New Busy is not the too busy. Combine all your e-mail accounts with
> Hotmail.
> http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4
> 

-- 
View this message in context: http://old.nabble.com/Problems-with-ANTLR-tp23287211p28849452.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: AW: AW: Problems with ANTLR

Posted by Matt Benson <gu...@gmail.com>.
Hmm, I don't know what could be the cause of the poor performance. I've
never used ANTLR 3 much tbh. As for the task name, it is indeed defined by
the name attribute of the taskdef, but note that in your current working
example, you are using your own taskdef and are effectively bypassing the
antlib definition.

Matt
On Aug 20, 2013 3:35 AM, "Ernst Reissner" <re...@arcor.de> wrote:

> Hi Matt,
> thanks: one step further!
> I tried now
>
>
>    <path id="antlr.classpath">
>      <fileset dir="${basedir}/jars">
>        <include name="ant-antlr3.jar"/>
>        <include name="antlr-3.5-complete.jar"/>
>      </fileset>
>    </path>
>
>    <taskdef name="ant-antlr3"
>         classname="org.apache.tools.ant.antlr.ANTLR3"
>         classpathref="antlr.classpath"/>
>
>    <target name="genParser" depends="init"
>            description="Generate parsers. ">
>
>      <ant-antlr3 target="${parserDirRelana}/CClass.g"
>          outputdirectory="${parserTargetDirRelana}"
>          verbose="true" >
>         <classpath refid="antlr.classpath"/>
>      </ant-antlr3>
> ...
>
> It seems to create parsers only when grammar changed, so it is ok, but:
> it is very slow: 11 secs if no parser is created and 30 if grammars are
> created.
> So a large portion of time goes into actions i cannot understand.
> Whats the point here??
>
> As you can see, i added the attribute verbose="true" because otherwise,
> the task does not display the grammer it works on.
>
> You gave me the hint, that the name of the task i defined is ant-antlr3.
> I had a look at ant-doc "Writing Your Own Task" at
> http://ant.apache.org/manual/develop.html.
> Well they have forgotten to mention where the taskname comes from.
> Is it the name of the defining jar?
> or is it defined by the file org/apache/tools/ant/antlr/antlib.xml in
> the jar which looks like this:
>
>
> <?xml version="1.0" encoding="utf-8"?>
>   <antlib>
>     <taskdef   name="ant-antlr3"
> classname="org.apache.tools.ant.antlr.ANTLR3"    />
>   </antlib>
>
>
>
> When I run the task however the output indicates a problem:
>
> genParser:
> [ant-antlr3] Failed to change file modification time
> [ant-antlr3] ANTLR Parser Generator  Version 3.5
> [ant-antlr3]
> /home/ernst/Software/src/main/antlr3/eu/simuline/relana/parser/CClass.g
> [ant-antlr3] Failed to change file modification time
> [ant-antlr3]
> /home/ernst/Software/src/main/antlr3/eu/simuline/relana/parser/SClass.g
> [ant-antlr3] ANTLR Parser Generator  Version 3.5
> [ant-antlr3] Failed to change file modification time
> [ant-antlr3] ANTLR Parser Generator  Version 3.5
> [ant-antlr3]
> /home/ernst/Software/src/main/antlr3/eu/simuline/relana/parser/Formula.g
> [ant-antlr3] Failed to change file modification time
>
> The message: Failed to change file modification time seems to belong to
> the touch task.
> I really cannot figure out which file could me meant.
> This message comes even if no parser is defined yet.
>
> greetings,
> Ernst
>
> > See inline for some commentary:
> >
> >
> > On Mon, Aug 19, 2013 at 2:28 AM, Ernst Reissner <[hidden email]
> > </user/SendEmail.jtp?type=node&node=5714362&i=0>> wrote:
> >
> > > Ok, got one step further:
> > > now i have:
> > >
> > >    <path id="antlr.classpath">
> > >      <fileset dir="${basedir}/jars">
> > >        <include name="ant-antlr3.jar"/>
> > >      </fileset>
> > >    </path>
> > >
> > >
> > Here you define the task as being named "ant-antlr3":
> >
> >
> > >    <taskdef name="ant-antlr3"
> > >         classname="org.apache.tools.ant.antlr.ANTLR3"
> > >         classpathref="antlr.classpath"/>
> > >
> > > which seems to work.
> > >
> > > But when i try to use the new task by
> > >
> > >
> > Here you try use a task named "antlr", which is the ANTLR v2 task that
> > has
> > shipped with Ant prior to the release of ANTLRv3 and before the Ant PMC
> > began to push for third parties managing their own Ant tasks rather than
> > Ant trying to provide them all:
> >
> >
> > >      <antlr target="${parserDirRelana}/CClass.g"
> > >         outputdirectory="${parserTargetDirRelana}">
> > >         <classpath refid="antlr.classpath"/>
> > >      </antlr>
> > >
> > > ant complaints
> > >
> > > ernst@localhost:~/Software> ant genParser
> > > Buildfile: /home/ernst/Software/build.xml
> > >
> > > init:
> > >
> > > genParser:
> > >
> > > BUILD FAILED
> > > /home/ernst/Software/build.xml:377: Unable to determine generated class
> > >
> > > Total time: 0 seconds
> > >
> > > Who can tell me what this means, and even better: what to do now.
> > >
> >
> > Don't try to use ANTLR 2 on a v3 grammar.  ;P
> >
> > Matt
> >
> >
> > > Ernst
> > >
> > >
> > > > Hi Jan,
> > > > i tried
> > > >>   <taskdef
> > > >>     name="ant-antlr3"
> > > >>     classname="org.apache.tools.ant.antlr.ANTLR3"
> > > >>     />
> > > > as you suggested (which looks much better than what i did before).
> > > > Result
> > > >
> > > > ernst@localhost:~/Software> ant genParser
> > > > Buildfile: /home/ernst/Software/build.xml
> > > >
> > > > BUILD FAILED
> > > > /home/ernst/Software/build.xml:360: taskdef class
> > > > org.apache.tools.ant.antlr.ANTLR3 cannot be found
> > > >  using the classloader AntClassLoader[]
> > > >
> > > > I am very confused about that, because i integrated ant-antlr3.jar
> > the
> > > > same way
> > > > suse distribution integrated ant-antlr.jar and other taskdefs.
> > > >
> > > > As I wrote before, ant -diagnostics yields
> > > > ------- Ant diagnostics report -------
> > > > Apache Ant(TM) version 1.8.2 compiled on January 27 2013
> > > >
> > > > -------------------------------------------
> > > >  Implementation Version
> > > > -------------------------------------------
> > > > core tasks     : 1.8.2 in file:/usr/share/java/ant.jar
> > > >
> > > > ...
> > > > -------------------------------------------
> > > >  ANT_HOME/lib jar listing
> > > > -------------------------------------------
> > > > ant.home: /usr/share/ant
> > > > ant-jmf.jar (6709 bytes)
> > > > ant-bootstrap.jar (19876 bytes)
> > > > ant-junit.jar (102344 bytes)
> > > > ant.jar (1963225 bytes)
> > > > ant-jsch.jar (40235 bytes)
> > > > ant-launcher.jar (12433 bytes)
> > > > ant-javamail.jar (7959 bytes)
> > > > ant-testutil.jar (15194 bytes)
> > > > ant-antlr3.jar (20889 bytes)
> > > > ant-jdepend.jar (8221 bytes)
> > > > ant-antlr.jar (5750 bytes)
> > > > ant-swing.jar (7547 bytes)
> > > >
> > > > -------------------------------------------
> > > >  USER_HOME/.ant/lib jar listing
> > > > -------------------------------------------
> > > > user.home: /home/ernst
> > > > No such directory.
> > > >
> > > >
> > > > as you can see, ant-antlr3.jar (20889 bytes) is present.
> > > > Also:
> > > > java.class.path :
> > > >
> > >
> >
> /usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:
> > > > /usr/share/java/antlr.jar:
> > > >
> > >
> >
> /usr/share/java/ant/ant-antlr.jar:/usr/share/java/ant/ant-javamail.jar:/usr/share/java/jdepend.jar:/usr/share/java/ant/ant-jdepend.jar:/usr/share/java/ant/ant-jmf.jar:/usr/share/java/jsch.jar:/usr/share/java/ant/ant-jsch.jar:/usr/share/java/junit.jar:/usr/share/java/ant/ant-junit.jar:/usr/share/java/ant/ant-swing.jar:/usr/share/java/ant/ant-testutil.jar:/usr/lib64/jvm/java/lib/tools.jar:/usr/share/ant/lib/ant-jmf.jar:/usr/share/ant/lib/ant-bootstrap.jar:/usr/share/ant/lib/ant-junit.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-jsch.jar:/usr/share/ant/lib/ant-launcher.jar:/usr/share/ant/lib/ant-javamail.jar:/usr/share/ant/lib/ant-testutil.jar:
> > > > /usr/share/ant/lib/ant-antlr3.jar:
> > > >
> > >
> >
> /usr/share/ant/lib/ant-jdepend.jar:/usr/share/ant/lib/ant-antlr.jar:/usr/share/ant/lib/ant-swing.jar
> > > >
> > > > I am not an expert, but it looks fine for me.
> > > >
> > > > What could be the problem?
> > > >
> > > > Ernst
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714358.html
> > > Sent from the Ant - Users mailing list archive at Nabble.com.
> > >
> >
> >
> > ------------------------------------------------------------------------
> > If you reply to this email, your message will be added to the
> > discussion below:
> >
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714362.html
> >
> > To unsubscribe from Problems with ANTLR, click here
> > <
> http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1349074&code=cmVpM25lckBhcmNvci5kZXwxMzQ5MDc0fDExODQzMjAw
> >.
> > NAML
> > <
> http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
>
>
> --
> View this message in context:
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714365.html
> Sent from the Ant - Users mailing list archive at Nabble.com.

Re: AW: AW: Problems with ANTLR

Posted by Ernst Reissner <re...@arcor.de>.
Hi Matt,
thanks: one step further!
I tried now


   <path id="antlr.classpath">
     <fileset dir="${basedir}/jars">
       <include name="ant-antlr3.jar"/>
       <include name="antlr-3.5-complete.jar"/>
     </fileset>
   </path>

   <taskdef name="ant-antlr3"
        classname="org.apache.tools.ant.antlr.ANTLR3"
        classpathref="antlr.classpath"/>

   <target name="genParser" depends="init"
           description="Generate parsers. ">

     <ant-antlr3 target="${parserDirRelana}/CClass.g"
         outputdirectory="${parserTargetDirRelana}"
         verbose="true" >
        <classpath refid="antlr.classpath"/>
     </ant-antlr3>
...

It seems to create parsers only when grammar changed, so it is ok, but:
it is very slow: 11 secs if no parser is created and 30 if grammars are
created.
So a large portion of time goes into actions i cannot understand.
Whats the point here??

As you can see, i added the attribute verbose="true" because otherwise,
the task does not display the grammer it works on.

You gave me the hint, that the name of the task i defined is ant-antlr3.
I had a look at ant-doc "Writing Your Own Task" at
http://ant.apache.org/manual/develop.html.
Well they have forgotten to mention where the taskname comes from.
Is it the name of the defining jar?
or is it defined by the file org/apache/tools/ant/antlr/antlib.xml in
the jar which looks like this:


<?xml version="1.0" encoding="utf-8"?>
  <antlib>
    <taskdef   name="ant-antlr3"   
classname="org.apache.tools.ant.antlr.ANTLR3"    />
  </antlib>



When I run the task however the output indicates a problem:

genParser:
[ant-antlr3] Failed to change file modification time
[ant-antlr3] ANTLR Parser Generator  Version 3.5
[ant-antlr3]
/home/ernst/Software/src/main/antlr3/eu/simuline/relana/parser/CClass.g
[ant-antlr3] Failed to change file modification time
[ant-antlr3]
/home/ernst/Software/src/main/antlr3/eu/simuline/relana/parser/SClass.g
[ant-antlr3] ANTLR Parser Generator  Version 3.5
[ant-antlr3] Failed to change file modification time
[ant-antlr3] ANTLR Parser Generator  Version 3.5
[ant-antlr3]
/home/ernst/Software/src/main/antlr3/eu/simuline/relana/parser/Formula.g
[ant-antlr3] Failed to change file modification time

The message: Failed to change file modification time seems to belong to
the touch task.
I really cannot figure out which file could me meant.
This message comes even if no parser is defined yet.

greetings,
Ernst

> See inline for some commentary:
>
>
> On Mon, Aug 19, 2013 at 2:28 AM, Ernst Reissner <[hidden email]
> </user/SendEmail.jtp?type=node&node=5714362&i=0>> wrote:
>
> > Ok, got one step further:
> > now i have:
> >
> >    <path id="antlr.classpath">
> >      <fileset dir="${basedir}/jars">
> >        <include name="ant-antlr3.jar"/>
> >      </fileset>
> >    </path>
> >
> >
> Here you define the task as being named "ant-antlr3":
>
>
> >    <taskdef name="ant-antlr3"
> >         classname="org.apache.tools.ant.antlr.ANTLR3"
> >         classpathref="antlr.classpath"/>
> >
> > which seems to work.
> >
> > But when i try to use the new task by
> >
> >
> Here you try use a task named "antlr", which is the ANTLR v2 task that
> has
> shipped with Ant prior to the release of ANTLRv3 and before the Ant PMC
> began to push for third parties managing their own Ant tasks rather than
> Ant trying to provide them all:
>
>
> >      <antlr target="${parserDirRelana}/CClass.g"
> >         outputdirectory="${parserTargetDirRelana}">
> >         <classpath refid="antlr.classpath"/>
> >      </antlr>
> >
> > ant complaints
> >
> > ernst@localhost:~/Software> ant genParser
> > Buildfile: /home/ernst/Software/build.xml
> >
> > init:
> >
> > genParser:
> >
> > BUILD FAILED
> > /home/ernst/Software/build.xml:377: Unable to determine generated class
> >
> > Total time: 0 seconds
> >
> > Who can tell me what this means, and even better: what to do now.
> >
>
> Don't try to use ANTLR 2 on a v3 grammar.  ;P
>
> Matt
>
>
> > Ernst
> >
> >
> > > Hi Jan,
> > > i tried
> > >>   <taskdef
> > >>     name="ant-antlr3"
> > >>     classname="org.apache.tools.ant.antlr.ANTLR3"
> > >>     />
> > > as you suggested (which looks much better than what i did before).
> > > Result
> > >
> > > ernst@localhost:~/Software> ant genParser
> > > Buildfile: /home/ernst/Software/build.xml
> > >
> > > BUILD FAILED
> > > /home/ernst/Software/build.xml:360: taskdef class
> > > org.apache.tools.ant.antlr.ANTLR3 cannot be found
> > >  using the classloader AntClassLoader[]
> > >
> > > I am very confused about that, because i integrated ant-antlr3.jar
> the
> > > same way
> > > suse distribution integrated ant-antlr.jar and other taskdefs.
> > >
> > > As I wrote before, ant -diagnostics yields
> > > ------- Ant diagnostics report -------
> > > Apache Ant(TM) version 1.8.2 compiled on January 27 2013
> > >
> > > -------------------------------------------
> > >  Implementation Version
> > > -------------------------------------------
> > > core tasks     : 1.8.2 in file:/usr/share/java/ant.jar
> > >
> > > ...
> > > -------------------------------------------
> > >  ANT_HOME/lib jar listing
> > > -------------------------------------------
> > > ant.home: /usr/share/ant
> > > ant-jmf.jar (6709 bytes)
> > > ant-bootstrap.jar (19876 bytes)
> > > ant-junit.jar (102344 bytes)
> > > ant.jar (1963225 bytes)
> > > ant-jsch.jar (40235 bytes)
> > > ant-launcher.jar (12433 bytes)
> > > ant-javamail.jar (7959 bytes)
> > > ant-testutil.jar (15194 bytes)
> > > ant-antlr3.jar (20889 bytes)
> > > ant-jdepend.jar (8221 bytes)
> > > ant-antlr.jar (5750 bytes)
> > > ant-swing.jar (7547 bytes)
> > >
> > > -------------------------------------------
> > >  USER_HOME/.ant/lib jar listing
> > > -------------------------------------------
> > > user.home: /home/ernst
> > > No such directory.
> > >
> > >
> > > as you can see, ant-antlr3.jar (20889 bytes) is present.
> > > Also:
> > > java.class.path :
> > >
> >
> /usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:
> > > /usr/share/java/antlr.jar:
> > >
> >
> /usr/share/java/ant/ant-antlr.jar:/usr/share/java/ant/ant-javamail.jar:/usr/share/java/jdepend.jar:/usr/share/java/ant/ant-jdepend.jar:/usr/share/java/ant/ant-jmf.jar:/usr/share/java/jsch.jar:/usr/share/java/ant/ant-jsch.jar:/usr/share/java/junit.jar:/usr/share/java/ant/ant-junit.jar:/usr/share/java/ant/ant-swing.jar:/usr/share/java/ant/ant-testutil.jar:/usr/lib64/jvm/java/lib/tools.jar:/usr/share/ant/lib/ant-jmf.jar:/usr/share/ant/lib/ant-bootstrap.jar:/usr/share/ant/lib/ant-junit.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-jsch.jar:/usr/share/ant/lib/ant-launcher.jar:/usr/share/ant/lib/ant-javamail.jar:/usr/share/ant/lib/ant-testutil.jar:
> > > /usr/share/ant/lib/ant-antlr3.jar:
> > >
> >
> /usr/share/ant/lib/ant-jdepend.jar:/usr/share/ant/lib/ant-antlr.jar:/usr/share/ant/lib/ant-swing.jar
> > >
> > > I am not an expert, but it looks fine for me.
> > >
> > > What could be the problem?
> > >
> > > Ernst
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714358.html
> > Sent from the Ant - Users mailing list archive at Nabble.com.
> >
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the
> discussion below:
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714362.html
>
> To unsubscribe from Problems with ANTLR, click here
> <http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1349074&code=cmVpM25lckBhcmNvci5kZXwxMzQ5MDc0fDExODQzMjAw>.
> NAML
> <http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>





--
View this message in context: http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714365.html
Sent from the Ant - Users mailing list archive at Nabble.com.

Re: AW: Problems with ANTLR

Posted by Ernst Reissner <re...@arcor.de>.
Ok, I understand. But how should they, i.e. the antlr-people define
their ant-task.
I am sure, they will do if we tell them.

> Okay, I apologize. The ANTLR wiki does in fact specify the XML namespace
> you are using, but technically they should not be hijacking an org.apache
> namespace in this manner, hence my confusion. :-(
>
> Matt
> On Aug 18, 2013 5:44 PM, "Ernst Reissner" <[hidden email]
> </user/SendEmail.jtp?type=node&node=5714354&i=0>> wrote:
>
> > Hmmmm,
> > what I read is
> > http://www.antlr.org/wiki/display/ANTLR3/How+to+use+ant+with+ANTLR3
> >
> > They suggest a test
> > |$ ant -diagnostics
> >
> > which should show
> >
> > |
> > |\------------------------------------------\-|
> > |ANT_HOME/lib jar listing|
> > |\------------------------------------------\-|
> > |ant.home: /usr/share/ant|
> > |ant-antlr.jar (||5758| |bytes)|
> > |ant-antlr3.jar (||20.889| |bytes) <--------\-
> >
> > I must admit, the number of bytes ant shows is not as given
> > but essentially, the answer is as expected:
> >
> >
> > -------------------------------------------
> >  ANT_HOME/lib jar listing
> > -------------------------------------------
> > ant.home: /usr/share/ant
> > ant-jmf.jar (6709 bytes)
> > ant-bootstrap.jar (19876 bytes)
> > ant-junit.jar (102344 bytes)
> > ant.jar (1963225 bytes)
> > ant-jsch.jar (40235 bytes)
> > ant-launcher.jar (12433 bytes)
> > ant-javamail.jar (7959 bytes)
> > ant-testutil.jar (15194 bytes)
> > ant-antlr3.jar (20889 bytes)
> > ant-jdepend.jar (8221 bytes)
> > ant-antlr.jar (5750 bytes)
> > ant-swing.jar (7547 bytes)
> >
> >
> > |
> > |Does this mean that the setup is ok?
> >
> > Ernst
> >
> > |
> > > That is not the namespace of the ANTLR task; its jar may not even be
> > > set up
> > > as an antlib as such. You'll need to consult the documentation for
> the
> > > task
> > > to find out the proper way to set it up.
> > >
> > > Matt
> > > On Aug 18, 2013 10:48 AM, "Ernst Reissner" <[hidden email]
> > > </user/SendEmail.jtp?type=node&node=5714351&i=0>> wrote:
> > >
> > > > Hello Jan,
> > > > you mean that ant-antlr3.jar is not in place?
> > > > I have it in /usr/share/ant/lib
> > > > and even if I provide ant -lib /home/ernst/Software/jars, where it
> > > is as
> > > > well, it does not work.
> > > >
> > > > Ernst
> > > >
> > > > > Maybe the antlib is not on the classpath?
> > > > > For loading antlibs via namespaces from custom classpath see
> > > > > http://ant.apache.org/manual/Types/antlib.html#loadFromInside
> > > > >
> > > > > Jan
> > > > >
> > > > > > -----Ursprüngliche Nachricht-----
> > > > > > Von: Ernst Reissner [mailto:[hidden email]
> > > > > </user/SendEmail.jtp?type=node&node=5714329&i=0>]
> > > > > > Gesendet: Mittwoch, 7. August 2013 15:16
> > > > > > An: [hidden email]
> </user/SendEmail.jtp?type=node&node=5714329&i=1>
> > > > > > Betreff: RE: Problems with ANTLR
> > > > > >
> > > > > > Hi all,
> > > > > > I have a similar problem receiving
> > > > > > /home/ernst/Software/build.xml:352: Problem: failed to create
> > > task or
> > > > > > type
> > > > > > antlib:org/apache/tools/ant/antlr:ant-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:
> > > > > >         -/usr/share/ant/lib
> > > > > >         -/home/ernst/.ant/lib
> > > > > >         -a directory added on the command line with the -lib
> > > argument
> > > > > >
> > > > > >
> > > > > > I think i did all right:
> > > > > >
> > > > > > The relevant snippet of my built file is
> > > > > >
> > > > > > <path id="antlr.classpath">
> > > > > >     <pathelement location="${antlrJar}"/>
> > > > > >     <pathelement location="${ant-antlrJar}"/> </path>
> > > > > >
> > > > > >    <target name="genParser" depends="init"
> > > > > >            description="Generate parsers. ">
> > > > > >
> > > > > >      <antlr:ant-antlr3
> > > xmlns:antlr="antlib:org/apache/tools/ant/antlr"
> > > > > >       target="${parserDirRelana}/CClass.g"
> > > > > >       outputdirectory="${parserTargetDirRelana}">
> > > > > >         <classpath refid="antlr.classpath"/>
> > > > > >      </antlr:ant-antlr3>
> > > > > >
> > > > > > Here,
> > > > > >     <property name="antlrJar"
> > > > > > value="${jarDir}/antlr-3.5-complete.jar"/>
> > > > > >     <property name="ant-antlrJar"     value="${jarDir}/ant-
> > > > > > antlr3.jar"/>
> > > > > > point to antlr-3.5-complete.jar and to ant-antlr3.jar which
> really
> > > > > > exist.
> > > > > >
> > > > > > I use ant -version
> > > > > > Apache Ant(TM) version 1.8.2 compiled on October 23 2011
> > > > > >
> > > > > > The ant-libs look like this:
> > > > > > linux-p4vf:/usr/share/java/ant # ll
> > > > > > total 164
> > > > > > -rw-r--r-- 1 root root  20889 Aug  7 03:15 ant-antlr3.jar
> > > > > > -rw-r--r-- 1 root root   3912 Oct 23  2011
> ant-commons-logging.jar
> > > > > > -rw-r--r-- 1 root root   8225 Oct 23  2011 ant-jdepend.jar
> > > > > > -rw-r--r-- 1 root root 102343 Oct 23  2011 ant-junit.jar
> > > > > > -rw-r--r-- 1 root root   7547 Oct 23  2011 ant-swing.jar
> > > > > > -rw-r--r-- 1 root root  15198 Oct 23  2011 ant-testutil.jar
> > > > > >
> > > > > > linux-p4vf:/usr/share/ant/lib # ll
> > > > > > total 0
> > > > > > lrwxrwxrwx 1 root root 29 Aug  7 14:49 ant-antlr3.jar ->
> > > > > > ../../java/ant/ant-antlr3.jar lrwxrwxrwx 1 root root 28 Sep  8
> > >  2012
> > > > > > ant-bootstrap.jar -> ../../java/ant-bootstrap.jar lrwxrwxrwx
> 1 root
> > > > > > root 38 Apr 21 02:05 ant-commons-logging.jar ->
> ../../java/ant/ant-
> > > > > > commons-logging.jar
> > > > > > lrwxrwxrwx 1 root root 18 Sep  8  2012 ant.jar ->
> > > ../../java/ant.jar
> > > > > > lrwxrwxrwx 1 root root 30 Apr 21 02:05 ant-jdepend.jar ->
> > > > > > ../../java/ant/ant-jdepend.jar lrwxrwxrwx 1 root root 28 Sep  8
> > >  2012
> > > > > > ant-junit.jar -> ../../java/ant/ant-junit.jar lrwxrwxrwx 1 root
> > > root 27
> > > > > > Sep  8  2012 ant-launcher.jar -> ../../java/ant-launcher.jar
> > > lrwxrwxrwx
> > > > > > 1 root root 28 Apr 21 02:05 ant-swing.jar ->
> ../../java/ant/ant-
> > > > > > swing.jar lrwxrwxrwx 1 root root 31 Apr 21 02:05
> > > ant-testutil.jar ->
> > > > > > ../../java/ant/ant-testutil.jar
> > > > > >
> > > > > >
> > > > > > I cannot figure out what my problem is.
> > > > > >
> > > > > > can you help???
> > > > > >
> > > > > > Greetings, Ernst
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > View this message in context:
> > > > > > http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-
> > > > > > tp1349074p5714327.html
> > > > > > Sent from the Ant - Users mailing list archive at Nabble.com.
> > > > > >
> > > > > >
> > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: [hidden email]
> > > > > </user/SendEmail.jtp?type=node&node=5714329&i=2> For additional
> > > > > > commands, e-mail: [hidden email]
> > > > > </user/SendEmail.jtp?type=node&node=5714329&i=3>
> > > > >
> > > > >
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: [hidden email]
> > > > > </user/SendEmail.jtp?type=node&node=5714329&i=4>
> > > > > For additional commands, e-mail: [hidden email]
> > > > > </user/SendEmail.jtp?type=node&node=5714329&i=5>
> > > > >
> > > > >
> > > > >
> > > > >
> > >
> ------------------------------------------------------------------------
> > > > > If you reply to this email, your message will be added to the
> > > > > discussion below:
> > > > >
> > > >
> > >
> >
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714329.html
> > > > >
> > > > > To unsubscribe from Problems with ANTLR, click here
> > > > > <
> > > > >.
> > > > > NAML
> > > > > <
> > > >
> > >
> >
> http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > View this message in context:
> > > >
> > >
> >
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714350.html
> > > > Sent from the Ant - Users mailing list archive at Nabble.com.
> > >
> > >
> > >
> ------------------------------------------------------------------------
> > > If you reply to this email, your message will be added to the
> > > discussion below:
> > >
> >
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714351.html
> > >
> > > To unsubscribe from Problems with ANTLR, click here
> > > <
> > >.
> > > NAML
> > > <
> >
> http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > >
> > >
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714353.html
> > Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the
> discussion below:
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714354.html
>
> To unsubscribe from Problems with ANTLR, click here
> <http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1349074&code=cmVpM25lckBhcmNvci5kZXwxMzQ5MDc0fDExODQzMjAw>.
> NAML
> <http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>





--
View this message in context: http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714356.html
Sent from the Ant - Users mailing list archive at Nabble.com.

Re: AW: Problems with ANTLR

Posted by Matt Benson <gu...@gmail.com>.
Okay, I apologize. The ANTLR wiki does in fact specify the XML namespace
you are using, but technically they should not be hijacking an org.apache
namespace in this manner, hence my confusion. :-(

Matt
On Aug 18, 2013 5:44 PM, "Ernst Reissner" <re...@arcor.de> wrote:

> Hmmmm,
> what I read is
> http://www.antlr.org/wiki/display/ANTLR3/How+to+use+ant+with+ANTLR3
>
> They suggest a test
> |$ ant -diagnostics
>
> which should show
>
> |
> |\------------------------------------------\-|
> |ANT_HOME/lib jar listing|
> |\------------------------------------------\-|
> |ant.home: /usr/share/ant|
> |ant-antlr.jar (||5758| |bytes)|
> |ant-antlr3.jar (||20.889| |bytes) <--------\-
>
> I must admit, the number of bytes ant shows is not as given
> but essentially, the answer is as expected:
>
>
> -------------------------------------------
>  ANT_HOME/lib jar listing
> -------------------------------------------
> ant.home: /usr/share/ant
> ant-jmf.jar (6709 bytes)
> ant-bootstrap.jar (19876 bytes)
> ant-junit.jar (102344 bytes)
> ant.jar (1963225 bytes)
> ant-jsch.jar (40235 bytes)
> ant-launcher.jar (12433 bytes)
> ant-javamail.jar (7959 bytes)
> ant-testutil.jar (15194 bytes)
> ant-antlr3.jar (20889 bytes)
> ant-jdepend.jar (8221 bytes)
> ant-antlr.jar (5750 bytes)
> ant-swing.jar (7547 bytes)
>
>
> |
> |Does this mean that the setup is ok?
>
> Ernst
>
> |
> > That is not the namespace of the ANTLR task; its jar may not even be
> > set up
> > as an antlib as such. You'll need to consult the documentation for the
> > task
> > to find out the proper way to set it up.
> >
> > Matt
> > On Aug 18, 2013 10:48 AM, "Ernst Reissner" <[hidden email]
> > </user/SendEmail.jtp?type=node&node=5714351&i=0>> wrote:
> >
> > > Hello Jan,
> > > you mean that ant-antlr3.jar is not in place?
> > > I have it in /usr/share/ant/lib
> > > and even if I provide ant -lib /home/ernst/Software/jars, where it
> > is as
> > > well, it does not work.
> > >
> > > Ernst
> > >
> > > > Maybe the antlib is not on the classpath?
> > > > For loading antlibs via namespaces from custom classpath see
> > > > http://ant.apache.org/manual/Types/antlib.html#loadFromInside
> > > >
> > > > Jan
> > > >
> > > > > -----Ursprüngliche Nachricht-----
> > > > > Von: Ernst Reissner [mailto:[hidden email]
> > > > </user/SendEmail.jtp?type=node&node=5714329&i=0>]
> > > > > Gesendet: Mittwoch, 7. August 2013 15:16
> > > > > An: [hidden email] </user/SendEmail.jtp?type=node&node=5714329&i=1>
> > > > > Betreff: RE: Problems with ANTLR
> > > > >
> > > > > Hi all,
> > > > > I have a similar problem receiving
> > > > > /home/ernst/Software/build.xml:352: Problem: failed to create
> > task or
> > > > > type
> > > > > antlib:org/apache/tools/ant/antlr:ant-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:
> > > > >         -/usr/share/ant/lib
> > > > >         -/home/ernst/.ant/lib
> > > > >         -a directory added on the command line with the -lib
> > argument
> > > > >
> > > > >
> > > > > I think i did all right:
> > > > >
> > > > > The relevant snippet of my built file is
> > > > >
> > > > > <path id="antlr.classpath">
> > > > >     <pathelement location="${antlrJar}"/>
> > > > >     <pathelement location="${ant-antlrJar}"/> </path>
> > > > >
> > > > >    <target name="genParser" depends="init"
> > > > >            description="Generate parsers. ">
> > > > >
> > > > >      <antlr:ant-antlr3
> > xmlns:antlr="antlib:org/apache/tools/ant/antlr"
> > > > >       target="${parserDirRelana}/CClass.g"
> > > > >       outputdirectory="${parserTargetDirRelana}">
> > > > >         <classpath refid="antlr.classpath"/>
> > > > >      </antlr:ant-antlr3>
> > > > >
> > > > > Here,
> > > > >     <property name="antlrJar"
> > > > > value="${jarDir}/antlr-3.5-complete.jar"/>
> > > > >     <property name="ant-antlrJar"     value="${jarDir}/ant-
> > > > > antlr3.jar"/>
> > > > > point to antlr-3.5-complete.jar and to ant-antlr3.jar which really
> > > > > exist.
> > > > >
> > > > > I use ant -version
> > > > > Apache Ant(TM) version 1.8.2 compiled on October 23 2011
> > > > >
> > > > > The ant-libs look like this:
> > > > > linux-p4vf:/usr/share/java/ant # ll
> > > > > total 164
> > > > > -rw-r--r-- 1 root root  20889 Aug  7 03:15 ant-antlr3.jar
> > > > > -rw-r--r-- 1 root root   3912 Oct 23  2011 ant-commons-logging.jar
> > > > > -rw-r--r-- 1 root root   8225 Oct 23  2011 ant-jdepend.jar
> > > > > -rw-r--r-- 1 root root 102343 Oct 23  2011 ant-junit.jar
> > > > > -rw-r--r-- 1 root root   7547 Oct 23  2011 ant-swing.jar
> > > > > -rw-r--r-- 1 root root  15198 Oct 23  2011 ant-testutil.jar
> > > > >
> > > > > linux-p4vf:/usr/share/ant/lib # ll
> > > > > total 0
> > > > > lrwxrwxrwx 1 root root 29 Aug  7 14:49 ant-antlr3.jar ->
> > > > > ../../java/ant/ant-antlr3.jar lrwxrwxrwx 1 root root 28 Sep  8
> >  2012
> > > > > ant-bootstrap.jar -> ../../java/ant-bootstrap.jar lrwxrwxrwx 1 root
> > > > > root 38 Apr 21 02:05 ant-commons-logging.jar -> ../../java/ant/ant-
> > > > > commons-logging.jar
> > > > > lrwxrwxrwx 1 root root 18 Sep  8  2012 ant.jar ->
> > ../../java/ant.jar
> > > > > lrwxrwxrwx 1 root root 30 Apr 21 02:05 ant-jdepend.jar ->
> > > > > ../../java/ant/ant-jdepend.jar lrwxrwxrwx 1 root root 28 Sep  8
> >  2012
> > > > > ant-junit.jar -> ../../java/ant/ant-junit.jar lrwxrwxrwx 1 root
> > root 27
> > > > > Sep  8  2012 ant-launcher.jar -> ../../java/ant-launcher.jar
> > lrwxrwxrwx
> > > > > 1 root root 28 Apr 21 02:05 ant-swing.jar -> ../../java/ant/ant-
> > > > > swing.jar lrwxrwxrwx 1 root root 31 Apr 21 02:05
> > ant-testutil.jar ->
> > > > > ../../java/ant/ant-testutil.jar
> > > > >
> > > > >
> > > > > I cannot figure out what my problem is.
> > > > >
> > > > > can you help???
> > > > >
> > > > > Greetings, Ernst
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > View this message in context:
> > > > > http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-
> > > > > tp1349074p5714327.html
> > > > > Sent from the Ant - Users mailing list archive at Nabble.com.
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: [hidden email]
> > > > </user/SendEmail.jtp?type=node&node=5714329&i=2> For additional
> > > > > commands, e-mail: [hidden email]
> > > > </user/SendEmail.jtp?type=node&node=5714329&i=3>
> > > >
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [hidden email]
> > > > </user/SendEmail.jtp?type=node&node=5714329&i=4>
> > > > For additional commands, e-mail: [hidden email]
> > > > </user/SendEmail.jtp?type=node&node=5714329&i=5>
> > > >
> > > >
> > > >
> > > >
> > ------------------------------------------------------------------------
> > > > If you reply to this email, your message will be added to the
> > > > discussion below:
> > > >
> > >
> >
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714329.html
> > > >
> > > > To unsubscribe from Problems with ANTLR, click here
> > > > <
> > > >.
> > > > NAML
> > > > <
> > >
> >
> http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714350.html
> > > Sent from the Ant - Users mailing list archive at Nabble.com.
> >
> >
> > ------------------------------------------------------------------------
> > If you reply to this email, your message will be added to the
> > discussion below:
> >
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714351.html
> >
> > To unsubscribe from Problems with ANTLR, click here
> > <
> http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1349074&code=cmVpM25lckBhcmNvci5kZXwxMzQ5MDc0fDExODQzMjAw
> >.
> > NAML
> > <
> http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
>
>
> --
> View this message in context:
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714353.html
> Sent from the Ant - Users mailing list archive at Nabble.com.

Re: AW: AW: Problems with ANTLR

Posted by Matt Benson <gu...@gmail.com>.
See inline for some commentary:


On Mon, Aug 19, 2013 at 2:28 AM, Ernst Reissner <re...@arcor.de> wrote:

> Ok, got one step further:
> now i have:
>
>    <path id="antlr.classpath">
>      <fileset dir="${basedir}/jars">
>        <include name="ant-antlr3.jar"/>
>      </fileset>
>    </path>
>
>
Here you define the task as being named "ant-antlr3":


>    <taskdef name="ant-antlr3"
>         classname="org.apache.tools.ant.antlr.ANTLR3"
>         classpathref="antlr.classpath"/>
>
> which seems to work.
>
> But when i try to use the new task by
>
>
Here you try use a task named "antlr", which is the ANTLR v2 task that has
shipped with Ant prior to the release of ANTLRv3 and before the Ant PMC
began to push for third parties managing their own Ant tasks rather than
Ant trying to provide them all:


>      <antlr target="${parserDirRelana}/CClass.g"
>         outputdirectory="${parserTargetDirRelana}">
>         <classpath refid="antlr.classpath"/>
>      </antlr>
>
> ant complaints
>
> ernst@localhost:~/Software> ant genParser
> Buildfile: /home/ernst/Software/build.xml
>
> init:
>
> genParser:
>
> BUILD FAILED
> /home/ernst/Software/build.xml:377: Unable to determine generated class
>
> Total time: 0 seconds
>
> Who can tell me what this means, and even better: what to do now.
>

Don't try to use ANTLR 2 on a v3 grammar.  ;P

Matt


> Ernst
>
>
> > Hi Jan,
> > i tried
> >>   <taskdef
> >>     name="ant-antlr3"
> >>     classname="org.apache.tools.ant.antlr.ANTLR3"
> >>     />
> > as you suggested (which looks much better than what i did before).
> > Result
> >
> > ernst@localhost:~/Software> ant genParser
> > Buildfile: /home/ernst/Software/build.xml
> >
> > BUILD FAILED
> > /home/ernst/Software/build.xml:360: taskdef class
> > org.apache.tools.ant.antlr.ANTLR3 cannot be found
> >  using the classloader AntClassLoader[]
> >
> > I am very confused about that, because i integrated ant-antlr3.jar the
> > same way
> > suse distribution integrated ant-antlr.jar and other taskdefs.
> >
> > As I wrote before, ant -diagnostics yields
> > ------- Ant diagnostics report -------
> > Apache Ant(TM) version 1.8.2 compiled on January 27 2013
> >
> > -------------------------------------------
> >  Implementation Version
> > -------------------------------------------
> > core tasks     : 1.8.2 in file:/usr/share/java/ant.jar
> >
> > ...
> > -------------------------------------------
> >  ANT_HOME/lib jar listing
> > -------------------------------------------
> > ant.home: /usr/share/ant
> > ant-jmf.jar (6709 bytes)
> > ant-bootstrap.jar (19876 bytes)
> > ant-junit.jar (102344 bytes)
> > ant.jar (1963225 bytes)
> > ant-jsch.jar (40235 bytes)
> > ant-launcher.jar (12433 bytes)
> > ant-javamail.jar (7959 bytes)
> > ant-testutil.jar (15194 bytes)
> > ant-antlr3.jar (20889 bytes)
> > ant-jdepend.jar (8221 bytes)
> > ant-antlr.jar (5750 bytes)
> > ant-swing.jar (7547 bytes)
> >
> > -------------------------------------------
> >  USER_HOME/.ant/lib jar listing
> > -------------------------------------------
> > user.home: /home/ernst
> > No such directory.
> >
> >
> > as you can see, ant-antlr3.jar (20889 bytes) is present.
> > Also:
> > java.class.path :
> >
> /usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:
> > /usr/share/java/antlr.jar:
> >
> /usr/share/java/ant/ant-antlr.jar:/usr/share/java/ant/ant-javamail.jar:/usr/share/java/jdepend.jar:/usr/share/java/ant/ant-jdepend.jar:/usr/share/java/ant/ant-jmf.jar:/usr/share/java/jsch.jar:/usr/share/java/ant/ant-jsch.jar:/usr/share/java/junit.jar:/usr/share/java/ant/ant-junit.jar:/usr/share/java/ant/ant-swing.jar:/usr/share/java/ant/ant-testutil.jar:/usr/lib64/jvm/java/lib/tools.jar:/usr/share/ant/lib/ant-jmf.jar:/usr/share/ant/lib/ant-bootstrap.jar:/usr/share/ant/lib/ant-junit.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-jsch.jar:/usr/share/ant/lib/ant-launcher.jar:/usr/share/ant/lib/ant-javamail.jar:/usr/share/ant/lib/ant-testutil.jar:
> > /usr/share/ant/lib/ant-antlr3.jar:
> >
> /usr/share/ant/lib/ant-jdepend.jar:/usr/share/ant/lib/ant-antlr.jar:/usr/share/ant/lib/ant-swing.jar
> >
> > I am not an expert, but it looks fine for me.
> >
> > What could be the problem?
> >
> > Ernst
> >
> >
> >
> >
> >
> >
> >
>
>
>
>
>
> --
> View this message in context:
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714358.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>

Re: AW: AW: Problems with ANTLR

Posted by Ernst Reissner <re...@arcor.de>.
Hi Jan,
i tried
>   <taskdef
>     name="ant-antlr3"
>     classname="org.apache.tools.ant.antlr.ANTLR3"
>     /> 
as you suggested (which looks much better than what i did before).
Result

ernst@localhost:~/Software> ant genParser
Buildfile: /home/ernst/Software/build.xml

BUILD FAILED
/home/ernst/Software/build.xml:360: taskdef class
org.apache.tools.ant.antlr.ANTLR3 cannot be found
 using the classloader AntClassLoader[]

I am very confused about that, because i integrated ant-antlr3.jar the
same way
suse distribution integrated ant-antlr.jar and other taskdefs.

As I wrote before, ant -diagnostics yields
------- Ant diagnostics report -------
Apache Ant(TM) version 1.8.2 compiled on January 27 2013

-------------------------------------------
 Implementation Version
-------------------------------------------
core tasks     : 1.8.2 in file:/usr/share/java/ant.jar

...
-------------------------------------------
 ANT_HOME/lib jar listing
-------------------------------------------
ant.home: /usr/share/ant
ant-jmf.jar (6709 bytes)
ant-bootstrap.jar (19876 bytes)
ant-junit.jar (102344 bytes)
ant.jar (1963225 bytes)
ant-jsch.jar (40235 bytes)
ant-launcher.jar (12433 bytes)
ant-javamail.jar (7959 bytes)
ant-testutil.jar (15194 bytes)
ant-antlr3.jar (20889 bytes)
ant-jdepend.jar (8221 bytes)
ant-antlr.jar (5750 bytes)
ant-swing.jar (7547 bytes)

-------------------------------------------
 USER_HOME/.ant/lib jar listing
-------------------------------------------
user.home: /home/ernst
No such directory.


as you can see, ant-antlr3.jar (20889 bytes) is present.
Also:
java.class.path :
/usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:
/usr/share/java/antlr.jar:
/usr/share/java/ant/ant-antlr.jar:/usr/share/java/ant/ant-javamail.jar:/usr/share/java/jdepend.jar:/usr/share/java/ant/ant-jdepend.jar:/usr/share/java/ant/ant-jmf.jar:/usr/share/java/jsch.jar:/usr/share/java/ant/ant-jsch.jar:/usr/share/java/junit.jar:/usr/share/java/ant/ant-junit.jar:/usr/share/java/ant/ant-swing.jar:/usr/share/java/ant/ant-testutil.jar:/usr/lib64/jvm/java/lib/tools.jar:/usr/share/ant/lib/ant-jmf.jar:/usr/share/ant/lib/ant-bootstrap.jar:/usr/share/ant/lib/ant-junit.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-jsch.jar:/usr/share/ant/lib/ant-launcher.jar:/usr/share/ant/lib/ant-javamail.jar:/usr/share/ant/lib/ant-testutil.jar:
/usr/share/ant/lib/ant-antlr3.jar:
/usr/share/ant/lib/ant-jdepend.jar:/usr/share/ant/lib/ant-antlr.jar:/usr/share/ant/lib/ant-swing.jar

I am not an expert, but it looks fine for me.

What could be the problem?

Ernst










--
View this message in context: http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714357.html
Sent from the Ant - Users mailing list archive at Nabble.com.

AW: AW: AW: Problems with ANTLR

Posted by "Jan Matèrne (jhm)" <ap...@materne.de>.
One side note: you are using 1.8.2 (Dec 2010) and I suggest updating to
1.9.1 (Jul 2013).
http://ant.apache.org/faq.html#history


> Ok, got one step further:
> now i have:
> 
>    <path id="antlr.classpath">
>      <fileset dir="${basedir}/jars">
>        <include name="ant-antlr3.jar"/>
>      </fileset>
>    </path>
> 
>    <taskdef name="ant-antlr3"
>         classname="org.apache.tools.ant.antlr.ANTLR3"
>         classpathref="antlr.classpath"/>
> 
> which seems to work.

Then you could try the xmlns-way.
http://ant.apache.org/manual/Types/antlib.html#loadFromInside


> BUILD FAILED
> /home/ernst/Software/build.xml:377: Unable to determine generated class

Havent worked with ANTLR, but Google may help:
http://palove.kadeco.sk/itblog/posts/40


Jan


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: AW: AW: Problems with ANTLR

Posted by Ernst Reissner <re...@arcor.de>.
Ok, got one step further:
now i have:

   <path id="antlr.classpath">
     <fileset dir="${basedir}/jars">
       <include name="ant-antlr3.jar"/>
     </fileset>
   </path>

   <taskdef name="ant-antlr3"
        classname="org.apache.tools.ant.antlr.ANTLR3"
        classpathref="antlr.classpath"/>

which seems to work.

But when i try to use the new task by

     <antlr target="${parserDirRelana}/CClass.g"
        outputdirectory="${parserTargetDirRelana}">
        <classpath refid="antlr.classpath"/>
     </antlr>

ant complaints

ernst@localhost:~/Software> ant genParser
Buildfile: /home/ernst/Software/build.xml

init:

genParser:

BUILD FAILED
/home/ernst/Software/build.xml:377: Unable to determine generated class

Total time: 0 seconds

Who can tell me what this means, and even better: what to do now.

Ernst


> Hi Jan,
> i tried
>>   <taskdef
>>     name="ant-antlr3"
>>     classname="org.apache.tools.ant.antlr.ANTLR3"
>>     /> 
> as you suggested (which looks much better than what i did before).
> Result
>
> ernst@localhost:~/Software> ant genParser
> Buildfile: /home/ernst/Software/build.xml
>
> BUILD FAILED
> /home/ernst/Software/build.xml:360: taskdef class
> org.apache.tools.ant.antlr.ANTLR3 cannot be found
>  using the classloader AntClassLoader[]
>
> I am very confused about that, because i integrated ant-antlr3.jar the
> same way
> suse distribution integrated ant-antlr.jar and other taskdefs.
>
> As I wrote before, ant -diagnostics yields
> ------- Ant diagnostics report -------
> Apache Ant(TM) version 1.8.2 compiled on January 27 2013
>
> -------------------------------------------
>  Implementation Version
> -------------------------------------------
> core tasks     : 1.8.2 in file:/usr/share/java/ant.jar
>
> ...
> -------------------------------------------
>  ANT_HOME/lib jar listing
> -------------------------------------------
> ant.home: /usr/share/ant
> ant-jmf.jar (6709 bytes)
> ant-bootstrap.jar (19876 bytes)
> ant-junit.jar (102344 bytes)
> ant.jar (1963225 bytes)
> ant-jsch.jar (40235 bytes)
> ant-launcher.jar (12433 bytes)
> ant-javamail.jar (7959 bytes)
> ant-testutil.jar (15194 bytes)
> ant-antlr3.jar (20889 bytes)
> ant-jdepend.jar (8221 bytes)
> ant-antlr.jar (5750 bytes)
> ant-swing.jar (7547 bytes)
>
> -------------------------------------------
>  USER_HOME/.ant/lib jar listing
> -------------------------------------------
> user.home: /home/ernst
> No such directory.
>
>
> as you can see, ant-antlr3.jar (20889 bytes) is present.
> Also:
> java.class.path :
> /usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:
> /usr/share/java/antlr.jar:
> /usr/share/java/ant/ant-antlr.jar:/usr/share/java/ant/ant-javamail.jar:/usr/share/java/jdepend.jar:/usr/share/java/ant/ant-jdepend.jar:/usr/share/java/ant/ant-jmf.jar:/usr/share/java/jsch.jar:/usr/share/java/ant/ant-jsch.jar:/usr/share/java/junit.jar:/usr/share/java/ant/ant-junit.jar:/usr/share/java/ant/ant-swing.jar:/usr/share/java/ant/ant-testutil.jar:/usr/lib64/jvm/java/lib/tools.jar:/usr/share/ant/lib/ant-jmf.jar:/usr/share/ant/lib/ant-bootstrap.jar:/usr/share/ant/lib/ant-junit.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-jsch.jar:/usr/share/ant/lib/ant-launcher.jar:/usr/share/ant/lib/ant-javamail.jar:/usr/share/ant/lib/ant-testutil.jar:
> /usr/share/ant/lib/ant-antlr3.jar:
> /usr/share/ant/lib/ant-jdepend.jar:/usr/share/ant/lib/ant-antlr.jar:/usr/share/ant/lib/ant-swing.jar
>
> I am not an expert, but it looks fine for me.
>
> What could be the problem?
>
> Ernst
>
>
>
>
>
>
>





--
View this message in context: http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714358.html
Sent from the Ant - Users mailing list archive at Nabble.com.

AW: AW: Problems with ANTLR

Posted by "Jan Matèrne (jhm)" <ap...@materne.de>.
I downloaded the antlr.zip and had a look.
In the ant-antlr3.jar there is the antlib.xml at your location.

If all classes are present you could try using the taskdef from that antlib file:
  <taskdef
    name="ant-antlr3"
    classname="org.apache.tools.ant.antlr.ANTLR3"
    />
and remove your xmlns declarations.


Jan

> -----Ursprüngliche Nachricht-----
> Von: Ernst Reissner [mailto:rei3ner@arcor.de]
> Gesendet: Montag, 19. August 2013 00:44
> An: user@ant.apache.org
> Betreff: Re: AW: Problems with ANTLR
> 
> Hmmmm,
> what I read is
> http://www.antlr.org/wiki/display/ANTLR3/How+to+use+ant+with+ANTLR3
> 
> They suggest a test
> |$ ant -diagnostics
> 
> which should show
> 
> |
> |\------------------------------------------\-|
> |ANT_HOME/lib jar listing|
> |\------------------------------------------\-|
> |ant.home: /usr/share/ant|
> |ant-antlr.jar (||5758| |bytes)|
> |ant-antlr3.jar (||20.889| |bytes) <--------\-
> 
> I must admit, the number of bytes ant shows is not as given but
> essentially, the answer is as expected:
> 
> 
> -------------------------------------------
>  ANT_HOME/lib jar listing
> -------------------------------------------
> ant.home: /usr/share/ant
> ant-jmf.jar (6709 bytes)
> ant-bootstrap.jar (19876 bytes)
> ant-junit.jar (102344 bytes)
> ant.jar (1963225 bytes)
> ant-jsch.jar (40235 bytes)
> ant-launcher.jar (12433 bytes)
> ant-javamail.jar (7959 bytes)
> ant-testutil.jar (15194 bytes)
> ant-antlr3.jar (20889 bytes)
> ant-jdepend.jar (8221 bytes)
> ant-antlr.jar (5750 bytes)
> ant-swing.jar (7547 bytes)
> 
> 
> |
> |Does this mean that the setup is ok?
> 
> Ernst
> 
> |
> > That is not the namespace of the ANTLR task; its jar may not even be
> > set up as an antlib as such. You'll need to consult the documentation
> > for the task to find out the proper way to set it up.
> >
> > Matt
> > On Aug 18, 2013 10:48 AM, "Ernst Reissner" <[hidden email]
> > </user/SendEmail.jtp?type=node&node=5714351&i=0>> wrote:
> >
> > > Hello Jan,
> > > you mean that ant-antlr3.jar is not in place?
> > > I have it in /usr/share/ant/lib
> > > and even if I provide ant -lib /home/ernst/Software/jars, where it
> > is as
> > > well, it does not work.
> > >
> > > Ernst
> > >
> > > > Maybe the antlib is not on the classpath?
> > > > For loading antlibs via namespaces from custom classpath see
> > > > http://ant.apache.org/manual/Types/antlib.html#loadFromInside
> > > >
> > > > Jan
> > > >
> > > > > -----Ursprüngliche Nachricht-----
> > > > > Von: Ernst Reissner [mailto:[hidden email]
> > > > </user/SendEmail.jtp?type=node&node=5714329&i=0>]
> > > > > Gesendet: Mittwoch, 7. August 2013 15:16
> > > > > An: [hidden email]
> > > > > </user/SendEmail.jtp?type=node&node=5714329&i=1>
> > > > > Betreff: RE: Problems with ANTLR
> > > > >
> > > > > Hi all,
> > > > > I have a similar problem receiving
> > > > > /home/ernst/Software/build.xml:352: Problem: failed to create
> > task or
> > > > > type
> > > > > antlib:org/apache/tools/ant/antlr:ant-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:
> > > > >         -/usr/share/ant/lib
> > > > >         -/home/ernst/.ant/lib
> > > > >         -a directory added on the command line with the -lib
> > argument
> > > > >
> > > > >
> > > > > I think i did all right:
> > > > >
> > > > > The relevant snippet of my built file is
> > > > >
> > > > > <path id="antlr.classpath">
> > > > >     <pathelement location="${antlrJar}"/>
> > > > >     <pathelement location="${ant-antlrJar}"/> </path>
> > > > >
> > > > >    <target name="genParser" depends="init"
> > > > >            description="Generate parsers. ">
> > > > >
> > > > >      <antlr:ant-antlr3
> > xmlns:antlr="antlib:org/apache/tools/ant/antlr"
> > > > >       target="${parserDirRelana}/CClass.g"
> > > > >       outputdirectory="${parserTargetDirRelana}">
> > > > >         <classpath refid="antlr.classpath"/>
> > > > >      </antlr:ant-antlr3>
> > > > >
> > > > > Here,
> > > > >     <property name="antlrJar"
> > > > > value="${jarDir}/antlr-3.5-complete.jar"/>
> > > > >     <property name="ant-antlrJar"     value="${jarDir}/ant-
> > > > > antlr3.jar"/>
> > > > > point to antlr-3.5-complete.jar and to ant-antlr3.jar which
> > > > > really exist.
> > > > >
> > > > > I use ant -version
> > > > > Apache Ant(TM) version 1.8.2 compiled on October 23 2011
> > > > >
> > > > > The ant-libs look like this:
> > > > > linux-p4vf:/usr/share/java/ant # ll total 164
> > > > > -rw-r--r-- 1 root root  20889 Aug  7 03:15 ant-antlr3.jar
> > > > > -rw-r--r-- 1 root root   3912 Oct 23  2011 ant-commons-
> logging.jar
> > > > > -rw-r--r-- 1 root root   8225 Oct 23  2011 ant-jdepend.jar
> > > > > -rw-r--r-- 1 root root 102343 Oct 23  2011 ant-junit.jar
> > > > > -rw-r--r-- 1 root root   7547 Oct 23  2011 ant-swing.jar
> > > > > -rw-r--r-- 1 root root  15198 Oct 23  2011 ant-testutil.jar
> > > > >
> > > > > linux-p4vf:/usr/share/ant/lib # ll total 0 lrwxrwxrwx 1 root
> > > > > root 29 Aug  7 14:49 ant-antlr3.jar ->
> > > > > ../../java/ant/ant-antlr3.jar lrwxrwxrwx 1 root root 28 Sep  8
> >  2012
> > > > > ant-bootstrap.jar -> ../../java/ant-bootstrap.jar lrwxrwxrwx 1
> > > > > root root 38 Apr 21 02:05 ant-commons-logging.jar ->
> > > > > ../../java/ant/ant- commons-logging.jar lrwxrwxrwx 1 root root
> > > > > 18 Sep  8  2012 ant.jar ->
> > ../../java/ant.jar
> > > > > lrwxrwxrwx 1 root root 30 Apr 21 02:05 ant-jdepend.jar ->
> > > > > ../../java/ant/ant-jdepend.jar lrwxrwxrwx 1 root root 28 Sep  8
> >  2012
> > > > > ant-junit.jar -> ../../java/ant/ant-junit.jar lrwxrwxrwx 1 root
> > root 27
> > > > > Sep  8  2012 ant-launcher.jar -> ../../java/ant-launcher.jar
> > lrwxrwxrwx
> > > > > 1 root root 28 Apr 21 02:05 ant-swing.jar ->
> ../../java/ant/ant-
> > > > > swing.jar lrwxrwxrwx 1 root root 31 Apr 21 02:05
> > ant-testutil.jar ->
> > > > > ../../java/ant/ant-testutil.jar
> > > > >
> > > > >
> > > > > I cannot figure out what my problem is.
> > > > >
> > > > > can you help???
> > > > >
> > > > > Greetings, Ernst
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > View this message in context:
> > > > > http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-
> > > > > tp1349074p5714327.html
> > > > > Sent from the Ant - Users mailing list archive at Nabble.com.
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: [hidden email]
> > > > </user/SendEmail.jtp?type=node&node=5714329&i=2> For additional
> > > > > commands, e-mail: [hidden email]
> > > > </user/SendEmail.jtp?type=node&node=5714329&i=3>
> > > >
> > > >
> > > >
> > > > -----------------------------------------------------------------
> -
> > > > --- To unsubscribe, e-mail: [hidden email]
> > > > </user/SendEmail.jtp?type=node&node=5714329&i=4>
> > > > For additional commands, e-mail: [hidden email]
> > > > </user/SendEmail.jtp?type=node&node=5714329&i=5>
> > > >
> > > >
> > > >
> > > >
> > ---------------------------------------------------------------------
> -
> > --
> > > > If you reply to this email, your message will be added to the
> > > > discussion below:
> > > >
> > >
> > http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-
> tp1349074p5714329
> > .html
> > > >
> > > > To unsubscribe from Problems with ANTLR, click here  < .
> > > > NAML
> > > > <
> > >
> >
> http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=macro_
> >
> viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespac
> > es.BasicNamespace-nabble.view.web.template.NabbleNamespace-
> nabble.view
> >
> .web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3A
> > email.naml-instant_emails%21nabble%3Aemail.naml-
> send_instant_email%21n
> > abble%3Aemail.naml
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> > http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-
> tp1349074p5714350
> > .html
> > > Sent from the Ant - Users mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> -
> > -- If you reply to this email, your message will be added to the
> > discussion below:
> > http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-
> tp1349074p5714351
> > .html
> >
> > To unsubscribe from Problems with ANTLR, click here
> >
> <http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=unsubs
> cribe_by_code&node=1349074&code=cmVpM25lckBhcmNvci5kZXwxMzQ5MDc0fDExODQ
> zMjAw>.
> > NAML
> >
> <http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=macro
> >
> _viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespa
> > ces.BasicNamespace-nabble.view.web.template.NabbleNamespace-
> nabble.vie
> >
> w.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3
> > Aemail.naml-instant_emails%21nabble%3Aemail.naml-
> send_instant_email%21
> > nabble%3Aemail.naml>
> >
> 
> 
> 
> 
> 
> --
> View this message in context:
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-
> tp1349074p5714353.html
> Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: AW: Problems with ANTLR

Posted by Ernst Reissner <re...@arcor.de>.
Hmmmm,
what I read is
http://www.antlr.org/wiki/display/ANTLR3/How+to+use+ant+with+ANTLR3

They suggest a test
|$ ant -diagnostics

which should show

|
|\------------------------------------------\-|
|ANT_HOME/lib jar listing|
|\------------------------------------------\-|
|ant.home: /usr/share/ant|
|ant-antlr.jar (||5758| |bytes)|
|ant-antlr3.jar (||20.889| |bytes) <--------\-

I must admit, the number of bytes ant shows is not as given
but essentially, the answer is as expected:


-------------------------------------------
 ANT_HOME/lib jar listing
-------------------------------------------
ant.home: /usr/share/ant
ant-jmf.jar (6709 bytes)
ant-bootstrap.jar (19876 bytes)
ant-junit.jar (102344 bytes)
ant.jar (1963225 bytes)
ant-jsch.jar (40235 bytes)
ant-launcher.jar (12433 bytes)
ant-javamail.jar (7959 bytes)
ant-testutil.jar (15194 bytes)
ant-antlr3.jar (20889 bytes)
ant-jdepend.jar (8221 bytes)
ant-antlr.jar (5750 bytes)
ant-swing.jar (7547 bytes)


|
|Does this mean that the setup is ok?

Ernst

|
> That is not the namespace of the ANTLR task; its jar may not even be
> set up
> as an antlib as such. You'll need to consult the documentation for the
> task
> to find out the proper way to set it up.
>
> Matt
> On Aug 18, 2013 10:48 AM, "Ernst Reissner" <[hidden email]
> </user/SendEmail.jtp?type=node&node=5714351&i=0>> wrote:
>
> > Hello Jan,
> > you mean that ant-antlr3.jar is not in place?
> > I have it in /usr/share/ant/lib
> > and even if I provide ant -lib /home/ernst/Software/jars, where it
> is as
> > well, it does not work.
> >
> > Ernst
> >
> > > Maybe the antlib is not on the classpath?
> > > For loading antlibs via namespaces from custom classpath see
> > > http://ant.apache.org/manual/Types/antlib.html#loadFromInside
> > >
> > > Jan
> > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: Ernst Reissner [mailto:[hidden email]
> > > </user/SendEmail.jtp?type=node&node=5714329&i=0>]
> > > > Gesendet: Mittwoch, 7. August 2013 15:16
> > > > An: [hidden email] </user/SendEmail.jtp?type=node&node=5714329&i=1>
> > > > Betreff: RE: Problems with ANTLR
> > > >
> > > > Hi all,
> > > > I have a similar problem receiving
> > > > /home/ernst/Software/build.xml:352: Problem: failed to create
> task or
> > > > type
> > > > antlib:org/apache/tools/ant/antlr:ant-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:
> > > >         -/usr/share/ant/lib
> > > >         -/home/ernst/.ant/lib
> > > >         -a directory added on the command line with the -lib
> argument
> > > >
> > > >
> > > > I think i did all right:
> > > >
> > > > The relevant snippet of my built file is
> > > >
> > > > <path id="antlr.classpath">
> > > >     <pathelement location="${antlrJar}"/>
> > > >     <pathelement location="${ant-antlrJar}"/> </path>
> > > >
> > > >    <target name="genParser" depends="init"
> > > >            description="Generate parsers. ">
> > > >
> > > >      <antlr:ant-antlr3
> xmlns:antlr="antlib:org/apache/tools/ant/antlr"
> > > >       target="${parserDirRelana}/CClass.g"
> > > >       outputdirectory="${parserTargetDirRelana}">
> > > >         <classpath refid="antlr.classpath"/>
> > > >      </antlr:ant-antlr3>
> > > >
> > > > Here,
> > > >     <property name="antlrJar"
> > > > value="${jarDir}/antlr-3.5-complete.jar"/>
> > > >     <property name="ant-antlrJar"     value="${jarDir}/ant-
> > > > antlr3.jar"/>
> > > > point to antlr-3.5-complete.jar and to ant-antlr3.jar which really
> > > > exist.
> > > >
> > > > I use ant -version
> > > > Apache Ant(TM) version 1.8.2 compiled on October 23 2011
> > > >
> > > > The ant-libs look like this:
> > > > linux-p4vf:/usr/share/java/ant # ll
> > > > total 164
> > > > -rw-r--r-- 1 root root  20889 Aug  7 03:15 ant-antlr3.jar
> > > > -rw-r--r-- 1 root root   3912 Oct 23  2011 ant-commons-logging.jar
> > > > -rw-r--r-- 1 root root   8225 Oct 23  2011 ant-jdepend.jar
> > > > -rw-r--r-- 1 root root 102343 Oct 23  2011 ant-junit.jar
> > > > -rw-r--r-- 1 root root   7547 Oct 23  2011 ant-swing.jar
> > > > -rw-r--r-- 1 root root  15198 Oct 23  2011 ant-testutil.jar
> > > >
> > > > linux-p4vf:/usr/share/ant/lib # ll
> > > > total 0
> > > > lrwxrwxrwx 1 root root 29 Aug  7 14:49 ant-antlr3.jar ->
> > > > ../../java/ant/ant-antlr3.jar lrwxrwxrwx 1 root root 28 Sep  8
>  2012
> > > > ant-bootstrap.jar -> ../../java/ant-bootstrap.jar lrwxrwxrwx 1 root
> > > > root 38 Apr 21 02:05 ant-commons-logging.jar -> ../../java/ant/ant-
> > > > commons-logging.jar
> > > > lrwxrwxrwx 1 root root 18 Sep  8  2012 ant.jar ->
> ../../java/ant.jar
> > > > lrwxrwxrwx 1 root root 30 Apr 21 02:05 ant-jdepend.jar ->
> > > > ../../java/ant/ant-jdepend.jar lrwxrwxrwx 1 root root 28 Sep  8
>  2012
> > > > ant-junit.jar -> ../../java/ant/ant-junit.jar lrwxrwxrwx 1 root
> root 27
> > > > Sep  8  2012 ant-launcher.jar -> ../../java/ant-launcher.jar
> lrwxrwxrwx
> > > > 1 root root 28 Apr 21 02:05 ant-swing.jar -> ../../java/ant/ant-
> > > > swing.jar lrwxrwxrwx 1 root root 31 Apr 21 02:05
> ant-testutil.jar ->
> > > > ../../java/ant/ant-testutil.jar
> > > >
> > > >
> > > > I cannot figure out what my problem is.
> > > >
> > > > can you help???
> > > >
> > > > Greetings, Ernst
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > View this message in context:
> > > > http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-
> > > > tp1349074p5714327.html
> > > > Sent from the Ant - Users mailing list archive at Nabble.com.
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [hidden email]
> > > </user/SendEmail.jtp?type=node&node=5714329&i=2> For additional
> > > > commands, e-mail: [hidden email]
> > > </user/SendEmail.jtp?type=node&node=5714329&i=3>
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > </user/SendEmail.jtp?type=node&node=5714329&i=4>
> > > For additional commands, e-mail: [hidden email]
> > > </user/SendEmail.jtp?type=node&node=5714329&i=5>
> > >
> > >
> > >
> > >
> ------------------------------------------------------------------------
> > > If you reply to this email, your message will be added to the
> > > discussion below:
> > >
> >
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714329.html
> > >
> > > To unsubscribe from Problems with ANTLR, click here
> > > <
> > >.
> > > NAML
> > > <
> >
> http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > >
> > >
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714350.html
> > Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the
> discussion below:
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714351.html
>
> To unsubscribe from Problems with ANTLR, click here
> <http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1349074&code=cmVpM25lckBhcmNvci5kZXwxMzQ5MDc0fDExODQzMjAw>.
> NAML
> <http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>





--
View this message in context: http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714353.html
Sent from the Ant - Users mailing list archive at Nabble.com.

Re: AW: Problems with ANTLR

Posted by Matt Benson <gu...@gmail.com>.
That is not the namespace of the ANTLR task; its jar may not even be set up
as an antlib as such. You'll need to consult the documentation for the task
to find out the proper way to set it up.

Matt
On Aug 18, 2013 10:48 AM, "Ernst Reissner" <re...@arcor.de> wrote:

> Hello Jan,
> you mean that ant-antlr3.jar is not in place?
> I have it in /usr/share/ant/lib
> and even if I provide ant -lib /home/ernst/Software/jars, where it is as
> well, it does not work.
>
> Ernst
>
> > Maybe the antlib is not on the classpath?
> > For loading antlibs via namespaces from custom classpath see
> > http://ant.apache.org/manual/Types/antlib.html#loadFromInside
> >
> > Jan
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Ernst Reissner [mailto:[hidden email]
> > </user/SendEmail.jtp?type=node&node=5714329&i=0>]
> > > Gesendet: Mittwoch, 7. August 2013 15:16
> > > An: [hidden email] </user/SendEmail.jtp?type=node&node=5714329&i=1>
> > > Betreff: RE: Problems with ANTLR
> > >
> > > Hi all,
> > > I have a similar problem receiving
> > > /home/ernst/Software/build.xml:352: Problem: failed to create task or
> > > type
> > > antlib:org/apache/tools/ant/antlr:ant-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:
> > >         -/usr/share/ant/lib
> > >         -/home/ernst/.ant/lib
> > >         -a directory added on the command line with the -lib argument
> > >
> > >
> > > I think i did all right:
> > >
> > > The relevant snippet of my built file is
> > >
> > > <path id="antlr.classpath">
> > >     <pathelement location="${antlrJar}"/>
> > >     <pathelement location="${ant-antlrJar}"/> </path>
> > >
> > >    <target name="genParser" depends="init"
> > >            description="Generate parsers. ">
> > >
> > >      <antlr:ant-antlr3 xmlns:antlr="antlib:org/apache/tools/ant/antlr"
> > >       target="${parserDirRelana}/CClass.g"
> > >       outputdirectory="${parserTargetDirRelana}">
> > >         <classpath refid="antlr.classpath"/>
> > >      </antlr:ant-antlr3>
> > >
> > > Here,
> > >     <property name="antlrJar"
> > > value="${jarDir}/antlr-3.5-complete.jar"/>
> > >     <property name="ant-antlrJar"     value="${jarDir}/ant-
> > > antlr3.jar"/>
> > > point to antlr-3.5-complete.jar and to ant-antlr3.jar which really
> > > exist.
> > >
> > > I use ant -version
> > > Apache Ant(TM) version 1.8.2 compiled on October 23 2011
> > >
> > > The ant-libs look like this:
> > > linux-p4vf:/usr/share/java/ant # ll
> > > total 164
> > > -rw-r--r-- 1 root root  20889 Aug  7 03:15 ant-antlr3.jar
> > > -rw-r--r-- 1 root root   3912 Oct 23  2011 ant-commons-logging.jar
> > > -rw-r--r-- 1 root root   8225 Oct 23  2011 ant-jdepend.jar
> > > -rw-r--r-- 1 root root 102343 Oct 23  2011 ant-junit.jar
> > > -rw-r--r-- 1 root root   7547 Oct 23  2011 ant-swing.jar
> > > -rw-r--r-- 1 root root  15198 Oct 23  2011 ant-testutil.jar
> > >
> > > linux-p4vf:/usr/share/ant/lib # ll
> > > total 0
> > > lrwxrwxrwx 1 root root 29 Aug  7 14:49 ant-antlr3.jar ->
> > > ../../java/ant/ant-antlr3.jar lrwxrwxrwx 1 root root 28 Sep  8  2012
> > > ant-bootstrap.jar -> ../../java/ant-bootstrap.jar lrwxrwxrwx 1 root
> > > root 38 Apr 21 02:05 ant-commons-logging.jar -> ../../java/ant/ant-
> > > commons-logging.jar
> > > lrwxrwxrwx 1 root root 18 Sep  8  2012 ant.jar -> ../../java/ant.jar
> > > lrwxrwxrwx 1 root root 30 Apr 21 02:05 ant-jdepend.jar ->
> > > ../../java/ant/ant-jdepend.jar lrwxrwxrwx 1 root root 28 Sep  8  2012
> > > ant-junit.jar -> ../../java/ant/ant-junit.jar lrwxrwxrwx 1 root root 27
> > > Sep  8  2012 ant-launcher.jar -> ../../java/ant-launcher.jar lrwxrwxrwx
> > > 1 root root 28 Apr 21 02:05 ant-swing.jar -> ../../java/ant/ant-
> > > swing.jar lrwxrwxrwx 1 root root 31 Apr 21 02:05 ant-testutil.jar ->
> > > ../../java/ant/ant-testutil.jar
> > >
> > >
> > > I cannot figure out what my problem is.
> > >
> > > can you help???
> > >
> > > Greetings, Ernst
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > > http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-
> > > tp1349074p5714327.html
> > > Sent from the Ant - Users mailing list archive at Nabble.com.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > </user/SendEmail.jtp?type=node&node=5714329&i=2> For additional
> > > commands, e-mail: [hidden email]
> > </user/SendEmail.jtp?type=node&node=5714329&i=3>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > </user/SendEmail.jtp?type=node&node=5714329&i=4>
> > For additional commands, e-mail: [hidden email]
> > </user/SendEmail.jtp?type=node&node=5714329&i=5>
> >
> >
> >
> > ------------------------------------------------------------------------
> > If you reply to this email, your message will be added to the
> > discussion below:
> >
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714329.html
> >
> > To unsubscribe from Problems with ANTLR, click here
> > <
> http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1349074&code=cmVpM25lckBhcmNvci5kZXwxMzQ5MDc0fDExODQzMjAw
> >.
> > NAML
> > <
> http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
>
>
> --
> View this message in context:
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714350.html
> Sent from the Ant - Users mailing list archive at Nabble.com.

Re: AW: Problems with ANTLR

Posted by Ernst Reissner <re...@arcor.de>.
Hello Jan,
you mean that ant-antlr3.jar is not in place?
I have it in /usr/share/ant/lib
and even if I provide ant -lib /home/ernst/Software/jars, where it is as
well, it does not work.

Ernst

> Maybe the antlib is not on the classpath?
> For loading antlibs via namespaces from custom classpath see
> http://ant.apache.org/manual/Types/antlib.html#loadFromInside
>
> Jan
>
> > -----Ursprüngliche Nachricht-----
> > Von: Ernst Reissner [mailto:[hidden email]
> </user/SendEmail.jtp?type=node&node=5714329&i=0>]
> > Gesendet: Mittwoch, 7. August 2013 15:16
> > An: [hidden email] </user/SendEmail.jtp?type=node&node=5714329&i=1>
> > Betreff: RE: Problems with ANTLR
> >
> > Hi all,
> > I have a similar problem receiving
> > /home/ernst/Software/build.xml:352: Problem: failed to create task or
> > type
> > antlib:org/apache/tools/ant/antlr:ant-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:
> >         -/usr/share/ant/lib
> >         -/home/ernst/.ant/lib
> >         -a directory added on the command line with the -lib argument
> >
> >
> > I think i did all right:
> >
> > The relevant snippet of my built file is
> >
> > <path id="antlr.classpath">
> >     <pathelement location="${antlrJar}"/>
> >     <pathelement location="${ant-antlrJar}"/> </path>
> >
> >    <target name="genParser" depends="init"
> >            description="Generate parsers. ">
> >
> >      <antlr:ant-antlr3 xmlns:antlr="antlib:org/apache/tools/ant/antlr"
> >       target="${parserDirRelana}/CClass.g"
> >       outputdirectory="${parserTargetDirRelana}">
> >         <classpath refid="antlr.classpath"/>
> >      </antlr:ant-antlr3>
> >
> > Here,
> >     <property name="antlrJar"
> > value="${jarDir}/antlr-3.5-complete.jar"/>
> >     <property name="ant-antlrJar"     value="${jarDir}/ant-
> > antlr3.jar"/>
> > point to antlr-3.5-complete.jar and to ant-antlr3.jar which really
> > exist.
> >
> > I use ant -version
> > Apache Ant(TM) version 1.8.2 compiled on October 23 2011
> >
> > The ant-libs look like this:
> > linux-p4vf:/usr/share/java/ant # ll
> > total 164
> > -rw-r--r-- 1 root root  20889 Aug  7 03:15 ant-antlr3.jar
> > -rw-r--r-- 1 root root   3912 Oct 23  2011 ant-commons-logging.jar
> > -rw-r--r-- 1 root root   8225 Oct 23  2011 ant-jdepend.jar
> > -rw-r--r-- 1 root root 102343 Oct 23  2011 ant-junit.jar
> > -rw-r--r-- 1 root root   7547 Oct 23  2011 ant-swing.jar
> > -rw-r--r-- 1 root root  15198 Oct 23  2011 ant-testutil.jar
> >
> > linux-p4vf:/usr/share/ant/lib # ll
> > total 0
> > lrwxrwxrwx 1 root root 29 Aug  7 14:49 ant-antlr3.jar ->
> > ../../java/ant/ant-antlr3.jar lrwxrwxrwx 1 root root 28 Sep  8  2012
> > ant-bootstrap.jar -> ../../java/ant-bootstrap.jar lrwxrwxrwx 1 root
> > root 38 Apr 21 02:05 ant-commons-logging.jar -> ../../java/ant/ant-
> > commons-logging.jar
> > lrwxrwxrwx 1 root root 18 Sep  8  2012 ant.jar -> ../../java/ant.jar
> > lrwxrwxrwx 1 root root 30 Apr 21 02:05 ant-jdepend.jar ->
> > ../../java/ant/ant-jdepend.jar lrwxrwxrwx 1 root root 28 Sep  8  2012
> > ant-junit.jar -> ../../java/ant/ant-junit.jar lrwxrwxrwx 1 root root 27
> > Sep  8  2012 ant-launcher.jar -> ../../java/ant-launcher.jar lrwxrwxrwx
> > 1 root root 28 Apr 21 02:05 ant-swing.jar -> ../../java/ant/ant-
> > swing.jar lrwxrwxrwx 1 root root 31 Apr 21 02:05 ant-testutil.jar ->
> > ../../java/ant/ant-testutil.jar
> >
> >
> > I cannot figure out what my problem is.
> >
> > can you help???
> >
> > Greetings, Ernst
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> > http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-
> > tp1349074p5714327.html
> > Sent from the Ant - Users mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> </user/SendEmail.jtp?type=node&node=5714329&i=2> For additional
> > commands, e-mail: [hidden email]
> </user/SendEmail.jtp?type=node&node=5714329&i=3>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> </user/SendEmail.jtp?type=node&node=5714329&i=4>
> For additional commands, e-mail: [hidden email]
> </user/SendEmail.jtp?type=node&node=5714329&i=5>
>
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the
> discussion below:
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714329.html
>
> To unsubscribe from Problems with ANTLR, click here
> <http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1349074&code=cmVpM25lckBhcmNvci5kZXwxMzQ5MDc0fDExODQzMjAw>.
> NAML
> <http://ant.1045680.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>





--
View this message in context: http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714350.html
Sent from the Ant - Users mailing list archive at Nabble.com.

AW: Problems with ANTLR

Posted by "Jan Matèrne (jhm)" <ap...@materne.de>.
Maybe the antlib is not on the classpath?
For loading antlibs via namespaces from custom classpath see
http://ant.apache.org/manual/Types/antlib.html#loadFromInside

Jan

> -----Ursprüngliche Nachricht-----
> Von: Ernst Reissner [mailto:rei3ner@arcor.de]
> Gesendet: Mittwoch, 7. August 2013 15:16
> An: user@ant.apache.org
> Betreff: RE: Problems with ANTLR
> 
> Hi all,
> I have a similar problem receiving
> /home/ernst/Software/build.xml:352: Problem: failed to create task or
> type
> antlib:org/apache/tools/ant/antlr:ant-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:
>         -/usr/share/ant/lib
>         -/home/ernst/.ant/lib
>         -a directory added on the command line with the -lib argument
> 
> 
> I think i did all right:
> 
> The relevant snippet of my built file is
> 
> <path id="antlr.classpath">
>     <pathelement location="${antlrJar}"/>
>     <pathelement location="${ant-antlrJar}"/> </path>
> 
>    <target name="genParser" depends="init"
>            description="Generate parsers. ">
> 
>      <antlr:ant-antlr3 xmlns:antlr="antlib:org/apache/tools/ant/antlr"
> 		       target="${parserDirRelana}/CClass.g"
> 		       outputdirectory="${parserTargetDirRelana}">
>         <classpath refid="antlr.classpath"/>
>      </antlr:ant-antlr3>
> 
> Here,
>     <property name="antlrJar"
> value="${jarDir}/antlr-3.5-complete.jar"/>
>     <property name="ant-antlrJar"     value="${jarDir}/ant-
> antlr3.jar"/>
> point to antlr-3.5-complete.jar and to ant-antlr3.jar which really
> exist.
> 
> I use ant -version
> Apache Ant(TM) version 1.8.2 compiled on October 23 2011
> 
> The ant-libs look like this:
> linux-p4vf:/usr/share/java/ant # ll
> total 164
> -rw-r--r-- 1 root root  20889 Aug  7 03:15 ant-antlr3.jar
> -rw-r--r-- 1 root root   3912 Oct 23  2011 ant-commons-logging.jar
> -rw-r--r-- 1 root root   8225 Oct 23  2011 ant-jdepend.jar
> -rw-r--r-- 1 root root 102343 Oct 23  2011 ant-junit.jar
> -rw-r--r-- 1 root root   7547 Oct 23  2011 ant-swing.jar
> -rw-r--r-- 1 root root  15198 Oct 23  2011 ant-testutil.jar
> 
> linux-p4vf:/usr/share/ant/lib # ll
> total 0
> lrwxrwxrwx 1 root root 29 Aug  7 14:49 ant-antlr3.jar ->
> ../../java/ant/ant-antlr3.jar lrwxrwxrwx 1 root root 28 Sep  8  2012
> ant-bootstrap.jar -> ../../java/ant-bootstrap.jar lrwxrwxrwx 1 root
> root 38 Apr 21 02:05 ant-commons-logging.jar -> ../../java/ant/ant-
> commons-logging.jar
> lrwxrwxrwx 1 root root 18 Sep  8  2012 ant.jar -> ../../java/ant.jar
> lrwxrwxrwx 1 root root 30 Apr 21 02:05 ant-jdepend.jar ->
> ../../java/ant/ant-jdepend.jar lrwxrwxrwx 1 root root 28 Sep  8  2012
> ant-junit.jar -> ../../java/ant/ant-junit.jar lrwxrwxrwx 1 root root 27
> Sep  8  2012 ant-launcher.jar -> ../../java/ant-launcher.jar lrwxrwxrwx
> 1 root root 28 Apr 21 02:05 ant-swing.jar -> ../../java/ant/ant-
> swing.jar lrwxrwxrwx 1 root root 31 Apr 21 02:05 ant-testutil.jar ->
> ../../java/ant/ant-testutil.jar
> 
> 
> I cannot figure out what my problem is.
> 
> can you help???
> 
> Greetings, Ernst
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> View this message in context:
> http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-
> tp1349074p5714327.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional
> commands, e-mail: user-help@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Problems with ANTLR

Posted by Ernst Reissner <re...@arcor.de>.
Hi all, 
I have a similar problem receiving 
/home/ernst/Software/build.xml:352: Problem: failed to create task or type
antlib:org/apache/tools/ant/antlr:ant-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:
        -/usr/share/ant/lib
        -/home/ernst/.ant/lib
        -a directory added on the command line with the -lib argument


I think i did all right: 

The relevant snippet of my built file is 

<path id="antlr.classpath">
    <pathelement location="${antlrJar}"/>
    <pathelement location="${ant-antlrJar}"/>
</path>

   <target name="genParser" depends="init" 
           description="Generate parsers. ">

     <antlr:ant-antlr3 xmlns:antlr="antlib:org/apache/tools/ant/antlr"
		       target="${parserDirRelana}/CClass.g"
		       outputdirectory="${parserTargetDirRelana}"> 
        <classpath refid="antlr.classpath"/>
     </antlr:ant-antlr3>

Here, 
    <property name="antlrJar"        
value="${jarDir}/antlr-3.5-complete.jar"/>
    <property name="ant-antlrJar"     value="${jarDir}/ant-antlr3.jar"/>
point to antlr-3.5-complete.jar and to ant-antlr3.jar which really exist. 

I use ant -version
Apache Ant(TM) version 1.8.2 compiled on October 23 2011

The ant-libs look like this: 
linux-p4vf:/usr/share/java/ant # ll
total 164
-rw-r--r-- 1 root root  20889 Aug  7 03:15 ant-antlr3.jar
-rw-r--r-- 1 root root   3912 Oct 23  2011 ant-commons-logging.jar
-rw-r--r-- 1 root root   8225 Oct 23  2011 ant-jdepend.jar
-rw-r--r-- 1 root root 102343 Oct 23  2011 ant-junit.jar
-rw-r--r-- 1 root root   7547 Oct 23  2011 ant-swing.jar
-rw-r--r-- 1 root root  15198 Oct 23  2011 ant-testutil.jar

linux-p4vf:/usr/share/ant/lib # ll
total 0
lrwxrwxrwx 1 root root 29 Aug  7 14:49 ant-antlr3.jar ->
../../java/ant/ant-antlr3.jar
lrwxrwxrwx 1 root root 28 Sep  8  2012 ant-bootstrap.jar ->
../../java/ant-bootstrap.jar
lrwxrwxrwx 1 root root 38 Apr 21 02:05 ant-commons-logging.jar ->
../../java/ant/ant-commons-logging.jar
lrwxrwxrwx 1 root root 18 Sep  8  2012 ant.jar -> ../../java/ant.jar
lrwxrwxrwx 1 root root 30 Apr 21 02:05 ant-jdepend.jar ->
../../java/ant/ant-jdepend.jar
lrwxrwxrwx 1 root root 28 Sep  8  2012 ant-junit.jar ->
../../java/ant/ant-junit.jar
lrwxrwxrwx 1 root root 27 Sep  8  2012 ant-launcher.jar ->
../../java/ant-launcher.jar
lrwxrwxrwx 1 root root 28 Apr 21 02:05 ant-swing.jar ->
../../java/ant/ant-swing.jar
lrwxrwxrwx 1 root root 31 Apr 21 02:05 ant-testutil.jar ->
../../java/ant/ant-testutil.jar


I cannot figure out what my problem is. 

can you help???

Greetings, Ernst 









--
View this message in context: http://ant.1045680.n5.nabble.com/Problems-with-ANTLR-tp1349074p5714327.html
Sent from the Ant - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Problems with ANTLR

Posted by Martin Gainty <mg...@hotmail.com>.
Good Afternoon
 
please download antlr3-task.zip source from http://www.antlr.org/share/1169924912745/antlr3-task.zip 
unzip/uncompress to temp folder
in org.apache.tools.ant.antlr.ANTLR3.java
change
    public ANTLR3() {
        commandline.setVm(JavaEnvUtils.getJreExecutable("java"));
        //commandline.setClassname("org.antlr.Tool");  /* there is no org.antlr.Tool class */
        commandline.setClassname("antlr.Tool");
        fileUtils = FileUtils.getFileUtils();
    }
recompile

place org.apache.tools.ant.antlr.ANTLR3 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"?>

<antlib>

  <taskdef

    name="ant-antlr3"

    classname="org.apache.tools.ant.antlr.ANTLR3"

    />

</antlib>

 

and snippet from build.xml test test harness (from antlr3-task/simplecTreeParser.tp):
    <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="grammar.name" default="grammar"/>
       <attribute name="package" default="${package}"/>
       <sequential>
              <echo message="antlr ${grammar}/@{grammar.name}" />
              <antlr:ant-antlr3 xmlns:antlr="antlib:org/apache/tools/ant/antlr" 
                  target="${grammar}/@{grammar.name}" 
                  outputdirectory="${src}/@{package}"
                  libdirectory="${src}/@{package}"
                  multithreaded="${multithreaded}"
                  report="${report}"
                  depend="${depend}"
                  profile="${profile}">
              </antlr:ant-antlr3>
        </sequential>
    </macrodef>
    
    <target name="SimpleC" depends="init" >
       <antlr3 grammar.name="SimpleC.g" />
    </target>

 

ant -debug SimpleC 

will explain the workings

 

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

 

Vielen Danke,
Martin  
______________________________________________ 
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: nlaparo@yahoo.com
> To: user@ant.apache.org
> Subject: RE: Problems with ANTLR
> 
> 
> 1) I downloaded the antlr3-task.zip 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.gen.java.dir}/${target.antlr.parser.dir}">
> <classpath refid="compile.classpath"/>
> </antlr:antlr3>
> 
> 4) When I build I get:
> BUILD FAILED
> 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: 
> > http://antlr.org/share/1169924912745/antlr3-task.zip
> > 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: http://old.nabble.com/Problems-with-ANTLR-tp23287211p28835592.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
 		 	   		  
_________________________________________________________________
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4

RE: Problems with ANTLR

Posted by # <ju...@web.de>.

NancyL wrote:
> 
> 1) I downloaded the antlr3-task.zip 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.gen.java.dir}/${target.antlr.parser.dir}">
> 				<classpath refid="compile.classpath"/>
> 		</antlr:antlr3>
> 
> 4) When I build I get:
> BUILD FAILED
> 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: 
>> http://antlr.org/share/1169924912745/antlr3-task.zip
>> 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
>> 
> 
> 

Please, change the reference from antlr:antl3 to antlr:antlr-antlr3 as
described below:

		<antlr:ant-antlr3 xmlns:antlr="antlib:org/apache/tools/ant/antlr"
		    target="${src.etc.dir}/parser/catos.g"
		    outputdirectory="${target.gen.java.dir}/${target.antlr.parser.dir}">
				<classpath refid="compile.classpath"/>
		</antlr:ant-antlr3>

I have to fix the documentation. Sorry!

Kind regards, Jürgen
-- 
View this message in context: http://old.nabble.com/Problems-with-ANTLR-tp23287211p28849449.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Problems with ANTLR

Posted by NancyL <nl...@yahoo.com>.
1) I downloaded the antlr3-task.zip 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.gen.java.dir}/${target.antlr.parser.dir}">
				<classpath refid="compile.classpath"/>
		</antlr:antlr3>

4) When I build I get:
BUILD FAILED
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: 
> http://antlr.org/share/1169924912745/antlr3-task.zip
> 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: http://old.nabble.com/Problems-with-ANTLR-tp23287211p28835592.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Problems with ANTLR

Posted by # <ju...@web.de>.
Hi,

the ant-lib for the antlr3 task can be downloaded from here: 
http://antlr.org/share/1169924912745/antlr3-task.zip
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


Felix Dorner-2 wrote:
> 
>  > > Reason: /scratch2/nemer/test/build.xml:47: Problem: failed
>> to create
>> > task or type antlr
>> > Cause: the class
>> org.apache.tools.ant.taskdefs.optional.ANTLR was not
>> > found.
> 
> Did you even look at this:
> http://ant.apache.org/manual/OptionalTasks/antlr.html ?
> 
> Note that this refers to Antlr2.7. Antlr recently upgraded to version 3,
> so if your grammer's version 3, this won't work.
> 
> Felix
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problems-with-ANTLR-tp23287211p23451031.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Problems with ANTLR

Posted by Felix Dorner <FD...@zed.com>.
 > > Reason: /scratch2/nemer/test/build.xml:47: Problem: failed
> to create
> > task or type antlr
> > Cause: the class
> org.apache.tools.ant.taskdefs.optional.ANTLR was not
> > found.

Did you even look at this: http://ant.apache.org/manual/OptionalTasks/antlr.html ?

Note that this refers to Antlr2.7. Antlr recently upgraded to version 3, so if your grammer's version 3, this won't work.

Felix

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Problems with ANTLR

Posted by David Nemer <da...@gmail.com>.
Anyone???

--
David Nemer
Sent from Kaiserslautern, RP, Germany

On Wed, Apr 29, 2009 at 12:18 AM, David Nemer <da...@gmail.com> wrote:

> Hey Everyone,
>
> I'm trying to build my project with ANT, and I'm getting the following
> error:
>
> Reason: /scratch2/nemer/test/build.xml:47: Problem: failed to create task
> or type antlr
> Cause: the class org.apache.tools.ant.taskdefs.optional.ANTLR was not
> found.
>         This looks like one of Ant's optional components.
> Action: Check that the appropriate optional JAR exists in
>         -ANT_HOME/lib
>         -the IDE Ant configuration dialogs
>
> Do not panic, this is a common problem.
> The commonest cause is a missing JAR.
>
> This is not a bug; it is a configuration problem
>
> I tried to download the ant-nodeps-1.7.1.jar to the ANT_HOME/lib, but still
> doesn't work!
>
> Can anyone help me here!! I'm stuck and can't seem to find the solution!
>
> Cheers,
> --
> David Nemer
> Sent from Kaiserslautern, RP, Germany