Jump to content

Compile selective preprossesor up and running


Recommended Posts

Well that's just what Au3Preprocess do, exchage all #includes with the used functions/constants into a third level scan and write a temporary _Pre script, pass it on to Aut2Exe/CompileAu3 as an option just like one would do a compile from SciTe menu - that snaps out the active script directly from SciTe, a 35Kb script would take about 1 second to scan and pass...

There is an option to exclude the preprocess action to particulary #includes directly in the script with just a ';*' after the #include line, then this particulate #include gets written into the script as a whole and unpreprocessed - this option is to gain some support to things like the dynamic function CALL etc.

The original script do not changed in any manners...

The application run with intuition on/off, just the same action as an provided option...

I use Au3Preprocess in a late scripting state...

I would like to get comments from 'autoitters' that actually tested the application with comments on things like performens, action and intuition etc. and not just some agging from peoble that's never going to use it...

kjactive :(

Edited by kjactive
Link to comment
Share on other sites

Until a proper implementation is designed to handle

<{POST_SNAPBACK}>

If one really feels the need..., extending the language would be better.

May be one can do it with a sort of filter, added to the include statement, listing the symbols to import (a little bit like perl).

#include <File.au3> : _FileAppend _FileCreate

Possibly one can make additional use of #regions. or another grouping mechanism, to handle larger parts of an include file.

So the developer has full control, and full responsibility. This would be transparent to those who don't use that feature.

With regards to the memory footprint, are you really that concerned about a couple hundred KB lying about doing nothing? If so, then you really picked the wrong OS

I started my professional carrier with a RAIR-blackbox (it really earned it's name) 256Kb RAM and 10Mb Disk running MP/M a kind of multi-user CP/M, but that was enough for two guys working night and mostly days on this one machine.

I stopped byte counting using windows - You take a small salad and bread and it takes the full menu and likes to have a siesta after that.

Link to comment
Share on other sites

I read a post previous but it seems to got lost but that autoitter needed a selective function to insert selective function and not all as in perl or was it python and I could not agree more, that was a nice idear and I have the function right there in the application so I have changed it to include this option as well...

#Include <Word.au3> ;* include this particulare include unpreprocessed

#Include <Word.su3> ; _DelWord _SubWord etc. include these functions...

Great idear - Thanks...

kjactive :(

Link to comment
Share on other sites

I read a post previous but it seems to got lost but that autoitter needed a selective function to insert selective function and not all as in perl or was it python and I could not agree more, that was a nice idear and I have the function right there in the application so I have changed it to include this option as well...

#Include <Word.au3> ;*  include this particulare include unpreprocessed

#Include <Word.su3> ; _DelWord _SubWord etc. include these functions...

Great idear - Thanks...

kjactive  :(

<{POST_SNAPBACK}>

This would actually be really nice.

If you have 2 different UDFs with the same name, but in different include files, you can choose which one to use.

Link to comment
Share on other sites

I read a post previous but it seems to got lost but that autoitter needed a selective function to insert selective function and not all as in perl or was it python and I could not agree more, that was a nice idear and I have the function right there in the application so I have changed it to include this option as well...

#Include <Word.au3> ;*  include this particulare include unpreprocessed

#Include <Word.su3> ; _DelWord _SubWord etc. include these functions...

Great idear - Thanks...

kjactive  :(

<{POST_SNAPBACK}>

kjactive,

when using your second mode:

#Include <Word.su3> ; _DelWord _SubWord etc. include these functions...

does it still parse the file and include any additional functions that might be in that file and used in the script? I think that it should do that, that is, the list of functions should force those functions to be included, but it should still search for other functions that must be included.

Also, sometimes I put a comment behind an include statement. Wouldn't that confuse your program? I think that it would be a good idea to use an extra keyword to let your program know that the comment is for him. For instance:

#Include <Word.su3> ; [select] _DelWord _SubWord etc. include these functions...

That way you can make sure that the comment is meant for the preprocessor.

Finally, I think that Valik's problem can be solved for most of the cases by simply checking if the 1st parameter to GuiOnEvent, etc is a string, and if it is, extracting the function name from it and making sure that it is included. This would not solve the case were a variable is used to create the name, but if your preprocessor finds that case it could just issue a warning or something like that.

Anyway, really interesting work. It'd be nice if this could also "remove" the GUI functions that are embedded (or at least I think they are) in the autoit.exe file. That would be a good way to trim many non-gui executables a lot.

Cheers,

Angel

Link to comment
Share on other sites

when using your second mode: #Include <Word.su3> ; _DelWord _SubWord etc. include these functions

does it still parse the file and include any additional functions

Yes it still scans for other used functions but if you write in a particula function after the #include <> ( at a comment line ) you are just shure that this function gets included no matter what incl. any global constants/subfunctions taht this function may use down to a third level scan...

Also, sometimes I put a comment behind an include statement. Wouldn't that confuse your program? I think that it would be a good idea to use an extra keyword to let your program know that the comment is for him. For instance:

#Include <Word.su3> ; [select] _DelWord _SubWord etc. include these functions...

No it do not confuse Au3Preprocess as the application creates a function list and look for any matches so you can write anything else side by side on the same comment line - It's only if you write a multiplication character '*' in anywhere that you change the process status to this particulare include, but ofcource you got a point about a special tag keyword could be a more clear solution ( I think about it )

checking if the 1st parameter to GuiOnEvent, etc is a string, and if it is, extracting the function name from it and making sure that it is included.

As you pointed out your self it would not solve the dynamically function call case or if the function is created in anymanner. The preprocessor would always look for a total function match and it would be hard work both for me and the preprocessor to do this kind of roundup on every function included in every function lists as there is a lot of checking going on in this little fellow. Speed is a vital isue here and I want to keep the constant/function scan at the level it's on now ( less than 2 sec. to perform a 35Kb script scan ) but ofcourse I think about improving this scan function both to a deaper level, to catch any missbehave and what to do about created function names sometime in future...

It'd be nice if this could also "remove" the GUI functions that are embedded (or at least I think they are) in the autoit.exe file.

No there are no embedded functions in the wrapped executes as far as I know, only a icon file, a lot of function descriptions and the 'interpretter' and I leave this to the guys doing this as they know what is right and wrong here - can't be left out but Au3Preprocessor do remove as an option all comments, blank lines, blank characters inbetween operators etc. and more to come as this do speedup execute time as autoit has to read in all characters one by one, do lists etc. before any action can take place - but it is a point of view to think about...

I have not yet tested for execute time results here but when I'm done and the applications is optimized as far as it can I'll do that too...

Thank for your responce, nice points...

kjactive :(

Edited by kjactive
Link to comment
Share on other sites

This looks beautiful, and I see little to no harm in it. Call may become a problem, but if you (and you do) allow the user to manually suggest which functions to be used that avoids it entirely. The scripter should know what functions will be called, and use his own sanity checks to make sure they're correct calls.

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...