VBSlacker - Design Specification

Parser

Introduction

The VBSlacker Parser, to put it simply, is a Visual Basic language interpreter that converts Visual Basic compatible source-code into C. It relies on VBSlacker's BasicLIB library for many of the C functions calls that it generates from interpretation. The parser is also responsible for interpreting NON-VB files such as…

Overview

The parser will be nothing more than a command-line application…much like gcc, awk, and so forth. It will have various command-line arguments for various parsing options, and also options to pass to the C compiler that it will eventually spawn to.

From here on out, the parser will be referred to as 'vbs'.

Below is a diagram of the interpretation procedure…

  1. vbs (converts to C code)
  2. gcc/egcs/some C compiler
  3. link with BasicLIB and other libraries
  4. final executable

Source Code Structure

'vbs' will be written in C++ given it's object oriented structure. Below is the internal class structure...

CvbsProject (Base Class)

This class is a base class for all project types. It includes code that parses .VBP files, and creates appropriate CvbsModule instances based on the modules it finds in the project.

Derived Classes...

CvbsActiveX_EXE
CvbsActiveX_OCX
CvbsActiveX_DLL
CvbsStandard_EXE

CvbsModule (Base Class)

All Visual Basic module classes are based on this class. It includes standard parsing code, plus the ability to override for special parsing of special modules like Forms, etc...

Derived Classes...

CvbsBAS_Module
CvbsForm_Module
CvbsClass_Module