PBHGEN – PureBasic Header Generator
Will read a PureBasic source file (
*.pb) and generate a header out of it (
Declare statements are automatically generated for every procedure.
This program also works with SpiderBasic.
Under “Tools” in the PureBasic IDE add a new tool called “
- At Commandline select your copy of
- At Arguments type
- 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 also in modules 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.
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!
- Added SpiderBasic header generation support.
- Fixed a comment after
EndMacroskipping the next procedure declaration.
- Now ignoring content between
- Fixed case where the compiler directives failed when a module is declared above global procedures.
- Using compiler directives to remove the need of multiple files for modules.
Improved parsing engine to comply with latest PureBasic syntax.
Optimized header file content and size.
Now supports any amount of spaces in front of a procedure.
Treats a colon seperator as a new line to allow multiple declarations on a single line.
Added support for module header generation (requires additional files and include lines in source code).
Now naming version after PureBasic’s version when possible.
Added support for Runtime procedure statements.
Added support for case independent keyword detection.
- Fixed issue with multiline arguments. Thanks majikeyric for pointing this out.
- Fixed issue with a space in the directory/file path of source file.
- Stops when encountering the statement seperator “
:” or comment “
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.
Fixed issue where a
*pointer.structurehad no default parameter.
Fixed issue with a string as custom parameter, it was not escaped.
- Fixed issue where a
*pointerwould cause further Procedure Parameters to lose their types.
- Fixed issue with Structured List/Array/Map in Procedure Parameters.
- Fixed issue with Structure Pointers in Procedure Parameters, transforms to Pointers now.
- Initial Design