CSS is a "C" language interpreter and script language (C Super-Script). The name derives from the fact that the language is C, written in C, so it is C to the C, or C^c, while at the same time being an excellent, even superlative scripting language. The actual syntax for CSS is somewhere in between C and C++, and the language is written entirely in C++. The major differences between CSS and C++ are listed in section 5.3.1 Differences Between CSS and C++, and the few discrepancies between CSS and C are noted in section 5.3.2 Differences Between CSS and ANSI C. Some of the convenient features of C++ that are incorporated into CSS are enumerated in section 5.3.4 Features of C++ for C Programmers, for those unfamiliar with C++.
Being an interpreter, CSS presents the user with a prompt: css>
.
At this prompt, the user can enter any C expression, which will be
evaluated immediately upon pressing Return, or enter a command. The
commands operate much like a debugger (e.g., gdb, dbx), and allow
control over the running, listing, and debugging of programs. In
addition to the default "immediate mode" behavior of the system, it
can behave like a compiler. For example, the command define
will
cause the system to enter a compiling mode (the prompt changes to
css\#
), where the C code that is subsequently entered is
compiled into an intermediate machine code, but not run directly.
Instead, it becomes a stored program that can be run many times.
Typically, one works with a program file (use the extension .css to
indicate a css file) that is loaded and then run, instead of manually
typing programs into the system using define mode. The command
load "filename.css"
will load a file and compile it, at which
point it can be run. The command run
will run the program from
the beginning. reload
will remove the existing compiled program
and load (and re-compile) the previously loaded one from the disk file,
which is handy when you are editing the program file and testing it out.
One can view the source code within CSS by using the list
command, which takes (optional) line number and length arguments.
Unlike C functions, which need to be called with the usual syntax of
parentheses around the arguments, which are themselves comma separated,
and the whole thing is terminated by a semi-colon, the arguments to
commands don't require the parentheses or the semi-colon, but do require
thte commas.
One of the principle uses of CSS is as an interface for hard-coded C/C++ programs. There is a "TypeAccess" program that reads the header files for a given application and generates type information that can be used by CSS to automatically interface with the objects and types in the hard-coded world. CSS comes initially with some relevant hard-coded types from the standard C/C++ library, including a String class and the stream I/O classes, and various math and posix library functions.