Friday, October 9, 2009

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

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,

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!



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

  2. What stops you from pasting anything into the edit control?

  3. 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. 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}


    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

  5. 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.

  6. 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.

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


  8. 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

  9. That is really interesting, You are an overly professional blogger. I've joined your feed and look ahead to in search of extra of your wonderful post. Also, I have shared your site in my social networks

  10. Football, Peterson explained Friday, is a refuge and that s why he ll be on the field days after the boy s death in Sioux Falls, S. D.

  11. *Youre so cool! I dont suppose Ive read anything like this before. So nice to find somebody with some original thoughts on this subject. realy thank you for starting this up. this website is something that is needed on the web, someone with a little originality. useful job for bringing something new to the internet!

  12. I do not even understand how I stopped up here, but I assumed this post used to be great. I do not realize who you are but certainly you're going to a well-known blogger in case you are not already. Cheers!

  13. Howdy, I discovered your site through Yahoo and google while trying to find a identical theme, your internet site got here up, it looks to be such as excellent. We've included in my own favourites features.

  14. Hello my family representative! I want to claim that this particular article rocks !, awesome written and can include approximately most major infos. I'm going to observe extra discussions similar to this .

  15. Now i'm really empowered with all your crafting skills and even with all the design and style for your website free ebook. Is that this any compensated issue and also can you customize it yourself? In any case keep up the superior quality writing, it is really rare to discover an awesome site exactly like it currently.

  16. I blog quite often and I really thank you for your
    content. This great article has truly peaked my interest.
    I will take a note of your website and keep checking for new details about once a
    week. I opted in for your RSS feed too.

  17. Appreciating the commitment you put into your blog and in depth
    information you provide. It's nice to come across a blog every once in a while that isn't the same unwanted rehashed material.
    Fantastic read! I've saved your site and I'm including your RSS
    feeds to my Google account.

  18. Have you ever considered creating an e-book or guest authoring on other
    sites? I have a blog centered on the same ideas you discuss and would love to have you share some
    stories/information. I know my audience would value your
    work. If you are even remotely interested, feel free to send me an e-mail.

    my site ... Dragons Rise Of Berk Hack

  19. If some one desires expert view about blogging and
    site-building afterward i suggest him/her
    to pay a quick visit this website, Keep up the fastidious work.

    My blog :: castle clash hack

  20. You can definitely see your enthusiasm within the work you write.
    The world hopes for even more passionate writers like
    you who are not afraid to say how they believe. All the time go after your heart.

    Feel free to visit my blog - Speedy Ninja Cheats

  21. Thanks for some other wonderful post. The place
    else may anyone get that type of information in such a perfect
    manner of writing? I have a presentation subsequent week, and I'm on the look for such

    My web blog; Kill shot cheats

  22. Therefore, whether ad producers, brand name shapers, copywriters,
    and programmers are voting or watchers and finding, seeing, and sharing YouTube video ads, there's much that movie marketers can learn from 80% regarding the top advertisements and the
    trends that comprise them.

    Here is my webpage :: Leia