|Look for a LALR grammar for visual basic email@example.com (Thierry Supplisson) (1997-08-16)|
|Re: Look for a LALR grammar for visual basic firstname.lastname@example.org (Scott Stanchfield) (1997-08-19)|
|Re: Look for a LALR grammar for visual basic email@example.com (1997-08-20)|
|Re: Look for a LALR grammar for visual basic firstname.lastname@example.org (1997-08-24)|
|Re: Look for a LALR grammar for visual basic email@example.com (Scott Stanchfield) (1997-09-07)|
|Re: Look for a LALR grammar for visual basic firstname.lastname@example.org (1997-09-12)|
|From:||Scott Stanchfield <email@example.com>|
|Date:||19 Aug 1997 22:52:45 -0400|
When I worked at McCabe & Associates I wrote a Visual basic parser using
It's definitely not public domain, but if you're so inclined, you might
want to contact my old boss there, firstname.lastname@example.org and see if
they might be interested in helping you.
Unfornately, my NDA with them prevents me from saying much more about
it... I think I can say that it was a fairly nasty beast in some areas:
IF x = 1 THEN
100: END IF
which would complicate a grammar significantly (yes, VB allows a label
on things like "END IF" -- yuck!
A trick I've used for several projects (at home and in various jobs) is
to create a wrapper for yylex that acts like a token buffer. (You need
to rename the lex-generated yylex, and name the buffer yylex, calling
the renamed yylex.) This buffer watches for a few combinations of
tokens and modifies the set of tokens that the parser will see.
Sometimes it will merge several real tokens into one "metatoken;" other
times it will insert dummy tokens in the token stream. Both tricks can
make the grammar much cleaner and simpler.
In Visual Basic, things like "END IF" become a single ENDIF token, "NEXT
X,Y" becomes "NEXT X : NEXT Y" and so on. (In the above example, you
could change "LABEL END IF" to LABELLED_ENDIF so it can't conflict with
the "LABEL END" in the body of the if statement.
Thierry Supplisson wrote:
> Hi everybody !
> Has someone heard about a yacc grammar for microsoft visual basic?
Return to the
Search the comp.compilers archives again.