Re: Looking for BNF notation for Visual Basic and Java

"Scott Nicol" <snicol@apk.net>
8 Sep 2002 22:36:20 -0400

          From comp.compilers

Related articles
Looking for BNF notation for Visual Basic and Java ecollar@qwest.net (Emilio Collar, Jr.) (2002-09-03)
Re: Looking for BNF notation for Visual Basic and Java jeremy@jdyallop.freeserve.co.uk (Jeremy Yallop) (2002-09-08)
Re: Looking for BNF notation for Visual Basic and Java snicol@apk.net (Scott Nicol) (2002-09-08)
Re: Looking for BNF notation for Visual Basic and Java snicol@apk.net (Scott Nicol) (2002-09-12)
| List of all articles for this month |

From: "Scott Nicol" <snicol@apk.net>
Newsgroups: comp.compilers
Date: 8 Sep 2002 22:36:20 -0400
Organization: APK Net
References: 02-09-016
Keywords: parse
Posted-Date: 08 Sep 2002 22:36:20 EDT

"Emilio Collar, Jr." <ecollar@qwest.net> wrote in message
>I am looking for a source(s) for the Backus-Naur Form notation for
>Visual Basic and Java.


As the moderator wrote, java is easy - just take a java YACC grammar and
translate to BNF.


As for VB, there may be two answers.


At a previous job I wrote a VB clone. This was kept current, from VB2
through VB6. When I originally wrote it, I had to reverse-engineer the VB2
grammar from writing sample programs - you can't trust the manual, it's
often wrong. It took a lot of effort to get this particular grammar
written, because the grammar has a lot of hard-to-parse constructs. Given
this, and the fact that VB6 is a development from an adhoc parser (previous
versions of VB, which are based on qbasic, which is based on Microsoft PC
basic, which is based on Microsoft basic), I'd venture a guess that a BNF
for VB6 does not exist, even deep in the bowels of Microsoft.


VB.net might be a different animal. Although I never wrote a clone of this,
the reports (and complaints!) from users indicate that Microsoft took out a
lot of the funky hard-to-parse stuff, which might mean that Microsoft
started from scratch and wrote a yacc-able parser for this beast. Obtaining
the BNF might not be so easy, though...


--
Scott Nicol
snicol@apk.net


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.