General purpose, real-world object-oriented BASIC programming language project. |
|||
Table of Contents
(C)
Copyright 2001 Alex Iliasov
|
Lemick Basic is a Basic-like programming with support of object-oriented programming. It is entirely written in C with YACC parser and Lex scanner. Current version isn't a native code compiler and depends on external C compiler that understands ANSI C. Lemick Basic (LB) was designed as a powerful tool for programming on unices that would benefit from simplicity of Basic syntax and performance of C compiler. Here is an outline of LB features:
class in LB consist of a set of properties and methods. Properties and methods of class are class members, class members could be public or private. Properties are variables defined inside of the class and methods are subroutines and functions of the class. There two special methods - constructor and destructor - usually they are invoked implicitly. functions in LB could be overloaded - that means you can have two functions with the same name but different set of formal parameters. Compiler can differentiate between them and generate appropriate call. In addition to this constructors that are implicitly used in variable declaration can be also overloaded. the class could be inherited from one or more classes; that means it will have all the functions and properties of the parent classes and can be used anywhere instead of parent classes (down-compatible with all the parents). LB doesn't follow C++ scheme of calling destructors at the end of declaration scope, instead it collects garbage when and where it's convenient - destructors are never called explicitly; it's almost like Java's finalize(). This allows more straightforward concept of OOP (in my own opinion).GC (garbage collection) is also used in string operations to hold temporary values and etc. LB is a modern general purpose programming language and thus has a lot of features to be useful for users: dynamic and static arrays, automatically resizing arrays, arrays with check of subscript range, wrap of subscript range ant etc. User defined types (a variation of class with the only method - constructor). Optional parameters of functions, external functions from compiled static and dynamic libraries and raw C code. Passing to functions and returning parameters of any type and class (class of variable could be const, scalar, array, function and etc.);multithreading: functions/subroutines could be declared to run in separate thread. Every data declared statically or dynamically is always initialized somehow - by user-defined constructor or by automatically generated one. |
||