Page 2 of 2 FirstFirst 12
Results 41 to 46 of 46

Thread: VB6 Automated Source Code Processing Helper

  1. #41
    PowerPoster
    Join Date
    Jan 2020
    Posts
    2,274

    Re: VB6 Automated Source Code Processing Helper

    vbflexgrid
    VbPcre2

    What automated code downloads multiple projects from open source websites or multiple download addresses, and then compiles them into multiple DLLs.

  2. #42
    PowerPoster
    Join Date
    Jan 2020
    Posts
    2,274

    Re: VB6 Automated Source Code Processing Helper

    The primary goal of this project is to have a comprehensive wrapper for PCRE2 in an ActiveX DLL for use in VB6 or other COM supporting languages.

    The secondary goal of this project is to be a drop-in replacement for the VBSscript RegExp object.
    Can also use the regular expression of JS? Which of these three methods is faster? It's more convenient.

  3. #43

    Thread Starter
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,271

    Re: VB6 Automated Source Code Processing Helper

    Quote Originally Posted by xiaoyao View Post
    If you can provide the complete source code, don't use other DLLs.
    Sorry, but my stuff probably isn't going to be of interest to you if you don't want to use other DLLs/OCXs. I almost always use at least RC5/RC6 in the stuff I publish, because it saves a lot of time and hassle, and I don't mind having the dependency.

    Quote Originally Posted by xiaoyao View Post
    If you can implement all the lexical analysis of the source code, and even add new syntax, that would be perfect.
    That's going way beyond the scope of the goal of this project. It's only intended to give you access to the logical lines of your source (with a bit of extra metadata to help you determine the type of line) so you can make pattern based substitutions, test for things that don't meet your coding standards, automatically insert boilerplate code, etc... So it's "dumb" on purposes - the brains are the ISourceProcessor implementing classes that you write yourself to do whatever you want with the code.

    Quote Originally Posted by xiaoyao View Post
    If you use multithreading, the speed should be several times faster, right? For example, a CPU with 6 cores uses 12 multithreads for processing.
    Multithreading is a possibility that I might look into...it adds some complexity, and I'm not sure whether the overhead will guarantee a massive win, but it might be worth a try.

  4. #44

    Thread Starter
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,271

    Re: VB6 Automated Source Code Processing Helper

    Quote Originally Posted by xiaoyao View Post
    The primary goal of this project is to have a comprehensive wrapper for PCRE2 in an ActiveX DLL for use in VB6 or other COM supporting languages.

    The secondary goal of this project is to be a drop-in replacement for the VBSscript RegExp object.
    Can also use the regular expression of JS? Which of these three methods is faster? It's more convenient.
    There's a thread comparing the speed of various regex engines here starting here: https://www.vbforums.com/showthread....=1#post5444643

    VBPCRE2 does not perform very well - I need take a pass at optimizing it, but I haven't had the time/inclination. Instead, the minimal PCRE2 (.BAS modules only, no Classes) performs much better: https://www.vbforums.com/showthread....=1#post5444745

    That said, it might depend on your workload which engine does the best (although it looks like @wqweto's vbPeg (introduced in this post) kicks some serious "you know what".

  5. #45
    PowerPoster
    Join Date
    Jan 2020
    Posts
    2,274

    Re: VB6 Automated Source Code Processing Helper

    VbPcre2,There is no problem with this source code. At first, I thought I needed to download something I didn't know.
    In the past, I downloaded web pages to collect commodity information in my own way, and the code often needs to be modified. If I use real expressions, I just need to make a regular expression formula table.
    It would also be convenient if you could parse VB6 project files with regular expressions. There are also control properties for the form file.

    Every function, every procedure, every program code can be parsed with regular expressions, which is also very convenient.

  6. #46
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,107

    Re: VB6 Automated Source Code Processing Helper

    Quote Originally Posted by jpbro View Post
    Thanks @SDO - it's still very much a work in progress, so make sure you have backups before you use it on your important stuff!

    Also, you might want to wait an hour or two before you spend some time with it, I have another update coming shortly.
    Quote Originally Posted by jpbro View Post
    I just updated the source code in the first post.

    I primarily focused on performance improvements for this release, so the biggest feature of the latest version is that it is significantly more efficient. On my machine, the example processor now takes about 4 minutes for a project with almost 1000 source files and approximately 775,000 lines. The previous version took about 14 minutes, so not bad! This was achieved through a few means:

    • I removed the dependency on the class based VBPCRE2.dll PCRE2 wrapper, and I am now using a minimal straight to pcre2-16.dll .BAS wrapper.
    • I swapped out some RC6.cArrayList use for plain-old VB6 String Arrays. The cArrayList was overkill because I'm not inserting/adding/removing elements which are activities where the cArrayList really shines.
    • I took some logic out of the VB6 code for finding lines and moved it into SQL statements (and added some hopefully useful indexes for the queries to work against, though I haven't had time to check the query plans).
    • Enabled all the usual compiler optimizations.
    • Mapped the source code string data to in integer SafeArray. Loops/tests are against the array which avoids a lot of string operations/comparisons.


    I also fixed a few more bugs and added some other niceties:

    • Better progress and elapsed time indicators on the Progress window.
    • Added total source lines count the Stats tab.
    • The Log tab now auto updates to show the # of rows as log level types are toggled on/off.
    • I've added a System folder where you should drop pcre2-16.dll. VBPCRE2.dll is no longer required.


    I think that's everything for now, enjoy
    I tested VB6SourceProcessor4 and it worked very well. I scanned my projects with it and it checked out that one of my cls files was stored in the wrong path, which was great.

    A few months ago, an important file in one of my projects was stored in the wrong path (c:\windows\system), and when I reinstalled windows, the file was lost.

    Now, VB6SourceProcessor4 has helped me avoid similar pitfalls.

    Also, the day before yesterday, I found a small bug in VB6SourceProcessor2, and I was about to report it, but this bug no longer exists in VB6SourceProcessor4.

    You shared another outstanding tool, just like you did before. I believe VB6SourceProcessor will be of great help to my new project (a project analysis tool), thank you, jpbro.
    Last edited by SearchingDataOnly; Mar 23rd, 2023 at 10:02 PM.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width