Syntax checker for VBS and VBS grammar for YACC/LEX 
Author Message
 Syntax checker for VBS and VBS grammar for YACC/LEX

I am looking for a program that will do a LINT style check of my Visual
Basic Scripts.  Things I am interesting in knowing are incorrect syntax,
unused variables , local variables having same name as global variables,
etc.  I am not interested in checking code that is imbedded in asp or html,
just raw scripts.

Anyone know of a program that does this?

Also does anyone know of where I can get a VBS grammar for YACC or LEX?

Thanks
Kevin Happe



Sun, 24 Jul 2005 01:02:11 GMT  
 Syntax checker for VBS and VBS grammar for YACC/LEX
Kevin,

I just love these questions.   I started playing with this last fall, and this
is a really intriguing area that has not been well-developed in VBScript.

I suppose I should give you the bad news now - answers in line.


Quote:
> I am looking for a program that will do a LINT style check of my Visual
> Basic Scripts.  Things I am interesting in knowing are incorrect syntax,
> unused variables , local variables having same name as global variables,
> etc.  I am not interested in checking code that is imbedded in asp or html,
> just raw scripts.

There is no such thing.  I have a rough framework for some of this - a couple of
parsing tools which can break down code into "tokens".  If you do a Google on
the topics "VBScript.Cooker" and "state machine" in the VBScript newsgroup, you
will find the things I was working on a few weeks back.

Quote:
> Anyone know of a program that does this?

> Also does anyone know of where I can get a VBS grammar for YACC or LEX?

There is none.  The VB family grammar in general is a horrendous mess since it
grew from a language family that existed before the advent of tools like Lexx
and yacc.  VBScript is a little cleaner, but isn't a LALR(1) or LALR(2)
grammar - you still need at elast 3 token look-ahead - and the compilers are all
hand-tuned.

There are apparently a couple of commercial attempts at grammars; VB.NET syntax
has been cleaned up substantially by Microsoft and has an almost-true grammar
posted on MSDN.  More to the point, there are some code-processing tools in the
.NET runtime which can help with this.  Unfortunately, they probably won't work
very well for VBScript.

Quote:
> Thanks
> Kevin Happe




Sun, 24 Jul 2005 05:42:34 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Searching postscript syntax and grammar in lex and yacc

2. YACC & lex grammar for postscript

3. Any syntax analyser for VB (LEX, YACC...)????

4. lex/yacc description of PostScript language

5. ANSI C ( or lex/yacc, flex/bison description ) implementation of Applesoft BASIC

6. Request for Lex, Yacc Spec. for Basic Language

7. LEX/YACC with VB?

8. LEX/YACC with VB?

9. Lex & Yacc problem

10. yacc-able grammar for VBScript?

11. PostScript yacc grammar

12. yacc grammar for basic ?

 

 
Powered by phpBB® Forum Software