I have an idea, what do you think?

Everything else that doesn't fall into one of the other PB categories.
HarryO
User
User
Posts: 42
Joined: Wed May 07, 2003 4:25 am
Location: Palatine,IL.,USA

I have an idea, what do you think?

Post by HarryO »

Like most other programmers using PureBasic, I have
a need for some more advanced formatting,
macro/directives and such.

I have been thinking about developing a source code
pre-processor for the compiler.

Some of the functions I have been thinking of are:

; 2003/06/12
; Program Outline:
;
; Objective:
; Provide the ability to format source code based upon directives
; at various points in the process, in-order to provide flexability
; in generating a file that is passed to a compilier.
;
; Target Functionality:
; - Flags
; - - Which Compiler Personality to use
; - - Format Source code
; - - Delete Comments
; - - Delete 'Define' related directives
; - - Call compiler
; - - Track Statistics
; - Compiler Personality
; - - Up to 3 Characters for Directive Pre-Marker
; - - Up to 3 Characters for Directive Post-Marker (Optional)
; - - File extension of source code file
; - - File extension of source code backup file
; - - 'Start Comment Line' directive
; - - 'Start Comment Block' directive
; - - 'End Comment Block' directive
; - - 'Line Continuation' directive
; - - 'Start Scan for Procedures' directive
; - - 'End Scan for Procedures' directive
; - - 'Post Declare of Scanned Procedures @ Here' directive
; - - 'Start Macro Define' directive
; - - 'End Macro Define' directive
; - - 'Include Path' directive
; - - 'Include File' directive
; - - 'Xinclude File' directive
; - - 'If Pre_Proc' directive
; - - 'Else Pre_Proc' directive
; - - 'EndIf Pre_Proc' directive
; - - 'Select Pre_Proc' directive
; - - 'Case Pre_Proc' directive
; - - 'CaseElse Pre_Proc' directive
; - - 'EndSelect Pre_Proc' directive
;
; - Format Souce Code
; - - Number Of Spaces for TAB
; - - Number of Spaces for Select/Case
;
;For all the following format options =
;.............(All Ucase or Lcase or Cap 1st letter)
; - - Format Constants
; - - Format Variables
; - - Format Procedures Names
; - - Format Complier Keywords
;
; Order of Defaults/Preferences Overrides -
; Starting with: Global 'INI' file (Loc. w/this program)
; Which is overridden by: Project 'INI' file (Loc. w/Source code)
; Which is overridden by: Command-Line Directives (Program Parameters)
; Which is overridden by: In file Directives (Loc. in Source code)
;

I don't know how long it would take me, but I am willing to try.

Would this of value to anybody else?

Feel free to comment/add/question.

HarryO
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post by tinman »

If you can get it so that the pre-processor can simply take the place of the compiler (as in, just call it with the same flags and it passes them onto the compiler) that would be great.

Also, if you can get macros and include files (more like C ;) working before Fred does (v4.0 IIRC for macros) then that would be great. It would save me wasti^h^h^h^hdoing it ;)

Oh, and the ability to put all include files into a single source file would be excellent. I can't remember of the debugger shows lines of source from inside files which have been included.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
HarryO
User
User
Posts: 42
Joined: Wed May 07, 2003 4:25 am
Location: Palatine,IL.,USA

Post by HarryO »

Tinman,

We'll see who finishes first and the suggestions about the includefile
operation is what I had in mind.

Thank you for your comments and let's see what damage I can do!

Harry0
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

tinman: debugger should show the right lines now.
Post Reply