Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Specific parser with Ant

Reply
Thread Tools

Specific parser with Ant

 
 
ownowl
Guest
Posts: n/a
 
      01-03-2008
Hello

I use eclipse and ant for build an application (EAR). So I'd like to
generate a readme file constituted by comments of several sources code.

Ideally I'd like to put two spéchfic flags in source file and keep only
the text between those flags. I looked around FilterChain and
FilterReader ant tasks, but I can not find a way who work well.

Some idea ?
thanks

Olivier
 
Reply With Quote
 
 
 
 
Arne Vajhøj
Guest
Posts: n/a
 
      01-03-2008
ownowl wrote:
> I use eclipse and ant for build an application (EAR). So I'd like to
> generate a readme file constituted by comments of several sources code.
>
> Ideally I'd like to put two spéchfic flags in source file and keep only
> the text between those flags. I looked around FilterChain and
> FilterReader ant tasks, but I can not find a way who work well.


You can write your own task. It is surprisingly easy.

Arne
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      01-04-2008
On Thu, 03 Jan 2008 15:25:29 +0100, ownowl <(E-Mail Removed)>
wrote, quoted or indirectly quoted someone who said :

>Ideally I'd like to put two spéchfic flags in source file and keep only
>the text between those flags. I looked around FilterChain and
>FilterReader ant tasks, but I can not find a way who work well.
>
>Some idea ?


You can always write some little Java program that takes command line
parms to do what you want.

Just read the source into RAM. See
http://mindprod.com/jgloss/products.html#HUNKIO

Use indexOf to find your two flags, and substring to suck up the
juice.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      01-04-2008
On Fri, 04 Jan 2008 02:33:44 GMT, Roedy Green
<(E-Mail Removed)> wrote, quoted or indirectly quoted
someone who said :

>You can always write some little Java program that takes command line
>parms to do what you want.


you can hook it up as a stand alone utility. See
http://mindprod.com/jgloss/ant.html for some examples, or you can hook
it in via the Java API to integrate it even better.

All you need is a week to read all the JavaDoc for how to do it.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
ownowl
Guest
Posts: n/a
 
      01-04-2008
Roedy Green a écrit :
> On Thu, 03 Jan 2008 15:25:29 +0100, ownowl <(E-Mail Removed)>
> wrote, quoted or indirectly quoted someone who said :
>
>> Ideally I'd like to put two spéchfic flags in source file and keep only
>> the text between those flags. I looked around FilterChain and
>> FilterReader ant tasks, but I can not find a way who work well.
>>
>> Some idea ?

>
> You can always write some little Java program that takes command line
> parms to do what you want.
>
> Just read the source into RAM. See
> http://mindprod.com/jgloss/products.html#HUNKIO
>
> Use indexOf to find your two flags, and substring to suck up the
> juice.


thank to you and Arne for your answer

I knew the way of customized java ant task (I done it in the past), but
for this case, for the moment, I prefer use native ant task. So I
finally use a workaround with filterchain and headfilter.

Olivier
 
Reply With Quote
 
Robert Klemme
Guest
Posts: n/a
 
      01-04-2008
On 03.01.2008 15:25, ownowl wrote:
> I use eclipse and ant for build an application (EAR). So I'd like to
> generate a readme file constituted by comments of several sources code.
>
> Ideally I'd like to put two spéchfic flags in source file and keep only
> the text between those flags. I looked around FilterChain and
> FilterReader ant tasks, but I can not find a way who work well.


You could use a combination of "find" and "sed" to accomplish this.
Maybe you do not even need "find" from an "ant" script.

Kind regards

robert

 
Reply With Quote
 
ownowl
Guest
Posts: n/a
 
      01-04-2008
Robert Klemme a écrit :
> On 03.01.2008 15:25, ownowl wrote:
>> I use eclipse and ant for build an application (EAR). So I'd like to
>> generate a readme file constituted by comments of several sources code.
>>
>> Ideally I'd like to put two spéchfic flags in source file and keep
>> only the text between those flags. I looked around FilterChain and
>> FilterReader ant tasks, but I can not find a way who work well.

>
> You could use a combination of "find" and "sed" to accomplish this.
> Maybe you do not even need "find" from an "ant" script.
>
> Kind regards
>
> robert
>


thanks Robert

I could use those commands, but they are unix commands (isn't it ?), and
I must be windows compliant. And primarily, this readme generator is a
part of several others ant tasks

Olivier
 
Reply With Quote
 
Robert Klemme
Guest
Posts: n/a
 
      01-04-2008
On 04.01.2008 14:38, ownowl wrote:
> Robert Klemme a écrit :
>> On 03.01.2008 15:25, ownowl wrote:
>>> I use eclipse and ant for build an application (EAR). So I'd like to
>>> generate a readme file constituted by comments of several sources code.
>>>
>>> Ideally I'd like to put two spéchfic flags in source file and keep
>>> only the text between those flags. I looked around FilterChain and
>>> FilterReader ant tasks, but I can not find a way who work well.

>>
>> You could use a combination of "find" and "sed" to accomplish this.
>> Maybe you do not even need "find" from an "ant" script.

>
> thanks Robert
>
> I could use those commands, but they are unix commands (isn't it ?), and
> I must be windows compliant. And primarily, this readme generator is a
> part of several others ant tasks


Well, there's cygwin and there's "Windows Services for Unix". But
maybe you find a sed implementation in Java. Of course, writing this in
Java should not be too difficult either.

Kind regards

robert

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run ant script from ant script? lionelv@gmail.com Java 6 07-26-2007 02:12 AM
error runing ant in eclipse ant view yihucd@gmail.com Java 1 03-07-2006 08:39 PM
trouble with Hibernate and Ant (probably just Ant) john martin Java 2 04-07-2005 09:27 PM
Compile problem using SAX Parser and ant tool Mladen Adamovic Java 0 01-14-2005 06:19 PM
wondering how i can launch tomcat from ant without ant hanging... Chris Bedford Java 6 12-23-2004 12:41 AM



Advertisments