J-INTERCAL DocumentationHow does it work? The J-INTERCAL compiler takes an INTERCAL source file and produces a corresponding Java class. However the INTERCAL code isn't directly compiled into native Java bytecode. The compiler outputs code for the Java INTERCAL Virtual Machine (JIVM) which is combined with a runtime stub to create a Java class. When called, the stub code passes the JIVM bytecode to an interpreter located in the J-INTERCAL runtime package. The stub code may be called by directly running the class or by calling a method in that class and passing in IO streams for the INTERCAL program to use. That way, INTERCAL programs can be seamlessly included into legacy Java systems. Installation
Compiling and running programsThe compiler is called intercal.Compiler and can be run directly or using the jick script. The -l option can be used to specify the file to use for automagic inclusing of the system library (defaults to ./syslib.i). For additional options, see jick -?. The J-INTERCAL compiler can take more than one file at once, but to ensure maximum inconvenience error messages don't contain file names. The compiler will produce one Java class file for every INTERCAL source file. The resulting class has the same name as the input file (without the .i extension) and can be run directly using the java command. Just like the compiler, the compiled class will accept some command line options. Use -? to get a list. After all, compiling and running Louis Howell's prime program provided in the samples directory is as simple as % cd samples |