It occurred to me the other day that my old VBParser samples for VB 7.1 and VB 8.0 had gotten lost in the ether somewhere along the line and were no longer on my website anywhere. So I dug up the sources and added them to my GitHub profile. I kind of seriously doubt that they’re a lot of use anymore, given that they are at least, what, three versions out of date now? But who knows?
You should also follow me on Twitter here.
OK, it took a while, but my updated version of the VBParser source code sample is finally up! Since the 7.1 version of VBParser ended up being essentially a read-only project on GotDotNet, I’ve decided to eschew GDN and just go with a straight source download. I’ve added a new set of links on the left hand side of my blog entitled “Samples,” and put both the 7.1 and 8.0 version of VBParser there.
Things that are new or changed in VBParser 8.0:
- I’ve updated the source to take advantage of VB 8.0 features such as generics, IsNot, etc. Because of this, VBParser 8.0 is not API compatible with VBParser 7.1. Any code that’s built with VBParser 7.1 will need to be updated, but it shouldn’t be too painful of a task.
- As the name implies, VBParser 8.0 should parse all of the new VB 8.0 features. There is also a 7.1 compatibility mode that you can use to parse VB 7.1 code (which is a strict subset of VB 8.0).
- This is a sample that I wrote on my own, which means that the only testing that it got was the testing that I did on my own. As such, there are no guarantees made of completeness, correctness or suitability for any particular purpose. I did try my best to make sure that it works well, but you should consider the sample as being in permanent beta. There may be stupid bugs still lurking in the source.
- Please drop me a line with any and all bugs that you find and I’ll be happy to take a look at them and fix them as time permits. If you end up using VBParser for something, let me know!
You can get VBParser 8.0 here. [07/12/2014: The sources for VBParser 8.0 are now on GitHub.] You can get VBParser 7.1 (the previous version) here. [07/12/2014: The sources for VBParser 7.1 are now on GitHub.] Hope people find it useful!
Just a FYI, I’ve changed the title of the “VBParser” category to “Samples,” in preparation for what I hope are several new samples in the coming months. The main thing I’ve been working on so far is an update of the VBParser sample that I wrote for VB 7.1. Besides updating the parser to parse VB 8.0 language features, I’ve also changed it to use nifty CLR 2.0 features like generics. My hope is to have it out in the next few weeks. Unlike last time, I don’t think I’m going to use GotDotNet as a distribution medium — since no one added anything to the project, I’m just going to distribute it directly and let people mail me bugs and such if they wish. Beyond the parser, I’m thinking about some samples that might fit in with LINQ, but we’ll just have to see…
I’ve updated the
GotDotNet workspaces for VBParser [07/12/2014: The sources are now on GitHub.] with what I’m calling “Beta 2″ of the parser source. This fixes all the reported bugs as well as includes a small “conformance” application that I wrote to test the parser and allow some ad hoc testing. Probably the biggest change in this release was changing the way comments were parsed to make them actually work (I hope). I’m still trying to find some time to write an interesting sample using the parser… (And, of course, I need to start updating it for VB2005…)
Let me just add something that many people seem to already know: GotDotNet workspaces are, uh, not that wonderful. I’ve had a lot of trouble with it, so I’m considering alternatives. Given that the model so far has been people report bugs and I fix them, I may just go to distributing the sources and binaries as zip files on my website. Anyone care?
I’ve gotten a bunch of requests for sample code to show how to use VBParser, and I have to apologize for not providing that off the bat. It came down to a choice between releasing the library as-is or taking some extra time to put together some samples and then releasing it, and I ended up deciding it was better to just get it out there. I’m planning to work on some simple samples and adding them to the workspace, or others can feel free to join the workspace and do so. [07/12/2014: The sources are now on GitHub.] I realize that it can be a bit difficult to figure out where to start!
I did get trackback from the overflow blog pointing to a sample application that he wrote to explore parse trees, so that might function in a pinch (disclaimer: I haven’t looked at the sample code, so I have no idea how comprehensible it is).
Bill pointed out that I didn’t have a nice zipped up source release to go with the binary, so I added one. [07/12/2014: The sources are now on GitHub.] It looks like people were starting to join the workspace just so they could get the source, so I just declined them for now so people could pick up the source zip if that’s all they wanted. If you want to join the workspace to make contributions, just reapply. The more the merrier!
When I started this blog a year ago, one of the things that I mentioned that I was working on in my spare time was a scanner and parser for the Visual Basic language. It’s kind of been on the back burner, behind things like VB 2005 and the book, but it’s finally gotten complete enough to release! I created a
GotDotNet workspace [07/12/2014: The sources are now on GitHub.] for the code, and there’s a binary release there as well.
I’m calling this release a “beta” because although I’ve run my own tests on it, I haven’t subjected it to enough stress to be 100% confident in it. (Keep in mind: this is just a sample that I’ve worked on in my own time. It’s not an official Microsoft thing, so I’m the developer and tester.) If you find bugs, feel free to submit them to the workspace and I’ll see about getting them fixed. If you’d like to contribute something, sign up for the workspace! For now, the parser only supports the language we shipped in VB 2003. As time goes on, I’ll look into extending it for VB 2005.
The goal of the parser, besides being a fun side project in VB for me, is to be available to anyone who might want or need to scan or parse VB code. I’m hoping it will encourage people to write tools that work with VB code, and I have a few ideas of my own… Once I get some more time to spend on other side projects, that is. I’m not holding my breath…