VBParser samples

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

3 thoughts on “VBParser samples

  1. Steve D

    Hi Paul,

    I just took a quick peek at the source. It looks like your parse tree is made up of your own objects for statements, operators, etc. Would it have been possible (or better put — feasible) to parse into a CodeDom tree? Are there things in your vb parse tree which CodeDom wouldn’t have a concept for?

    Thanks

    -Steve

    Reply
  2. paulvick

    Yeah, the CodeDOM is not expressive enough for all of VB because it was designed to insulate users, for the most part, from differences in languages. An interesting sample that could be written is a CodeDOM to parse tree translator (and vice versa)…

    Reply
  3. alex

    Paul:(they call you Paul,I follow)

    Er,I’m a student ,now writing a compiler,and make parser parse codes with grammar files.And in V1.4, it makes a own parse tree, but in V2.0, I modified the grammar file’s structure and add some code like YACC, then the parse tree is to be a CodeDOM. If you can understood Chinese,here is my blog:

    http://blog.csdn.net/alexangel

    And I have a problem on generate the code of a event, it need me to generate a delegate class to handle this event. I do it ,but it does not work. So I need you help.

    You can mail me(SophiaAJackson@msn.com).

    Thanks.

    Reply

Leave a Reply