Jump to content
Sign in to follow this  
kjactive

New tool - a PreProcessor

Recommended Posts

Yes gcriaco the IE.au3 do have some special created function calls that I havn't found out jet but just include the missing functions with the editor to cope for dynamically created functions and everything should be okay - this process do only have to be done ones...

I will take a closer look into IE.au3 UDF someday and maybe find a solution...

kjactive :shocked:

Share this post


Link to post
Share on other sites

I did a lot of work and some bugfixes on the Project Manager and came up with a last update...

post-4760-1176912195_thumb.gifpost-4760-1176912485_thumb.gif

Real new options is a Language Editor included as to translate the auto created TerraTec language scripts ( free of charge translation )...

New option to select Public or the Beta system to be used with test or compile included...

Fixed some scanning bugs related to very large projects - LouLou

Included a process Information tooltip popup ( '<<' control )...

Included an option to load in a makefile to be edited before a project ( Write control )...

Changed Broken lines in functions do always get sampled to one line in the final script...

Global variable values that get included do now always get preprocessed into their real values...

New option attached (**) now owerrule the scan process and buildin these #includes into the final script as non processed...

Global variabels bug fix - reportet by Peppe

Attached a Language Translation editor from the menu...

Implimented new testing and compile option to select between Public and Beta version used...

Language Translate editor now use same language as Project Manager is set to if available and run from Project Manager menu...

Attached default icons and settings to Terratec language scripts (.LNG ) and makefiles ( .o )...

Fixed that the create language script process snoopped last array...

Download from site:

http://www.sitecenter.dk/latenight/nss-fol...t%20Manager.zip

Please keep on your great work reporting bugs and comments

kjactive :shocked:

post-4760-1176912314_thumb.gif

Edited by kjactive

Share this post


Link to post
Share on other sites

hihi !

just a stupid question: the links in the first postings are wrong. maybe you could delete or update them ?

and second: project manager does the same as Au3PreProcessor 1.8 ?

just because: i want to download and try it first and then read the 6 pages here.....

thanx

j.


Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites

hallo Jennico

The first links in this tropics, the application had another name Au3Preprocess that was the starting point for 'Project Manager' but has gone a long way sins then but still the same basics - feel free to check it out, still come with source code and a topics...

Please use the last topic link, I'll will open a new topics some day as this has gone to long to edit links ec...

Please report bugs and feel free to do comments...

kjactive

Share this post


Link to post
Share on other sites

Hej,

I have been following the development of your tool for a while and today did I decide to give it a try...

It seems to be an excellent tool you have created! :shocked:

But I found a couple of small issues with it.

1. The program crashes when the same source are processed for the second time (this does not happens If the *_pre.au3 is manually deleted).

2. All tabs(0x09) are stripped from the source, this should not generally cause any problems since most people only use tabs between the actual instructions and the comments anyway. But I discovered that I had accidentally used one in the middle of a codeline and since it was completly removed without any checking if something useful was following the tab, caused this an error. Since this might be a thing that could be quite hard to find out about for someone who not are used to work with hexeditors as a way to examine if the error was caused by a simple typo like mine. :( or a real bug. It could be a good idea to make sure that all tabs not are stripped in this case...

ex:

My instruction was looking like this before processing:

If $handle = -1 Then error(1, 0) oÝ÷ Ù§íz¸­mçébëaÆ®¶­sdbb33c¶æFÆRÒÓFVâW'&÷"Â

Share this post


Link to post
Share on other sites

Hallo Cyperworld

The program crashes when the same source are processed for the second time

Yes I noticed and located the spot, This do quite rightly happens when a script is processed more than ones BUT it do not happens: when the 'Process Manager' is not 'made execute' and I haven't seen the crash sins I compiled 'Project Manager' in Public model - I tryed to made an isolated script to produce the trouble, I'm not finished testing jet but as the 'Project Manager' do not use any Beta functiions I'll probably just go public but let me see, I suspect that this could be something with the last Auto2exe beta update....

Trouble code...

$IDI = FileOpen($in,0); open a temporary script
While 1     
      $line = FIleReadline($IDI)
       If @error Then Exitloop
       $Line = StringStripWS($Line,7); !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Last line executed before the crash
       $wd = StringInStr($Line,';'); line is unreadably Failure line ->  function should return integer on first Comment
    If $wd = 1 Then; line is all Commented
    Elseif $wd > 0 Then; Strip out trailing comments
         $Lines = $lines & StringMid($line,1,$Wd-1) & @CRLF
    Else
         $Lines = $lines & $line & @CRLF; No comments in this line
    EndIf
WEnd
FileClose($IDI)

About the Tab characters - well you'r absolutly right , tab characters get removed compleatly and that could produce an error in some conditions like in your example - I'll look into it and hopefully find a solution...

About errors hard to find - well you could have a point here but as 'Project Manager' do not make any changes to the original script and produce a new autoit3 script, I'll recomend that you run this new script in SciTE or do a testing from PM that would produce the error line with line number to look up - Afterall not every PreProcess option is available in every script as autoit3 as a typeless language has that many combinations and I know of several rare combinations that would produce script failure if a particulare Preprocess option is activated, that's why these functions is attached as options...

Thanks for your report, I'll look into it...

kjactive :shocked:

Edited by kjactive

Share this post


Link to post
Share on other sites

kjactive: That sounds fine... It's small issues anyway since I know how to avoid them :(

But another thing... Would it be differcult to add a feature that renames variable and function names?

The new functions could for example be renamed to _f1, _f2, _f3... and variables to $v1, $v2, $v3 etc...

Example:

Functions:

Before: Func _Settings()

After: Func _f1

Variables:

Before: Global $logdetails = 0x1f

After: Global $v1 = 0x1f

The main purpose with this feature are to make it even harder to get something useful out of the source too easily, if someone tries to decompile it.. :shocked:

Share this post


Link to post
Share on other sites

Hallo Cyperworld

I thought about attaching a variable preprocess option as all main script variables could be included into one big stem variable but this is on the maybe todo list when I had debug a little more...

kjactive :shocked:

Edited by kjactive

Share this post


Link to post
Share on other sites

Great work kjactive :)

Now I tested your Project manager 3.0.5 and it's impressive.

I switched to it from CleanScript which is not developed anymore and isn't working with new Autoit 3.2.

I have some bugs/ideas for you:

1) Remove trailing comments - don't work on some lines here are examples:

Global $pole_pbl[1][2] ; obsahuje handle nodu a jmeno knihovny (vcetne .pbl), inicializace v Import()
$hwnd_list = ControlGetHandle($Form1, "", $List1) ; kvuli NastavHorizScrollBar()
$hwnd_lb = ControlGetHandle(" - PowerBuilder", "", "ListBox1") ; output okno (ListBox)
WinActivate(" - PowerBuilder") ; kvuli ControlGetFocus()
ZjistiOutput() ; zapsat do LOG souboru cely obsah output okna z PB (pripadne hlasky compileru)
Send('!v') ; &Version
If $result <> '' Then Vypis($result,1) ; nevypisovat prazdny (aby nebyly dva prazdne radky pred HOTOVO), po jednom radku
RegWrite($klic, "0", "REG_SZ", $painter_library) ; library zapsat na prvni pozici (0)oÝ÷ ØÚ-y©ÆcËb:ëiºÖ«zlºw-ìÙ¦¢÷¦º[bnV§ÈZ®Ë!¢é]mæuçzÚz'w%¹×{aƶ*'Ì!z{azÊZqë­ë¬yاjËkx¢·±jjey«­¢+Ù±½°
½¹ÍÐÀÌØíÙÉÍ¥½¸ôÌäìĸÀÑÄÌäììÍ¡½Õ±ÍÑḁ̡̈¹½Ð½ÁÑ¥µ¥éÍÁÌ¥¹Í¥ÍÑÉ¥¹oÝ÷ ÛyÞÁû§rب)ÈGè®^)àMâ×jémyØ­¢´×ºÚf²mâè¢K©~éܶ*'².Ú)zx­¶¬Á¬¸"ú-yú+ì-¢~Ï®ÞrÙ¨¯­X§Ú£  塧ej׬¶÷«²*'l@ÈOöù>·©®²Æî[b  hm©ljëh×6Func _MemInit($hWnd, $iSize, ByRef $rMemMap, $pAddress = 0)
Local $iAccess, $iAllocation
Local $pMemory, $hProcess
Local $iProcessID
        Local $PROCESS_VM_OPERATION = 0x00000008
        Local $PROCESS_VM_READ = 0x00000010
        Local $PROCESS_VM_WRITE = 0x00000020
        Local $MEM_RESERVE = 0x00002000
        Local $MEM_COMMIT = 0x00001000
        Local $MEM_SHARED = 0x08000000
        Local $PAGE_READWRITE = 0x00000004
_GetWindowThreadProcessId($hWnd, $iProcessID)
$iAccess = BitOR($PROCESS_VM_OPERATION, $PROCESS_VM_READ, $PROCESS_VM_WRITE)
$hProcess = _OpenProcess($iAccess, False, $iProcessID)
Switch @OSVersion
Case "WIN_ME", "WIN_98", "WIN_95"
$iAllocation = BitOR($MEM_RESERVE, $MEM_COMMIT, $MEM_SHARED)
$pMemory = _VirtualAlloc($pAddress, $iSize, $iAllocation, $PAGE_READWRITE)
Case Else
$iAllocation = BitOR($MEM_RESERVE, $MEM_COMMIT)
$pMemory = _VirtualAllocEx($hProcess, $pAddress, $iSize, $iAllocation, $PAGE_READWRITE)
EndSwitch
If @error Then Return SetError(-1, -1, 0)
$rMemMap = DllStructCreate($MEM_MAP)
DllStructSetData($rMemMap, $MEM_MAP_HPROC, $hProcess)
DllStructSetData($rMemMap, $MEM_MAP_ISIZE, $iSize)
DllStructSetData($rMemMap, $MEM_MAP_PMEM, $pMemory)
Return $pMemory
EndFunc   oÝ÷ Ú+(¦Ø¦72Ö±zºè­«­¢+ÙÕ¹}5µ%¹¥Ð ÀÌØí¡]¹°ÀÌØí¥M¥é°  åIÀÌØíÉ5µ5À°ÀÌØíÁÉÍÌôÀ¤)1½°ÀÌØí¥ÍÌ°ÀÌØí¥±±½Ñ¥½¸)1½°ÀÌØíÁ5µ½Éä°ÀÌØí¡AɽÍÌ)1½°ÀÌØí¥AɽÍÍ%(1½°ÁàÀÀÀÀÀÀÀàôÁàÀÀÀÀÀÀÀà(1½°ÁàÀÀÀÀÀÀÄÀôÁàÀÀÀÀÀÀÄÀ(1½°ÁàÀÀÀÀÀÀÈÀôÁàÀÀÀÀÀÀÈÀ(1½°ÁàÀÀÀÀÈÀÀÀôÁàÀÀÀÀÈÀÀÀ(1½°ÁàÀÀÀÀÄÀÀÀôÁàÀÀÀÀÄÀÀÀ(1½°ÁàÀàÀÀÀÀÀÀôÁàÀàÀÀÀÀÀÀ(1½°ÁàÀÀÀÀÀÀÀÐôÁàÀÀÀÀÀÀÀÐ)}Ñ]¥¹½ÝQ¡ÉAɽÍÍ% ÀÌØí¡]¹°ÀÌØí¥AɽÍÍ%¤(ÀÌØí¥ÍÌô    ¥Ñ=H ÁàÀÀÀÀÀÀÀà°ÁàÀÀÀÀÀÀÄÀ°ÁàÀÀÀÀÀÀÈÀ¤(ÀÌØí¡AɽÍÌô}=Á¹AɽÍÌ ÀÌØí¥ÍÌ°±Í°ÀÌØí¥AɽÍÍ%¤)MÝ¥Ñ =MYÉÍ¥½¸)
ÍÅÕ½Ðí]%9}5ÅÕ½Ðì°ÅÕ½Ðí]%9|äàÅÕ½Ðì°ÅÕ½Ðí]%9|äÔÅÕ½Ðì(ÀÌØí¥±±½Ñ¥½¸ô  ¥Ñ=H ÁàÀÀÀÀÈÀÀÀ°ÁàÀÀÀÀÄÀÀÀ°ÁàÀàÀÀÀÀÀÀ¤(ÀÌØíÁ5µ½Éäô}Y¥ÉÑÕ±±±½ ÀÌØíÁÉÍÌ°ÀÌØí¥M¥é°ÀÌØí¥±±½Ñ¥½¸°ÁàÀÀÀÀÀÀÀФ)
ͱÍ(ÀÌØí¥±±½Ñ¥½¸ô   ¥Ñ=H ÁàÀÀÀÀÈÀÀÀ°ÁàÀÀÀÀÄÀÀÀ¤(ÀÌØíÁ5µ½Éäô}Y¥ÉÑÕ±±±½à ÀÌØí¡AɽÍÌ°ÀÌØíÁÉÍÌ°ÀÌØí¥M¥é°ÀÌØí¥±±½Ñ¥½¸°ÁàÀÀÀÀÀÀÀФ)¹MÝ¥Ñ )%ÉɽÈQ¡¸IÑÕɸMÑÉÉ½È ´Ä°´Ä°À¤(ÀÌØíÉ5µ5Àô±±MÑÉÕÑ
ÉÑ ÀÌØí55}5)±±MÑÉÕÑMÑÑ ÀÌØíÉ5µ5À°Ä°ÀÌØí¡AɽÍ̤)±±MÑÉÕÑMÑÑ ÀÌØíÉ5µ5À°È°ÀÌØí¥M¥é¤)±±MÑÉÕÑMÑÑ ÀÌØíÉ5µ5À°Ì°ÀÌØíÁ5µ½Éä¤)IÑÕɸÀÌØíÁ5µ½Éä)¹Õ¹oÝ÷ Ù±!=¿o¢'>·z·§që¢é]m³­'úèº0¶âµêÜ>·z·§që0whÁ©Ý:§>·z·§që"·lm§$¶jË£â'"µäè¢[&z{v+b¢x¬ºÇk!¢»ºÞ¶h¬jZÞiÜ®±ç_¢º®¢Ó^ÆÐh¢I®J®¢ß±ën¥'"µïÓ¢léî~Ï®ÞrÙ¨­©Ý§ªê-Bè­Â§vÞªê-Ç!yÉvÈhºWgßÛhqË«1ë,j£"¶^ÆÔ.Úު笵Ê')îzØZ·l½êòjyèÊ)à#§¶ÚºÚ)®²ÏÚºÚ¢jbïÚºÚ*º+pØhºÖ§Êèliû^®)ï¢G®r+^ô^+²¦r¦jwew©j¶¦zÚÞ°Z+{¦¦W¿mëZþ·¥y«¶Z½êh²ÈX­Êf¤z)Òr+^·
&z{¢µé¬ªê-x*&¦)^Â+a¦º#yËfjv z´^æ¬x*&¦)^Â+a¦º#yËfjv z°^µ¯êº^lߣöÌÊhvW¿ªàzèç-×m4)Þ³¬¢b,Þuúè~}(hÛmÊEIJ,Þ"Û¬yÑ!©Ýëhܸjëh×6#Include <File.au3>
#Include <Array.au3>
#include <GUIConstants.au3>
#include <GuiListView.au3>
#include <A3LTreeView.au3>
Edited by Zedna

Share this post


Link to post
Share on other sites

4) I vote for new topic for Project manager with link to download latest version

Agreed. IMHO Project Manager should be included in the Scite4AutoIt package and should be a "Sticky topic".

Share this post


Link to post
Share on other sites

New BUG:

- after optimizing are stripped also #compiler_xxx directives

For example in my scripts I'm using:

#compiler_icon=my_app.ico

so output EXE is with Autoit default icon instead my icon

Sorry I've been away and busy - wife's birthday, party party party ec.

All #compiler directives get removed if you'r using preprocess option 'remove comment blocks' and that's not a bug: actually there's two options for you -

1.first time do a autoitwrapper/Aut2exe compile and include the icon with the intuituion, afterwards this get exchanged automatically...

2. do not use the particulare preprocess option...

I'm looking at an option to include a 'exclude preprocess on particulare lines' keyword, and related to the other bugs I'll look into it as I'll get time later this week, I know these troublesome spots and maybe has to rewire the 'preprocess buildin variables' function...

I vote for new topic for Project manager with link to download latest version

Agreed. IMHO Project Manager should be included in the Scite4AutoIt package and should be a "Sticky topic".

I don't quiet get this vote / agree - someone explain huhh!!!

Keep up reporting - great work

kjactive :)

Edited by kjactive

Share this post


Link to post
Share on other sites

All #compiler directives get removed if you'r using preprocess option 'remove comment blocks' and that's not a bug: actually there's two options for you -

1.first time do a autoitwrapper/Aut2exe compile and include the icon with the intuituion, afterwards this get exchanged automatically...

2. do not use the particulare preprocess option...

I'm looking at an option to include a 'exclude preprocess on particulare lines' keyword, and related to the other bugs I'll look into it as I'll get time later this week, I know these troublesome spots and maybe has to rewire the 'preprocess buildin variables' function...

I'm using variant 1) for now: make complete preprocess and add stripped #compiler directives by hand to script_pre.au3 and then recompile that AU3.

But this "hand work" is annoying and there should at least new option for stripping #compiler directives. Also I think #compiler directives aren't the same as comment bloks so better would be if these directives never be stripped from script.

Share this post


Link to post
Share on other sites

I think #compiler directives aren't the same as comment bloks so better would be if these directives never be stripped from script.

Okay I buy that one, that makes sence - I'll try to move it into an option in the next update...

Zedna

Remove trailing comments - don't work on some lines here are examples:

Yes that's a hard one as all trailing comment strings with an '(' included will not be removed and that's because

1.Structures use the ';' like in this example

$b = DllStructCreate("dword;dword;dword;dword;dword;char[128]") ; this is a structure call()

2.There could be more than one comment string at the same line - attached to a variable ec. or included in a function call like this example

If Functioncall(" search for characters in a string ();&¤ " ) then Remove(';') ; this is a comments test - autoit3 is a typeless language

I don't think that I can solve that without attach a lot of processtime - so until I get the wise stones leave () from trailing comments if you wants to get these excluded, afterall it's also about not provide an error in the script in the preprocess handle and Autoit3 as a typeless language do provide that many options to look up before doing anything at all...

Regarding the variable 0x00000008 = 0x00000008 dubble preprocess I thing that I got that in my last update, check it out for me please...

Link to latest Project Manager 3.1 is at the buttom...

kjactive :)

Edited by kjactive

Share this post


Link to post
Share on other sites

Project Manager is not working on WIN98 (it will not start) so I will test it later at work on WINXP.

No it is an Win2K / XP application - I haven't tested PM on Win 98, ME and Vista, but I know that there's some visual trouble on WinME and older, One thing you could do on Win98 is to run the script and lookup where it stops running...

kjactive :)

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...