Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Precompiled Dump Switch on Aut2Exe


  • Please log in to reply
21 replies to this topic

#1 The Kandie Man

The Kandie Man

    All Your Base Are Belong To Us

  • Active Members
  • PipPipPipPipPipPip
  • 950 posts

Posted 09 December 2007 - 01:23 AM

What I am asking is for the ability to be able to send a switch to the compiler that will allow the compiler to do all the script processing it normally does, but instead of compiling the script, it just dumps the script with all its includes and other formatted information into a .au3 file that shows the scripter exactly what is being compiled into the actual executable. This would allow the scripter to remove any extra filler information that would normally be added. The best use for this would be a script cleaner that would remove all global constants and functions that are not being used by the script and are thus increasing the executable's size as well as the time it takes to parse the script. I don't think it would be very hard to modify Aut2Exe to do this.

Ultimately, this would be analogous to the -a switch that compilers have where it dumps the assembly code for the executable that is being compiled. Of course, in this case instead of dumping the assembly code, it would simply dump the entire script with all of its includes included.

I hope I am making sense. Let me know if I need to clarify.

- The Kandie Man ;-)
"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire







#2 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 09 December 2007 - 02:36 AM

#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/striponly /beta

Of course you'll need the latest Oby that Jos has been working on.

Edited by GaryFrost, 09 December 2007 - 02:37 AM.

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#3 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 15,730 posts

Posted 09 December 2007 - 03:04 AM

#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/striponly /beta

Of course you'll need the latest Oby that Jos has been working on.

Not sure where obfuscating your script has anything to do with what he is asking. Although an alternative, if he's looking for any type of speed increase, obfuscation would have the complete opposite effect.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.


#4 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 09 December 2007 - 03:06 AM

Not sure where obfuscating your script has anything to do with what he is asking. Although an alternative, if he's looking for any type of speed increase, obfuscation would have the complete opposite effect.


Read the switch a little better there SmOke, "/striponly" it doesn't obfuscate.

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#5 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 15,730 posts

Posted 09 December 2007 - 03:09 AM

Read the switch a little better there SmOke, "/striponly" it doesn't obfuscate.

Guess I must be doing something wrong... In my virtual environment, it still obfuscated it with version(1.0.23.1) using those switches.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.


#6 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 09 December 2007 - 03:11 AM

Guess I must be doing something wrong... In my virtual environment, it still obfuscated it with version(1.0.23.1) using those switches.

v1.0.24.1

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#7 The Kandie Man

The Kandie Man

    All Your Base Are Belong To Us

  • Active Members
  • PipPipPipPipPipPip
  • 950 posts

Posted 09 December 2007 - 03:23 AM

#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/striponly /beta

Of course you'll need the latest Oby that Jos has been working on.


Thanks Gary, I was unaware of this. the lastest verison that I can find is version 1.0.23.1. According to Jos, the most recent version can be found here:
http://www.autoitscript.com/autoit3/scite/downloads.shtml

But the lastest vesion that is posted there is only 1.0.23.1. I also searched through his thread but only found that he mentioned that he uploaded the lastest version 1.0.24.1( http://www.autoitscript.com/forum/index.ph...st&p=440641 ). Can you please point me to where the newer version may be found.

Thanks,

- The Kandie Man ;-)
"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

#8 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 09 December 2007 - 03:24 AM

Thanks Gary, I was unaware of this. the lastest verison that I can find is version 1.0.23.1. According to Jos, the most recent version can be found here:
http://www.autoitscript.com/autoit3/scite/downloads.shtml

But the lastest vesion that is posted there is only 1.0.23.1. I also searched through his thread but only found that he mentioned that he uploaded the lastest version 1.0.24.1( http://www.autoitscript.com/forum/index.ph...st&p=440641 ). Can you please point me to where the newer version may be found.

Thanks,

- The Kandie Man ;-)


Post #290 http://www.autoitscript.com/forum/index.ph...st&p=439581

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#9 The Kandie Man

The Kandie Man

    All Your Base Are Belong To Us

  • Active Members
  • PipPipPipPipPipPip
  • 950 posts

Posted 09 December 2007 - 04:01 AM

Post #290 http://www.autoitscript.com/forum/index.ph...st&p=439581

Ahh, thank you. I got it and it works. This is a great alternative and I thank you for bringing this up. However, what if the scripter wants to manually go through the script and remove stuff or what if they want to use their own stripper to do this? Maybe there are conflicts with the included files or maybe the user wants to control exactly what is being compiled. This works quite well, but the user may simply want to know what the exact code is that is being compiled into their executables. This doesn't show the exact code that, under normal compiling conditions, is being included in their scripts.

Nonetheless, I think that the addition of a switch that dumps the precompiled source would be a great feature addition to Autoit.

- The Kandie Man ;-)

Edited by The Kandie Man, 09 December 2007 - 04:03 AM.

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

#10 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 09 December 2007 - 04:34 AM

Write a script that takes an input file and produces an output file where all #include statements are replaced by the contents of the file that's included (obeying #include-once and taking into consideration the search order). Shouldn't be more than 15 minutes to write the script. Once you have that, congratulations, you've got what the compiler does before it turns it into tokens.

#11 The Kandie Man

The Kandie Man

    All Your Base Are Belong To Us

  • Active Members
  • PipPipPipPipPipPip
  • 950 posts

Posted 09 December 2007 - 05:19 AM

Write a script that takes an input file and produces an output file where all #include statements are replaced by the contents of the file that's included (obeying #include-once and taking into consideration the search order). Shouldn't be more than 15 minutes to write the script. Once you have that, congratulations, you've got what the compiler does before it turns it into tokens.


Umm, yes, I have thought about this. This isn't as easy as 1-2-3 though Valik, not for most people anyway. Writing a proper script like this just isn't as easy as it seems. As you pointed out, I would have to write a parser and then I have to have the parser intelligently include all the nested includes in the includes. Then I have to give the parser logic to determine that the ones with the #include-once header are only included once and that if there are repeat instances of this, then they should be ignored. Then I have to make sure that the whole thing knows exactly where to look, not only for the includes, but for includes to the includes. I have to do this all and make sure that it doesn't error or bug out in any way, shape, or form. Basically, I have to re-invent the wheel. The autoit parser already does this, so it seems like a complete waste of time to completely re-write something when it has already been written. In addition, future versions of autoit could change the way the files are parsed and my script would have to change to compensate for this. All and all, this is a very tedious undertaking, especially since it has already been tried, tested, and done.

To me you are saying, "You have requested a feature in Autoit that would allow AutoIt to elaborate on something it already does, but you know what, re-invent the wheel and write your own program to do it."

I don't know, but that seems like an extremely closed-minded response to someone who posted, what I believe is a simple and reasonable request, in the Feature Requests forum.

I know this sure wouldn't take me 15 minutes to get right, but then, I haven't written that many parsers.

Forgive me if I misunderstood you, but that is what I got from your post.

I would love to write my own parser to do this then to go and bother you guys about it, but quite frankly, to me it seems that this is quite an undertaking. If you would be willing to show me how to go about doing something like this that would be great. For example: 1)Give me a psuedo-code structure for going about this, 2)Some examples, and 3)Efficient coding strategies, then maybe I could pull it off after hours and hours of work(this includes debugging time). However, it just seems like a waste of time and energy on everyone's part to handle the problem this way.

- The Kandie Man ;-)

EDIT: Fixed some grammatical errors and such.

Edited by The Kandie Man, 09 December 2007 - 05:28 AM.

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

#12 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 09 December 2007 - 05:34 AM

Regular expressions are your friend. The search order is well documented (see #include in the help file). Use a 2D array as a stack/structure to hold the full path and #include-once state. It's really not very complex at all. In fact, a language with registry support is a blessing. I just recently wrote very similar in Lua and managed to get it right without registry support.

And honestly, I bet it would take me less time to write something in AutoIt than it'd take me to modify Aut2Exe to do this.

#13 The Kandie Man

The Kandie Man

    All Your Base Are Belong To Us

  • Active Members
  • PipPipPipPipPipPip
  • 950 posts

Posted 09 December 2007 - 05:38 AM

Regular expressions are your friend. The search order is well documented (see #include in the help file). Use a 2D array as a stack/structure to hold the full path and #include-once state. It's really not very complex at all. In fact, a language with registry support is a blessing. I just recently wrote very similar in Lua and managed to get it right without registry support.

And honestly, I bet it would take me less time to write something in AutoIt than it'd take me to modify Aut2Exe to do this.


Ok, I will do. Thanks for explaining how and why. I understand now that it is simply easier to re-write it in AutoIt then to modify the current one in Aut2Exe.

- The Kandie Man ;-)
"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

#14 Jos

Jos

    oh joy ...

  • Developers
  • 22,529 posts

Posted 09 December 2007 - 11:58 AM

This script should be close to what you are looking for. Needs to be located in the AutoIt3 program directory to find the proper include files.

Plain Text         
#include <file.au3> Global $SourceFileName = FileOpenDialog("Specify the file to be expanded", @ScriptDir, "AutoIt3 Script (*.au3)", 3) If @error Then Exit FileChangeDir(@ScriptDir) Global $OutPutFileName = StringReplace($SourceFileName, ".au3", "_extended.au3") ; ; Get Include Paths ; Global $User_IncludeDirs = StringSplit(RegRead("HKCU\Software\AutoIt v3\Autoit", "Include"), ";") Global $IncludeDirs[2 + UBound($User_IncludeDirs) - 1] Global $IncludeFiles[500], $IncludeFilesCnt = 1 $IncludeFiles[$IncludeFilesCnt] = $SourceFileName ; First store the AutoIt3 directory to the search table $IncludeDirs[0] = @ScriptDir & "\include" Global $I_Cnt = 1 ; Add User Include Directories to the table For $x = 1 To $User_IncludeDirs[0]     If StringStripWS($User_IncludeDirs[$x], 3) <> "" And FileExists($User_IncludeDirs[$x]) Then         $IncludeDirs[$I_Cnt] = StringReplace($User_IncludeDirs[$x], '"', '')         $I_Cnt += 1     EndIf Next ; Add the scriptpath as last entry to the table Dim $szDrive, $szDir, $szFName, $szExt _PathSplit($SourceFileName, $szDrive, $szDir, $szFName, $szExt) $IncludeDirs[$I_Cnt] = _PathFull($szDrive & $szDir) ; ; Add \ at the end of the Include dirs in the search table For $x = 0 To $I_Cnt     If StringRight($IncludeDirs[$x], 1) <> "\" Then         $IncludeDirs[$x] &= "\"     EndIf Next ; ;  Process scriptfile ; $H_Inp = FileOpen($SourceFileName, 0) If @error Then     MsgBox(0, "error", " Unable to open Sourcefile:" & $SourceFileName)     Exit EndIf $H_Out = FileOpen($OutPutFileName, 2) If @error Then     MsgBox(0, "error", " Unable to open Ouputfile:" & $OutPutFileName)     Exit EndIf ; While 1     $TempRec = FileReadLine($H_Inp)     If @error Then ExitLoop     $t_TempRec = StringStripWS(StringLeft($TempRec, 50), 3)     If @error Then ExitLoop     If StringLeft($TempRec, 8) <> "#include" Then         FileWriteLine($H_Out, $TempRec)     Else         If StringLeft($t_TempRec, 13) = "#include-once" Then             $Include_Once = 1         Else             Add_Include($TempRec)         EndIf     EndIf WEnd FileClose($H_Inp) FileClose($H_Out) ConsoleWrite($OutPutFileName & " (1,1) :  Outputfile created." & @CRLF) ;========================================================= ; Add all #Include files to the outputfile - recursively ;========================================================= Func Add_Include($Include_Rec, $source = "Main")     Local $TempRec, $ChkInclude, $Include_Once = 0, $InIncludeCnt, $NeedsIncluded, $IncludeFile, $IncludeFileFound = 0     Local $H_Incl ; Find the proper path     $IncludeFile = StringMid(StringStripWS($Include_Rec, 3), 9)     $IncludeFile = StringStripWS($IncludeFile, 3) ; Determine the Path sequence to scan for include files     If StringLeft($IncludeFile, 1) = "<" Then         $IncludeFile = StringReplace($IncludeFile, ">", "")         $IncludeFile = StringReplace($IncludeFile, "<", "")         $IncludeFile = StringStripWS($IncludeFile, 3)         For $x = 0 To $I_Cnt             If $IncludeDirs[$x] <> "" And FileExists($IncludeDirs[$x] & $IncludeFile) Then                 $IncludeFile = $IncludeDirs[$x] & $IncludeFile                 $IncludeFileFound = 1                 ExitLoop             EndIf         Next     Else         $IncludeFile = StringReplace($IncludeFile, "'", "")         $IncludeFile = StringReplace($IncludeFile, '"', "")         $IncludeFile = StringStripWS($IncludeFile, 3)         For $x = $I_Cnt To 0 Step - 1             If $IncludeDirs[$x] <> "" And FileExists($IncludeDirs[$x] & $IncludeFile) Then                 $IncludeFile = $IncludeDirs[$x] & $IncludeFile                 $IncludeFileFound = 1                 ExitLoop             EndIf         Next     EndIf ; If File is found then determine if it still needs to be included     If $IncludeFileFound Then     ; Check for #Include_once         $TempRec = FileRead($IncludeFile)         If StringInStr($TempRec, "#include-once") Then $Include_Once = 1     ; check If include is already included         $NeedsIncluded = 1         If $Include_Once = 1 Then             For $ChkInclude = 1 To $IncludeFilesCnt                 If $IncludeFiles[$ChkInclude] = $IncludeFile Then                     $NeedsIncluded = 0                     ExitLoop                 EndIf             Next         Else         ;TraceLog("==> *** Needs to be included since no #include-once is found.")         EndIf     ;         If $NeedsIncluded = 1 Then             TraceLog("+ ==> IncludeOnce=" & $Include_Once & " Including:" & $IncludeFile & "   Include by:" & $source)             FileWriteLine($H_Out, ";*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*")             FileWriteLine($H_Out, ";* Start Include:" & $IncludeFile & "   Include by:" & $source)             FileWriteLine($H_Out, ";*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*")             $InIncludeCnt = 0             $IncludeFilesCnt += 1             $IncludeFiles[$IncludeFilesCnt] = $IncludeFile             $H_Incl = FileOpen($IncludeFile, 0)             While 1                 $TempRec = FileReadLine($H_Incl)                 If @error Then ExitLoop                 $t_TempRec = StringStripWS(StringLeft($TempRec, 50), 3)                 If StringLeft($TempRec, 8) <> "#include" Then                     FileWriteLine($H_Out, $TempRec)                 Else                     If StringLeft($t_TempRec, 13) <> "#include-once" Then                         Add_Include($TempRec, $IncludeFile)                     EndIf                 EndIf             WEnd             FileWriteLine($H_Out, ";*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*")             FileWriteLine($H_Out, ";* End Include:" & $IncludeFile & "   Include by:" & $source)             FileWriteLine($H_Out, ";*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*")             FileClose($H_Incl)         Else             TraceLog("  ==> Skipped, Already included:" & $IncludeFile)             $IncludeFile = ""         EndIf     Else         TraceLog("!==> *** ERROR: include file not found :" & $Include_Rec)     EndIf EndFunc ; Func TraceLog($text)     ConsoleWrite($text & @CRLF) EndFunc


Jos

Edited by Jos, 09 December 2007 - 12:33 PM.

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#15 The Kandie Man

The Kandie Man

    All Your Base Are Belong To Us

  • Active Members
  • PipPipPipPipPipPip
  • 950 posts

Posted 09 December 2007 - 01:28 PM

This script should be close to what you are looking for. Needs to be located in the AutoIt3 program directory to find the proper include files.

;code omitted


Jos

Argh. I hate my life. I just wrote, from scratch, an include parser. It is still a bit buggy, but it is done. I hate my life.

- The Kandie Man :-|
"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

#16 Jos

Jos

    oh joy ...

  • Developers
  • 22,529 posts

Posted 09 December 2007 - 01:45 PM

Argh. I hate my life. I just wrote, from scratch, an include parser. It is still a bit buggy, but it is done. I hate my life.

- The Kandie Man :-|

Always a good practice to write these scripts... helps you understand how things work :)

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#17 The Kandie Man

The Kandie Man

    All Your Base Are Belong To Us

  • Active Members
  • PipPipPipPipPipPip
  • 950 posts

Posted 09 December 2007 - 01:54 PM

Always a good practice to write these scripts... helps you understand how things work :)

This is true. I have one question though. What is the foolproof method for determining the correct order that the includes are included in? For some reason, mine includes them all, but not always in the correct order. So those that rely on constants that were defined above them fail. An example would be:
Global Const $RB_SETUNICODEFORMAT = $CCM_SETUNICODEFORMAT


The $CCM_SETUNICODEFORMAT variable is defined in the resulting script, but it is defined below that. So it errors out.

- The Kandie Man ;-)
"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

#18 Jos

Jos

    oh joy ...

  • Developers
  • 22,529 posts

Posted 09 December 2007 - 02:53 PM

This is true. I have one question though. What is the foolproof method for determining the correct order that the includes are included in? For some reason, mine includes them all, but not always in the correct order. So those that rely on constants that were defined above them fail. An example would be:

Global Const $RB_SETUNICODEFORMAT = $CCM_SETUNICODEFORMAT


The $CCM_SETUNICODEFORMAT variable is defined in the resulting script, but it is defined below that. So it errors out.

- The Kandie Man ;-)

They are included as the #include statements are encountered.
Run the posted script on this script and look at the output generated. it will tell you how it does it.

#include <date.au3> ConsoleWrite("Now is:" & _Now())

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#19 kjactive

kjactive

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 697 posts

Posted 09 December 2007 - 06:32 PM

Write a script that takes an input file and produces an output file where all #include statements are replaced by the contents of the file that's included (obeying #include-once and taking into consideration the search order). Shouldn't be more than 15 minutes to write the script. Once you have that, congratulations, you've got what the compiler does before it turns it into tokens.


Well there is a Scripting Preprocessor available - 'Project Manager' that will remove all unnessasary things like directives and #includes, buildin only used functions / Globals , preprocess all into one script and add a lot of speed to runtime...

Free to download from site
http://www.sitecenter.dk/latenight/nss-fol...t%20Manager.zip

kjactive :)

#20 The Kandie Man

The Kandie Man

    All Your Base Are Belong To Us

  • Active Members
  • PipPipPipPipPipPip
  • 950 posts

Posted 10 December 2007 - 05:01 AM

Thanks for your help guys. I finished my own script that does this. Thanks for your help Jos. Since you already had one written Jos, I had to turn this into a competition, here are the results:


Global Const beta = v3.2.9.14

For a file with the following includes using beta
#include <GUIConstants.au3>   #include <array.au3>   #include <file.au3>   #include <IE.au3>   #include <Word.au3>   #Include <GuiTreeView.au3>   #include <GuiStatusBar.au3>   #Include <GDIPlus.au3>   #Include <GuiEdit.au3>   #Include <GuiHeader.au3>   #Include <GuiRebar.au3>   #Include <GuiSlider.au3>   #Include <GuiTab.au3>   #Include <Security.au3>ƒo݊÷ Ùhrj|¨è§¶«Šmš)Ý‹¥u§]¶­™©òŠw%¹×¬ŠÆÞʉݙæî¶Øb²+²ÚÞ²Ë^²Û(¶­ŠÆÞ²'^¶©¢)í"Ûh¢M¹÷Ý=׿8Ó]zêǜ¢wl~ŠæŠw­¢—«~Šæ¶¨¥êÚ¶*'"Ûh¢Mõã­zã];ãxÖǜ¢wl¶‚h³l¶Š^­ú+šØ^¢—«jبœz0z÷«Â§ºÈ§‚Ø^~‰e£§‚Ç­¡ù®r¨­êÞjÊ'i¹^Šw%¹×¬~º&mëZjëhŠ×6#include <GUIConstants.au3>   #include <array.au3>   #include <file.au3>


It took Jos's script only 1.02703444152818 seconds to perform the operation.
It took mine 1.27176917736751 seconds to perform the operation.

Mine is mainly array based with some use of StringRegExp. It also uses some File I/O at the end to strip the include headers out of the finished product.
Jos's is File I/O based.

Because mine is array based, I have to write the contents of the array to a temporary file and then have the temporary file stripped of include headers. Jos's script does this on the first pass.


Anyway, glad to get this thing finished.


Thanks again for your help Jos. It was much appreciated.

Write a script that takes an input file and produces an output file where  all #include statements are replaced by the contents of the file that's  included (obeying #include-once and taking into consideration the search  order). Shouldn't be more than 15 minutes to write the script. Once you have  that, congratulations, you've got what the compiler does before it turns it  into tokens.


Well there is a Scripting Preprocessor available - 'Project Manager' that will remove all unnessasary things like directives and #includes, buildin only used functions / Globals , preprocess all into one script and add a lot of speed to runtime...

Free to download from site
http://www.sitecenter.dk/latenight/nss-fol...t%20Manager.zip

kjactive :)


I didn't know about this. I will definitely have to give it a try sometime. ;-)

- The Kandie Man ;-)
"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users