Analyzer 2.0b for V4

Developed or developing a new product in PureBasic? Tell the world about it.
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Analyzer 2.0b for V4

Post by #NULL »

changes.txt wrote:2018-12-31, analyzer version 3.2

- fixed false detection of line concatenation via colon in !asm lines
- EnumerationBinary now recognized as a keyword
- files 'common.pb' and 'mergeTool.pb' now UTF-8 with BOM like the other files
Download:
http://www.wannabephoenix.de/PB/analyze ... alyzer.zip

I can now run that code with analyzer. But the asm lines are ignored and not measured individually. I guess that's reasonable :) But of course the calls of the functions containing asm are being measured as usual. Or you could measure asm as a block.
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Analyzer 2.0b for V4

Post by Little John »

#NULL wrote:I can now run that code with analyzer.
Same here. Thank you for the update!

Unfortunately, now I'm encountering another issue.
When running this small demo program (with PB 5.70 beta 4 on Windows 10)

Code: Select all

XIncludeFile #PB_Compiler_Home + "..\libs\string.pbi"

x = 3
then I get this result
Analyzer 3.2 For PB570
loading preferences : C:\Users\LJ\Desktop\Analyzer\analyzer.ini
file : C:\Users\LJ\AppData\Local\Temp\PB_EditorOutput.pb
compile/run with analyzer?
[Continue]
mainfile : C:\Users\LJ\Desktop\analyzer_test.pb
base include path : C:\Users\LJ\Desktop\
merging include files..

mergeTool
------------
mainfile : C:\Users\LJ\AppData\Local\Temp\PB_EditorOutput.pb
orig. file : C:\Users\LJ\Desktop\analyzer_test.pb
baseIncPath : C:\Users\LJ\Desktop\
------------
fileName : C:\Users\LJ\Desktop\PB_Compiler_Home + "..\libs\string.pbi
baseIncPath : C:\Users\LJ\Desktop\PB_Compiler_Home + "..\libs\
can't read file : C:\Users\LJ\Desktop\PB_Compiler_Home + "..\libs\string.pbi
failed to include file : C:\Users\LJ\Desktop\PB_Compiler_Home + "..\libs\string.pbi
------------
------------
merge failed.

merge failed. program will compile/run without analyzer.
The red paths are wrong, the compiler is located elsewhere. Additionally, the red paths contain only one (i.e. unbalanced) quote.


I also stumbled across another small issue.
Normally, I don't use

Code: Select all

XIncludeFile #PB_Compiler_Home + "..\libs\string.pbi"
as above, but

Code: Select all

XIncludeFile #PB_Compiler_Home + "../libs/string.pbi"
Using forward slashs, the code runs without modifications on Windows and Linux.
It seems that Analyzer doesn't like that on Windows. After changing the above code to

Code: Select all

XIncludeFile #PB_Compiler_Home + "../libs/string.pbi"

x = 3
I get this result
baseIncPath : C:\Users\LJ\Desktop\PB_Compiler_Home + "../libs/\
I don't know whether this causes a problem, or whether this is only a cosmetic issue in the output.
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Analyzer 2.0b for V4

Post by #NULL »

changes.txt wrote:2019-01-18, analyzer version 3.3

- include statements with basic string concatenation are supported by the merge tool
- constant #PB_Compiler_Home in include statements is being resolved by the merge tool
- new preferences setting 'lastPbToolCompiler'
Download:
http://www.wannabephoenix.de/PB/analyze ... alyzer.zip

#PB_Compiler_Home and string concatenation should work now in include statements.
The closing of the path (the ../libs/\ issue) should now detect if the path is already closed with a forward slash on Windows. Not sure if that would have been a problem (repeated path separators might just be ignored by Windows), it didn't get that far with the unresolved compiler home.
m4u
New User
New User
Posts: 5
Joined: Mon Dec 31, 2018 8:47 am

Re: Analyzer 2.0b for V4

Post by m4u »

Great job. Thank you.
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Analyzer 2.0b for V4

Post by Little John »

#NULL, many thanks for all your work!

Unfortunately, this new version still does not work for me.
The following snippet shows the problem.

Code: Select all

DeclareModule Math
   #Epsilon = 0.000001
   
   Macro AreSame (_a_, _b_, _eps_=Math::#Epsilon)
      ; for comparing floating point numbers
      Bool(Abs((_a_)-(_b_)) < _eps_)
   EndMacro
EndDeclareModule   

Module Math
EndModule   

Debug Math::AreSame(0.0001000, 0.0001001)
Analyzer wrote:Zeile 794: Syntax-Fehler.
Lines 794 and 795 in "PB_EditorOutput.pb" read:

Code: Select all

Macro AreSame (_a_, _b_, _eps_=Math
#Epsilon)
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Analyzer 2.0b for V4

Post by #NULL »

I forgot mod::#const :)
changes wrote:2019-01-20, analyzer version 3.4

- detect module operator (instead of spitting the line) if followed by '#' (i.e. 'mod::#const')
Should work now.

BTW, fun fact, valid PB (or lets say it works, also with module):

Code: Select all

#  con1 = 111
Debug # con1
Debug Defined(con1, #PB_Constant)
Debug ""
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Analyzer 2.0b for V4

Post by Little John »

Runs fine now here ... very cool! 8)
Thanks a lot!
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Analyzer 2.0b for V4

Post by Little John »

Hi,

I'm sorry for reporting an issue again.
#NULL wrote:- detect module operator (instead of spitting the line) if followed by '#' (i.e. 'mod::#const')
There still seems to be a problem when the module operator is followed by '*'.
Here is a small test code, extracted from my ListSort module:

Code: Select all

DeclareModule CS
   NewList *ptr()
   
   Macro SortListAny (_list_)
      ForEach _list_
         AddElement(CS::*ptr())
         CS::*ptr() = @ _list_
      Next
   EndMacro
EndDeclareModule

Module CS
EndModule

NewList Foo()
CS::SortListAny(Foo())
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Analyzer 2.0b for V4

Post by #NULL »

No need to be sorry :D . I'm happy to improve it. Thanks for testing and reporting!
changes wrote:2019-01-28, analyzer version 3.5

- detect module operator if followed by '*' (i.e. 'mod::*ptr')
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Analyzer 2.0b for V4

Post by Little John »

Thank you for the new version 3.5! :-)
Fredi
Enthusiast
Enthusiast
Posts: 143
Joined: Wed Jul 23, 2008 10:45 pm

Re: Analyzer 2.0b for V4

Post by Fredi »

I using v3.5 with PB5.71 but when run any code get this error message in Analyzer:

Code: Select all

no utf-8 bom found in template.
program will compile/run without analyzer.
Tested at PB both file format encoding "Plain Text" and "Utf8" and result is same
what's the problem?
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Analyzer 2.0b for V4

Post by #NULL »

I just tried with the download from above (analyzer 3.5) on Linux and Windows. I tried both the binary/executable that comes with the download as well as recompiling analyzerTool.pb to a new binary/executable to use as a tool. Everything seems to work.
Is it possible you opened analyzerRuntime.pb and accidentally saved it in another format? Does the precompiled binary/executable work?
Post Reply