APIIC is simple to use. The first thing that is needed is an environment. This can be created with the "new IC.Program()" call. Once an environment is created it can be added to by using the "program.read(FILENAME)" method. This reads, parses, and interprets the given file, defining functions and classes. Any top-level statements are collected in a MAIN block. With an environment, statements can be evaluated. The "program.eval()" call will evaluate all the statements in the MAIN block, while "program.eval(STRING) will evaluate the string STRING in the given environment. Of course more than one file can be read in, and a statement (including the MAIN block) can be executed multiple times. Program objects are independant - no static variables are used, so it is OK to have more than one environment existing at a time. |
|
APPLICATIONIC is also set up to run as an application. This way a file can be read and interpreted from the shell environment using the command java IC.Program FILENAME where FILENAME is the name of a file to execute. Or, if no filename is given, IC will enter interactive mode. This way commands entered at a prompt are read and interpreted. All C statements can be typed in, including multilined ones (class and function definitions), variable declaration, and so on.
|
|