uk.ac.man.cs.rainbow.temp
Class JSCompiler
java.lang.Object
|
+--uk.ac.man.cs.rainbow.Compiler
|
+--uk.ac.man.cs.rainbow.temp.JSCompiler
- public class JSCompiler
- extends Compiler
A simple compiler. This uses John Sargeant's semproc to implement
its main functionality. Note that this class is only public for
documentation purposes - it has no useful public features beyond
that of its superclass.
- See Also:
- Rainbow Implementors Guide
Field Summary |
static String |
encoding
The encoding of messages passed to and from the external
compiler. |
Constructor Summary |
JSCompiler()
Create a new compiler object connected to the external compiler
specified in the rainbow.compiler.js.command property. |
JSCompiler(String compilerCmd)
Create a new compiler object connected to the specified external
compiler. |
encoding
public static final String encoding
- The encoding of messages passed to and from the external
compiler.
JSCompiler
public JSCompiler(String compilerCmd)
throws IOException
- Create a new compiler object connected to the specified external
compiler.
JSCompiler
public JSCompiler()
throws IOException
- Create a new compiler object connected to the external compiler
specified in the rainbow.compiler.js.command property.
- See Also:
getCompilerCommand()
close
protected void close()
- Shut down the objects connection to its external compiler.
finalize
protected void finalize()
- Overrides:
finalize
in class Object
getCompilerCommand
public static String getCompilerCommand()
- Read the command line to use to invoke an external compiler from
the system properties list. The name of the property looked up
is rainbow.compiler.js.command and it is assumed to
exist.
rainbow2rif
public String rainbow2rif(String rainbow)
throws RainbowException
- Convert Rainbow text to RIF text. Except we don't, always
failing with an exception instead.
- Overrides:
rainbow2rif
in class Compiler
- Throws:
Compiler.Exception
- Always! This method isn't really implemented at all.
rif2rasm
public String rif2rasm(String rif)
throws IOException,
RainbowException
- Convert RIF text into RASM text.
- Overrides:
rif2rasm
in class Compiler
- Parameters:
rif
- The RIF text to convert.- Returns:
- The converted RASM text.
- Throws:
IOException
- If contact with the external compiler is lost or something
else goes wrong with the external communications.Compiler.Errors
- If there were (semantic) errors in the RIF text.RainbowException
- If something else goes wrong (like the compiler not following
the correct communication protocol.)