Recent

Author Topic: data2pas 0.4.0 released  (Read 14657 times)

yamer

  • Jr. Member
  • **
  • Posts: 87
data2pas 0.4.0 released
« on: May 23, 2014, 05:49:19 pm »
data2pas generates a pascal include file from a text file description. This is a tool similar to data2inc but using a more "pascalish" syntax.
   
This version adds support for output directory and gives more control over presentation of generated code.

http://yann.merignac.free.fr/data2pas.html

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12645
  • FPC developer.
Re: data2pas 0.4.0 released
« Reply #1 on: May 23, 2014, 08:40:23 pm »
The site doesn't do a real good job explaining what exactly it is capable of doing, and how it improves on data2inc.

... which I wrote in like, euh, 2000 :-)

yamer

  • Jr. Member
  • **
  • Posts: 87
Re: data2pas 0.4.0 released
« Reply #2 on: May 24, 2014, 10:07:19 am »
The site doesn't do a real good job explaining what exactly it is capable of doing, and how it improves on data2inc.
Well, may be I should write some better description and a tutorial.

I don't tell data2pas is better than data2inc. It's only a different way to do the same thing. In some cases data2inc is even better. It can convert a binary file to inc file directly from the command line. With data2pas this is impossible. data2pas always takes a data description file in entry and outputs one or more pascal file.  The data description file is a text file written in a pascal like language (data2inc syntax is less readable). In a  data description file you can import binary files, text files and write directly strings that extends on many lines using a heredoc syntax. Each data can be imported as a string, an array of byte or an array of char. Futhermore arrays can be written in a zipped form.

... which I wrote in like, euh, 2000 :-)
It seems even older ;-)

Code: [Select]
[~]$ data2inc -V
Data2Inc 1.00 (C) 1999 Peter Vreman and Marco van de Voort

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12645
  • FPC developer.
Re: data2pas 0.4.0 released
« Reply #3 on: May 24, 2014, 03:01:19 pm »
I don't tell data2pas is better than data2inc.

I wouldn't be offended if you did. Data2inc is not something I really maintained and expanded over the years. Originally it was just made to consolidate a couple of programs that created binary dumps of records for unit testing when implementing some fileformat.  Another application was more string oriented, writing usage messages in one array of char (string literals were limited to 255 chars), from that the binary to string functionality grew later (mostly by Peter iirc), that became the reason to put it in the tree.

The syntax is the DATA statement of old interpreted Basics.

Regarding data2pas, I just noticed that the site is a bit light on details.

Quote
It seems even older ;-)

Code: [Select]
[~]$ data2inc -V
Data2Inc 1.00 (C) 1999 Peter Vreman and Marco van de Voort

Yeah. 1999 might be even only the year it was cleaned up and put in the tree, maybe it is even older conceptually.

yamer

  • Jr. Member
  • **
  • Posts: 87
Re: data2pas 0.4.0 released
« Reply #4 on: May 24, 2014, 04:22:19 pm »
Regarding data2pas, I just noticed that the site is a bit light on details.

I'll try to improve it in a near future.

It's true that documentation is actually a bit low on my website. This is largely because my English is not very good and writing documentation takes me longer than I would like.

yamer

  • Jr. Member
  • **
  • Posts: 87
Re: data2pas 0.4.0 released
« Reply #5 on: May 27, 2014, 10:34:46 am »
I have improved the documention of data2pas. I hope it is slightly better than the previous one and most importantly it is understandable.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: data2pas 0.4.0 released
« Reply #6 on: May 27, 2014, 05:29:58 pm »
now that's A HELL LOT better ;)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12645
  • FPC developer.
Re: data2pas 0.4.0 released
« Reply #7 on: May 27, 2014, 07:21:02 pm »
It's much clearer now what the program is about yes.

LuizAmérico

  • Sr. Member
  • ****
  • Posts: 457
Re: data2pas 0.4.0 released
« Reply #8 on: May 27, 2014, 09:27:15 pm »
Is there a code repository?

I plan to add a feature and it a repository would make easier to send a patch

yamer

  • Jr. Member
  • **
  • Posts: 87
Re: data2pas 0.4.0 released
« Reply #9 on: May 28, 2014, 08:42:00 am »
Thanks for your comments guys.

Is there a code repository?

At this time there is no publicly available repository. May be I'll create a public one in the future but it's not so simple. In its "units" directory data2pas contains units that come from 6 other projects (also available on my website). So if I open a repository for data2pas I have also to open and manage 6 other repositories. For now I have the impression that it just make things more complicated for me. This is not a definitive opinion, but for now I am not convinced of the necessity of a public repository.

I plan to add a feature and it a repository would make easier to send a patch

Patches are very welcome in some conditions :

  • keep the same programming style
  • respect the pascal style of the data description language if it must be changed

Could you tell me wich feature you are planning to add ?

yamer

  • Jr. Member
  • **
  • Posts: 87
Re: data2pas 0.4.0 released
« Reply #10 on: May 28, 2014, 08:50:22 am »
I forgot to say that if you want to send me a patch you can do it by email. My mail address is visible on my site.

LuizAmérico

  • Sr. Member
  • ****
  • Posts: 457
Re: data2pas 0.4.0 released
« Reply #11 on: May 28, 2014, 07:18:49 pm »
I'd like to implement an option to skip the conversion if the output file is newer than the files used in the description.
But after looking how is implemented seems not feasible. It would be necessary a list of the files to be written before the conversion takes place.

Thanks anyway

yamer

  • Jr. Member
  • **
  • Posts: 87
Re: data2pas 0.4.0 released
« Reply #12 on: May 29, 2014, 12:27:07 am »
If I understand well, this seems to be the kind of work for which make gives good results.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: data2pas 0.4.0 released
« Reply #13 on: May 29, 2014, 01:06:28 pm »
At this time there is no publicly available repository. May be I'll create a public one in the future but it's not so simple. In its "units" directory data2pas contains units that come from 6 other projects (also available on my website). So if I open a repository for data2pas I have also to open and manage 6 other repositories. For now I have the impression that it just make things more complicated for me. This is not a definitive opinion, but for now I am not convinced of the necessity of a public repository.
Perhaps you could use symlinks so you're always sure updates are filtered through? Combine that with git or mercurial it might work.

Just a suggestion - to be honest, I also have a couple of repos with shared code and I basically just copy units around...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

yamer

  • Jr. Member
  • **
  • Posts: 87
Re: data2pas 0.4.0 released
« Reply #14 on: May 29, 2014, 05:12:06 pm »
Just a suggestion - to be honest, I also have a couple of repos with shared code and I basically just copy units around...

Previously I manualy copied files to synchronize my various projects. Tedious and error-prone. I ended up creating a ruby script for that. It's not a very well finished tool but it works. If you or anyone else is interested I could publish it (after light cleaning) but it has no documentation, is only tested on linux and has not a very good name.

 

TinyPortal © 2005-2018