|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.ac.man.cs.rainbow.Compiler
Basic operations that should be supported by a compiler. Defines a factory method to get a useable version.
RASMCode
,
ProcessTerm
Inner Class Summary | |
static class |
Compiler.Error
A single error generated by a compiler. |
static class |
Compiler.Errors
When there are compiler errors, this class is thrown. |
static class |
Compiler.Exception
Exceptions generated by the compilation stage itself. |
static class |
Compiler.ParseError
A single parse error generated by a compiler. |
static class |
Compiler.PreciseError
A precisely-located error. |
static class |
Compiler.SemanticError
A single semantic error generated by a compiler. |
static class |
Compiler.Warning
A warning. |
Constructor Summary | |
protected |
Compiler()
Do-nothing constructor. |
Method Summary | |
static Compiler |
getInstance()
Manufacture a standard compiler. |
RASMCode |
rainbow2code(String rainbow,
Hashtable context)
Compile and assemble Rainbow text into a block of code. |
ProcessTerm |
rainbow2rapa(String rainbow)
Compile Rainbow text into a RAPA process term. |
String |
rainbow2rasm(String rainbow)
Compile Rainbow text into RASM text. |
abstract String |
rainbow2rif(String rainbow)
Convert Rainbow text to RIF text. |
RASMCode |
rasm2code(String rasm,
Hashtable context)
Assemble RASM text into a code block. |
RASMCode |
rif2code(String rif,
Hashtable context)
Compile and assemble RIF text into a block of code. |
abstract String |
rif2rasm(String rif)
Convert RIF text to RASM text. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected Compiler()
Method Detail |
public static Compiler getInstance() throws RainbowException
JSCompiler
is
provided. The class must have a no-argument constructor.RainbowException
- If things go wrong during compiler creation. Usually because
of a bad compiler specification.public abstract String rainbow2rif(String rainbow) throws RainbowException
rainbow
- The Rainbow text to convert.RainbowException
- If the conversion is impossible for some reason.public abstract String rif2rasm(String rif) throws IOException, RainbowException
rif
- The RIF text to convert.IOException
- If a compiler fails some external I/O access.RainbowException
- If something goes wrong during compilation.Compiler.Errors
- If there were semantic errors during compilation.public RASMCode rasm2code(String rasm, Hashtable context) throws RainbowException
rasm
- The RASM text to assemble.context
- The library context to assemble in.RainbowException
- If the RASM text was ill-formatted, or if anything else
unexpected went wrong!RASMCode.RASMCode(Hashtable,BufferedReader,boolean)
public RASMCode rainbow2code(String rainbow, Hashtable context) throws IOException, RainbowException
rainbow
- The Rainbow text to convert.context
- The library context to assemble in.IOException
- If some external I/O access fails unexpectedly.RainbowException
- If some internal error happens in the compilation or assembly
stages.Compiler.Errors
- If there were semantic errors during compilation.rainbow2rif(String)
,
rif2rasm(String)
,
rasm2code(String,Hashtable)
public ProcessTerm rainbow2rapa(String rainbow) throws IOException, RainbowException
rainbow
- The Rainbow text to convert.IOException
- If some external I/O access fails unexpectedly.RainbowException
- If some internal error happens in the compilation or assembly
stages.Compiler.Errors
- If there were semantic errors during compilation.public RASMCode rif2code(String rif, Hashtable context) throws IOException, RainbowException
rif
- The RIF text to convert.context
- The library context to assemble in.IOException
- If some external I/O access fails unexpectedly.RainbowException
- If some internal error happens in the compilation or assembly
stages.Compiler.Errors
- If there were semantic errors during compilation.rif2rasm(String)
,
rasm2code(String,Hashtable)
public String rainbow2rasm(String rainbow) throws IOException, RainbowException
rainbow
- The Rainbow text to convert.IOException
- If a compiler fails some external I/O access.RainbowException
- If something goes wrong during compilation.Compiler.Errors
- If there were semantic errors during compilation.rainbow2rif(String)
,
rif2rasm(String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |