Page 1 of 1

I have an idea, what do you think?

Posted: Thu Jun 19, 2003 2:50 am
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

Posted: Thu Jun 19, 2003 2:24 pm
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.

Posted: Fri Jun 20, 2003 2:52 am
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

Posted: Fri Jun 20, 2003 9:45 am
by Fred
tinman: debugger should show the right lines now.