It is currently Wed Oct 18, 2017 1:21 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: PBHGEN - PureBasic Header Generator
PostPosted: Mon Feb 11, 2013 9:51 pm 
Offline
User
User
User avatar

Joined: Thu Jul 12, 2012 7:00 pm
Posts: 78
Location: Germany
Description:
Will read a PureBasic source file (*.pb) and generate a header out of it (*.pbi).
This program also works with SpiderBasic.

Image

Usage:
    Under "Tools" in the PureBasic IDE add a new tool called "PBHGEN".
    At Commandline select your copy of PBHGEN.exe
    At Arguments type %FILE.
    At Event to trigger the tool select Sourcecode Saved.

    Ensure you include your headers in the Source using:
    IncludeFile #PB_Compiler_File + "i" ;- PBHGEN

    To use automatic header generation in modules also use:
    Module MyModule
    IncludeFile #PB_Compiler_File + "i" ;- PBHGEN
    EndModule
At the moment if you wish to have a procedure with structured List/Array/Map arguments, you will have to put that procedure above the code where you call it from.
This does not apply when using basic types and is a limitation of PureBasic.

Download:
PureBasic V5.42 http://00laboratories.com/download_file/6

Mirror:
PureBasic V5.42 https://dl.dropbox.com/u/19541374/00laboratories/downloads/PBHGEN/PBHGEN.7z

Source Code:
https://bitbucket.org/Henry00/pbhgen

Motivation:
PureBasic is a great language but I was always annoyed about the fact I could never choose where I would locate my Procedures, if I wished to use a Procedure somewhere I would have to move it above of the Procedure that was going to call it, the Declare statement allows to tell the compiler specific Procedures are going to exist and to find them but writing them over and over, fixing arguments is not only a pain but makes your source look like a mess. That's the reason I required an automatic header generator for PureBasic. I hope you too will enjoy the new freedom thanks to this little tool!

Official Page: http://00laboratories.com/downloads/programming/purebasic-header-generator

_________________
PBHGEN - PureBasic Header Generator - PureBasic 5.42

Image_Image


Last edited by Henry00 on Sun Apr 10, 2016 4:25 pm, edited 18 times in total.

Top
 Profile  
Reply with quote  
 Post subject: BugFixes: PBHGEN - PureBasic Header Generator
PostPosted: Thu Mar 21, 2013 6:42 pm 
Offline
User
User
User avatar

Joined: Thu Jul 12, 2012 7:00 pm
Posts: 78
Location: Germany
Version 0.2:
Fixed issue with Structure Pointers in Procedure Parameters, transforms to Pointers now.

Version 0.3:
Fixed issue with Structured List/Array/Map in Procedure Parameters.

Version 0.4:
Fixed issue where a *pointer would cause further Procedure Parameters to lose their types.

_________________
PBHGEN - PureBasic Header Generator - PureBasic 5.42

Image_Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PBHGEN - PureBasic Header Generator
PostPosted: Wed Mar 27, 2013 8:12 pm 
Offline
User
User
User avatar

Joined: Thu Jul 12, 2012 7:00 pm
Posts: 78
Location: Germany
Version 0.5:
Fixed issue where a *pointer.structure had no default parameter.
Fixed issue with a string as custom parameter, it was not escaped.

_________________
PBHGEN - PureBasic Header Generator - PureBasic 5.42

Image_Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PBHGEN - PureBasic Header Generator
PostPosted: Wed Jul 10, 2013 12:59 pm 
Offline
User
User
User avatar

Joined: Thu Jul 12, 2012 7:00 pm
Posts: 78
Location: Germany
Version 0.6:
Fixed issue where array arguments would still have impossible structures.
Added support for structured List/Array/Map arguments with some conditions.
Added support for all basic types when used with List/Array/Map arguments.

_________________
PBHGEN - PureBasic Header Generator - PureBasic 5.42

Image_Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PBHGEN - PureBasic Header Generator
PostPosted: Sat Jul 20, 2013 8:44 pm 
Offline
User
User
User avatar

Joined: Thu Jul 12, 2012 7:00 pm
Posts: 78
Location: Germany
Version 0.7:
Stops when encountering the statement seperator ":" or comment ";" operators.

_________________
PBHGEN - PureBasic Header Generator - PureBasic 5.42

Image_Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PBHGEN - PureBasic Header Generator
PostPosted: Sun Sep 15, 2013 5:44 pm 
Offline
User
User
User avatar

Joined: Thu Jul 12, 2012 7:00 pm
Posts: 78
Location: Germany
Version 0.8:
Fixed issue with a space in the directory/file path of source file.

_________________
PBHGEN - PureBasic Header Generator - PureBasic 5.42

Image_Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PBHGEN - PureBasic Header Generator
PostPosted: Mon Sep 16, 2013 3:20 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Apr 25, 2005 9:28 pm
Posts: 698
Location: $300:20 58 FC 60 - Vietnam
Thanks for your "Tool" Henry00 :)

_________________
“Fear is a reaction. Courage is a decision.” - WC


Top
 Profile  
Reply with quote  
 Post subject: Re: PBHGEN - PureBasic Header Generator
PostPosted: Mon Sep 16, 2013 7:58 am 
Offline
User
User
User avatar

Joined: Thu Jul 12, 2012 7:00 pm
Posts: 78
Location: Germany
flaith wrote:
Thanks for your "Tool" Henry00 :)

No problem, I appreciate your comment! Thanks for letting me know you use and or like it! ^^

_________________
PBHGEN - PureBasic Header Generator - PureBasic 5.42

Image_Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PBHGEN - PureBasic Header Generator
PostPosted: Mon Sep 16, 2013 8:06 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Apr 25, 2005 9:28 pm
Posts: 698
Location: $300:20 58 FC 60 - Vietnam
Henry00 wrote:
flaith wrote:
Thanks for your "Tool" Henry00 :)

No problem, I appreciate your comment! Thanks for letting me know you use and or like it! ^^


Using it and like it :wink:

_________________
“Fear is a reaction. Courage is a decision.” - WC


Top
 Profile  
Reply with quote  
 Post subject: Re: PBHGEN - PureBasic Header Generator
PostPosted: Wed Sep 18, 2013 9:49 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Jan 07, 2005 7:17 pm
Posts: 117
Henry00, Flaith: How do you install PBHGEN - tell me exactly step by step. I have followed instruction and nothing appears.


Top
 Profile  
Reply with quote  
 Post subject: Re: PBHGEN - PureBasic Header Generator
PostPosted: Wed Sep 18, 2013 5:46 pm 
Offline
User
User
User avatar

Joined: Thu Jul 12, 2012 7:00 pm
Posts: 78
Location: Germany
Jan2004 wrote:
Henry00, Flaith: How do you install PBHGEN - tell me exactly step by step. I have followed instruction and nothing appears.

You will not see anything other then automatically generated *.pbi files based on the current code you are editing.

Image

The settings should be somewhat like this, make sure to save the file you are working on. If there is no file even after you save then perhaps put %FILE in quotes "%FILE".
I hope this helps, the steps in the first post should be all you need to get it working. There is no user interface.

_________________
PBHGEN - PureBasic Header Generator - PureBasic 5.42

Image_Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PBHGEN - PureBasic Header Generator
PostPosted: Wed Sep 18, 2013 7:32 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Jan 07, 2005 7:17 pm
Posts: 117
Ok. The same name of file is generated now with extension "pbi". Good idea, interesting results.
:D Thanks.
If I good understand: PBHGEN collects all the comments from the source file and place them in .pbi file (with the same name as source file), then creates the declarations (Declare) and also put them in the same .pbi file, after comments, which are transfered earlier. PBHGEN do not automaticaly open newly made the .pbi file: the user should find it in proper directory and open it (by double click in directory for example) to see in PureBasic Editor. Correct me or add your comment, please.


Top
 Profile  
Reply with quote  
 Post subject: Re: PBHGEN - PureBasic Header Generator
PostPosted: Fri Sep 20, 2013 9:31 am 
Offline
User
User
User avatar

Joined: Thu Jul 12, 2012 7:00 pm
Posts: 78
Location: Germany
Quote:
PBHGEN collects all the comments from the source file and place them in .pbi file (with the same name as source file), then creates the declarations (Declare) and also put them in the same .pbi file, after comments, which are transfered earlier.
Actually it parses the Source File line by line, comments will only be copied on lines where the first character is a ; (semicolon).
Code:
; This Procedure will cause the application to crash.
Procedure.i Crash()
     N.i = 0
     ; PureBasic would detect / 0 with an error message.
     ProcedureReturn 5 / N
EndProcedure
This was done to ensure other comments that are used inside of procedures aren't copied. Where those comments are mostly for forums or easy reference etc. they don't have any real purpose for the programmer.
Quote:
PBHGEN do not automatically open newly made the .pbi file: the user should find it in proper directory and open it (by double click in directory for example) to see in PureBasic Editor.
True, and I don't see any reason why you would want to open it, every time you save the source file it builds a new header file. Their main purpose is to allow you to seamlessly write procedures below the calls to them which adds allot of flexibility. You would only get allot of "The file you are editing has been modified, would you like to reload it?" messages.
You have to include the header into your source file using:
Code:
XIncludeFile #PB_Compiler_File + "i" ;- PBHGEN
I hope this answered your questions, if there is anything else I can do feel free to ask!

_________________
PBHGEN - PureBasic Header Generator - PureBasic 5.42

Image_Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PBHGEN - PureBasic Header Generator
PostPosted: Mon Sep 23, 2013 9:47 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Jan 07, 2005 7:17 pm
Posts: 117
Of course, I agree with you. My comment was so clear that the other participants in the forum soon realized what is going inside PBHGEN.


Top
 Profile  
Reply with quote  
 Post subject: Re: PBHGEN - PureBasic Header Generator
PostPosted: Fri Nov 08, 2013 10:38 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Oct 21, 2013 5:21 pm
Posts: 139
Location: France (Al's Nudie bar!)
Hi Henry,

This kind of procedure declaration, on several lines, doesn't work :


Code:
Procedure.i execute(   _nbNiveaux.u,
                           numNiveauDepart.u,
                          _nbViesDepart.a,
                       _IAGlobale.b)

; etc...

EndProcedure

_________________
http://majikeyric.free.fr


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye