Unicode Migration Statistics Tool
This utility will hopefully assist you in collecting useful statistics
on how hard (or not) it would be to migrate your older applications to
Unicode.
Parser.exe is based on Jacob Thurman’s work, and should support Pascal
code all the way back to the early days. It may have some issues with
some really old and esoteric syntax.
Please take it for a spin and give me some feedback. I’d like to know
if it helps you, and if so - how?
When you first launch the app, you will have to specify a directory
where the source code you’d like to analyze lives. You can choose to
process sub directories or not.
Hit "Process files" and let it run. You’ll see the tool logging processed
files as it goes.
If you run into an ERROR (it gives a line number) it most likely ran
into some syntax that it doesn’t like. Don’t worry about that. At least
not yet…
Once finished, the treeview at the bottom will be populated. It’ll list
all used units (and how many times each one was used), number of files,
number of lines, and number of instances of quite a few things that may
or may not be interesting to you, such as String, Read, Write, SizeOf,
etc.
Each node can be expanded and this is where it gets interesting. You’ll
notice number of instances of each token per file and as a percentage
of all instances of that token found.
Should you be daring enough to want stats on your own custom tokens,
feel free to put them in the box that says "GetTempFileNameA" and hit
"Add Token". Nothing will happen quite yet. Add as many tokens as you
want, hitting "Add Token" between each one. Then hit "Process files"
again and you will get your custom stats added to the tree view.
Oh, BTW, "Save Report" simply saves a flat version of the tree view
to a file.
Good luck, enjoy, and let me know how it goes!
Thanks!
October 9th, 2009 at 10:13 pm
It would be nice if I could paste the path directly into the edit control instead of having to use the change button.
October 10th, 2009 at 4:47 am
What stops you from pasting anything into the edit control?
October 10th, 2009 at 5:33 pm
Hi. That is interesting but how do we know which tokens are most likely to be a problem? Is there a list of functions or tokens which are known problems with Unicode?
October 11th, 2009 at 12:07 pm
ya, what David Said!
October 11th, 2009 at 9:05 pm
I run the app but get the following error, somewhere in the middle of the process:
‘Interface’ expected found ‘end of file’
Processing file: C:\Dev2005\Thirdparty\Encryption\TPLockBox\source\LbKeyEd1.pas
This error pops up because of an include file:
————————————
unit LbKeyEd1;
{$R *.dfm}
{$I LbKeyEd1.inc}
————————————
But for the rest, moving my application, which already supports Unicode with TMS Unicode controls, will be a difficult task…
1982 SizeOf
2063 Length
306 FillChar
363 Move
658 Char
1791 PChar
245 AnsiChar
677 PAnsiChar
6631 String
16 ShortString
82 Chr
742 Ord
118 SaveToFile
173 LoadFromFile
8764 Read
65 ReadBuffer
7329 Write
78 WriteBuffer
8 MultiByteToWideChar
0 AppendStr
325 GetProcAddress
2 CreateProcess
655 Copy
68 Seek
3134 Pointer
21 AllocMem
108 GetMem
9 StrAlloc
2 AnsiStrAlloc
2340 @ operators
9374 ^ operators
November 3rd, 2009 at 12:30 pm
Bug detected: Unfortunatly it does not work for after a I pasted directory path into Edit nad pressed Process.
But it works if directory was chosen from a dialog.
November 18th, 2009 at 10:39 pm
Hi,
I tried your tool on our main project and it seems to hang on a specific file
(some kind of endless loop).
The file just contains some constants (arrays of records) for predefined IIR filters.
I can mail you the file if you are interested the endless loop problem.
November 20th, 2009 at 8:27 am
Yes, please send me that file. That would be great!
Thanks!
September 16th, 2011 at 8:25 am
I got the report using the tool what do I do with that? It would be better if the tool gives any suggestion for each file/line