How to compile and run services
Setting up your environment
There are four sample WIG compilers available, pwig, wig4, wig10 and wig18.
The wig4 and wig18 compilers were written in C by groups at the
University of Aarhus in fall 1998. The pwig compiler was written at McGill,
in C in 2001. The wig10 compiler was written at McGill, in Java using SableCC
during fall 1999, and it should also be very stable.
To use four compilers you should:
-
Set the environment variable
WIGDIR by:
setenv WIGDIR ~hendren/WIG
-
Add $WIGDIR/Bin to your PATH or,
add aliases of the form of one of the following:
alias wig10 $WIGDIR/Bin/wig10 (any system with JDK 1.2 or later)
alias pwig $WIGDIR/Bin/perfectwig (SUN server)
alias wig4 $WIGDIR/Bin/wig4 (SUN server)
alias wig18 $WIGDIR/Bin/wig18 (SUN server)
You will probably find that wig10 , pwig and
wig18 are more stable. The wig18 compiler
is interesting because it illustrates generation of a stack code.
-
Create a subdirectory under the
public_html directory.
- cgi-bin/ (set permission of this directory to 711)
Compiling your WIG service
Running your WIG service.
You may now run your service by using one of the following URLs:
http://www.cs.mcgill.ca/~YourName/cgi-bin/foo.cgi?SessionName
http://www.cs.mcgill.ca/~YourName/cgi-bin/foo4.cgi?SessionName
http://www.cs.mcgill.ca/~YourName/cgi-bin/foo10.cgi?SessionName
http://www.cs.mcgill.ca/~YourName/cgi-bin/foo18.cgi?SessionName
where YourName should be your user name,
SessionName should be name of one of the sessions defined in
foo.wig .
For example, consider the following service
that could be in foo.wig .
service {
const html ...
const html ...
...
session Init() { ... }
session Doit() { ... }
session Report() { ... }
}
In this case, if you compiled with wig10, there are three different sessions that could be run using:
-
http://www.cs.mcgill.ca/~YourName/cgi-bin/foo10.cgi?Init
-
http://www.cs.mcgill.ca/~YourName/cgi-bin/foo10.cgi?Doit
-
http://www.cs.mcgill.ca/~YourName/cgi-bin/foo10.cgi?Report
|