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.

Source code is included.

Good luck, enjoy, and let me know how it goes!

Thanks!

9 Responses to “Unicode Migration Statistics Tool”

  1. noz Says:

    It would be nice if I could paste the path directly into the edit control instead of having to use the change button.

  2. Anders Ohlsson Says:

    What stops you from pasting anything into the edit control?

  3. David Says:

    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?

  4. Shane Says:

    ya, what David Said!

  5. Bas Says:

    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

  6. Aleksey Timohin Says:

    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.

  7. Mike Says:

    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.

  8. Anders Ohlsson Says:

    Yes, please send me that file. That would be great!

    Thanks!

  9. Kiran Mahale Says:

    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

Leave a Reply


Bad Behavior has blocked 512 access attempts in the last 7 days.

Close