|
Compiling High-level Access Interfaces for Multi-site Software (CHAIMS)
|
|
CHAIMS compiler
Woody Pollack
March 22, 1998
The CHAIMS compiler can be found in:
/db/d8/ftp/www/CHAIMS/Compiler
The compiler works in the following way:
-
It parses a megaprogram line-by-line and writes corresponding C or C++
code to appropriate files (either client.c or client.cc). This file
is determined during the SETUP call (as will be seen in the next step).
-
When the compiler encounters a SETUP call, the compiler consults a repository
(currently implemented as a text file named repository.txt) to determine the distribution protocol the desired
service uses. Based on this, the compiler will generate either C
code into the file client.c or C++ code into the file client.cc.
-
Once the compiler has finished, there will be at least 2 generated files.
There can be up to 4. The 2 generated files will be a source code
file and a header file for this code. If the megaprogram requires
both DCE and CORBA, 2 header files (client.h and client.hh) as well as
two source files (client.c and client.cc) will be generated.
-
The next step is for the user to compile the generated file and then run
the executable.
How to run
In order to use the compiler, you must first make sure all servers you
will be using in your megaprogram are in the repository. If the server
is not, the compiler will print an error message and exit. The repository
is named repository.txt and must be in the same directory as chaimsCompiler. Repository
entries must be made as follows:
"<server_name>" <distribution protocol> <server_location>
thus, an example entry would be:
"room_res" DCE ninja4.stanford.edu
Once this done, and your CHAIMS program has been written, you can run
the compiler.
chaimsCompiler <your_CHAIMS_source>
for instance:
chaimsCompiler example.chaims
Once this finishes (assuming no errors were found) you can compile and
execute the generated client files.
Current issues:
-
If your CHAIMS source calls 2 megamodules that use different distribution protocols
(DCE and CORBA) both client files will be generated and will compile correctly
with their respective compilers. However, they will currently have
no interaction with one another. Therefore, if you need to test something
using the compiler, your source code must use only DCE or CORBA.
6/24/98 wpollack@db.stanford.edu