|
||||||||||
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 | +--uk.ac.man.cs.rainbow.compiler.RainbowToRASM
Compiles
Rainbow
to
RASM
and RAPA
.
The debuggging status of instances of this class created with the
default constructor is controlled by the boolean system property
rainbow.compiler.debug.
Boolean.getBoolean(String)
Inner classes inherited from class uk.ac.man.cs.rainbow.Compiler |
Compiler.Error, Compiler.Errors, Compiler.Exception, Compiler.ParseError, Compiler.PreciseError, Compiler.SemanticError, Compiler.Warning |
Constructor Summary | |
RainbowToRASM()
|
|
RainbowToRASM(boolean mode)
|
Method Summary | |
static Errors |
errors()
|
static Compiler |
getInstance()
Manufacture a standard compiler. |
static void |
main(String[] args)
|
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. |
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. |
String |
rif2rasm(String rif)
Convert RIF text to RASM text. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public RainbowToRASM(boolean mode)
public RainbowToRASM() throws Compiler.Exception
Method Detail |
public static Errors errors()
public String toString()
toString
in class Object
public static Compiler getInstance() throws RainbowException, Compiler.Exception
Compiler
JSCompiler
is
provided. The class must have a no-argument constructor.uk.ac.man.cs.rainbow.Compiler
RainbowException
- If things go wrong during compiler creation. Usually because
of a bad compiler specification.public RASMCode rainbow2code(String rainbow, Hashtable context) throws Compiler.Exception
Compiler
rainbow2code
in class Compiler
uk.ac.man.cs.rainbow.Compiler
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.Compiler.rainbow2rif(String)
,
Compiler.rif2rasm(String)
,
Compiler.rasm2code(String,Hashtable)
public String rainbow2rasm(String rainbow) throws Compiler.Exception
Compiler
rainbow2rasm
in class Compiler
uk.ac.man.cs.rainbow.Compiler
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.Compiler.rainbow2rif(String)
,
Compiler.rif2rasm(String)
public RASMCode rasm2code(String rasm, Hashtable context) throws Compiler.Exception
Compiler
rasm2code
in class Compiler
uk.ac.man.cs.rainbow.Compiler
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 String rainbow2rif(String rainbow) throws Compiler.Exception
Compiler
rainbow2rif
in class Compiler
uk.ac.man.cs.rainbow.Compiler
rainbow
- The Rainbow text to convert.RainbowException
- If the conversion is impossible for some reason.public RASMCode rif2code(String rif, Hashtable context) throws Compiler.Exception
Compiler
rif2code
in class Compiler
uk.ac.man.cs.rainbow.Compiler
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.Compiler.rif2rasm(String)
,
Compiler.rasm2code(String,Hashtable)
public String rif2rasm(String rif) throws Compiler.Exception
Compiler
rif2rasm
in class Compiler
uk.ac.man.cs.rainbow.Compiler
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 static void main(String[] args) throws ParseException, RainbowException, Compiler.Exception
public ProcessTerm rainbow2rapa(String rainbow) throws RainbowException
Compiler
rainbow2rapa
in class Compiler
uk.ac.man.cs.rainbow.Compiler
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |