I've done a fair bit of googling, but I've been unable to find what I'm looking for. I am looking for documentation of the syntax to the Visual Basic 6.0 language. Specifically something that could theoretically be used to build a parser for the syntax. Does anyone know of such documentation?
There is some information in the VB documentation, but it isn't really a grammar. We had to build one from scratch for our VB6 parser. http://www.semdesigns.com/Products/FrontEnds
I would start with the Visual Basic Reference from MSDN. I don't see a formal grammar specification, but it might be in there somewhere.
To take another stab at this based on a comment I left elsewhere, I found a grammar for VBScript on the Web you might at least take a look at.
This is about as close as I have seen to a formal grammar for VB6 though of course it isn't for VB6 at all.
I'm sure from comments within it there are a few issues, and of course VBScript is missing things like strong typing and statement labels and differs from VB6 in a number of other ways. It also isn't "official" in any way. You might still find it at least somewhat useful however.
Go to C# GOLD Parser Engine and scroll to the bottom of the page for the ZIP download containing this guy's VBScript grammar in BNF.
While not VB6 I would look through the VB section of the Mono Project and the stuff that FreeBasic People are going. Of the two FreeBasic is the closer as VB.NET add a lot of syntax while the QuickBASIC syntax that FreeBASIC uses is the progenitor of VB6.
You have to remember that VB6 is problematical to parse because of the extra information inserted in the form and classes. They are not part of the language exactly but rather used by the IDE when compiling a VB6 program. Nobody I know has created a grammar for this. Although it is a fairly simple structure.
The VBA language specification is online on MSDN. It must be 99% equivalent to VB6.
VB6 has a couple of file formats: forms, classes, modules, frx-files. There's a lot of grammars. I don't think someone ever tried to write them out.