From: Randy O'Reilly Newsgroups: comp.archives Subject: [comp.lang.c++] ANNOUNCE: C/C++ Interpreter, RTTI System Date: 21 Jun 1995 06:29:39 GMT Archive-name: auto/comp.lang.c++/ANNOUNCE_C_C_Interpreter_RTTI_System ANNOUNCING: TypeAccess and C-Super-Script (CSS) Version: 1.0 beta Authors: Randall C. O'Reilly and Chadley K. Dawson TypeAccess (TA) is a RTTI (run-time type information) system for C++. It scans header files for 'typedef' and 'class' definitions and produces a compilable file that will allow classes to access their own type information. CSS is a C/C++ interpreter with a built-in command interface for controlling the execution and debugging of programs. It can be used as a stand-alone C/C++ interpreter for tasks where Perl, TCL, or compiled C/C++ would otherwise be used, and as a script interface to a specific C or C++ application. Its primary advantages over existing languages are the use of a standard language syntax (C/C++), and its ability to automatically interface with hard-coded C++ objects via TypeAccess. TA/CSS was developed for a neural network simulation system called PDP++. It can be obtained either with the entire PDP++ software distribution (which gives you lots of example code..) or as a subset that just has TA and CSS related files. The software can be obtained by anonymous ftp from: Anonymous FTP Site: hydra.psy.cmu.edu/pub/pdp++ For more information, see our web page: WWW Page: http://www.cs.cmu.edu/Web/Groups/CNBC/PDP++/PDP++-ta_css.html Features of TA/CSS: =================== What makes TypeAccess different from other RTTI systems is that it has an extensive "automatic" interface system build around it. This interface includes a GUI "edit dialog" system based on the InterViews toolkit that allows the user to view and modify class members, and call class methods via buttons and pull-down menus. The properties of this interface are controlled by "comment directives" that can be placed by the programmer in the source-code comments next to class, member, and method definitions/declarations. These directives are parsed by the TypeAccess system and recorded along with the type information. They are also available for application-specific uses. TypeAccess interfaces with CSS to allow "automatic" access to hard-coded classes via a script interface. Since CSS is C/C++, code can initially be developed in the interpreter and then compiled into the application once debugged and tested with little or no modification. Essentially, TA and CSS together provide a flexible GUI and script interface to C++ objects. This makes it possible for the programmer to develop a set of C++ classes that just perform application-specific functions, without having to worry about the interface much at all. The user of such an application has the advantage of being able to access all of the functionality of the hard-coded objects, and to extend this functionality by writing their own script code in CSS. TA/CSS provides a "type-aware" base class type, and a number of container classes (Arrays, Lists, Groups) that use the type information from TypeAccess to perform various specialized interface and other functions. By using such classes, one can also take advantage of automatic "dump" file saving and loading functions. Thus, complex structures of C++ objects can be saved to an ASCII file and loaded back in later. This takes care of yet another bothersome programming task. CSS "compiles" source code into a machine code of C++ objects, which then know how to run themselves. The range of functions that any object can perform is defined in a 'cssEl' base class, and derived types implement functions for specific data and function types. This object-oriented machine implementation straightforward, and offers reasonable performance since different data types are implemented directly (e.g., everything is not a string like in TCL). The code for CSS compiles into a 800K library on a sparc station. The Fine Print: =============== The software runs on Unix workstations under XWindows. It has been developed and tested on Sun Sparc's under SunOs 4.1.3, HP 7xx under HP-UX 9.x, and SGI Irix 5.3. Statically linked binaries are available for these machines. Other machine types will require compiling from the source. Cfront 3.x and g++ 2.6.3 are supported C++ compilers. The GUI in TA/CSS is based on the InterViews toolkit, version 3.2a. However, we had to patch it to get it to work. We distribute pre-compiled libraries containing these patches for the above architectures. For architectures other than those above, you will have to apply our patches to InterViews before compiling. CSS does not support all of C++ (does anything?). It does have most of the basic stuff, but does not do operator overloading, function call resolution based on argument types, templates, or exception handling, to name the main ones. It is intended to be used as a script language, not as a major application development platform. The source code (and manual, etc) for just TA/CSS is 6.6 Meg. Compiling this will add around 10 or so Meg. The entire PDP++ distribution, including the manual and demos, is 16 Meg. The full PDP++ system (without shared libraries) compiles to 115 Meg before cleaning the object files, etc. For more information, see our Web page and the on-line manual.