|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.projectory.koivima.compiler.assembler.AssemblerCompiler
public class AssemblerCompiler
Compiles a piece of assembly code for the virtual machine.
Field Summary | |
---|---|
java.util.ArrayList<java.lang.String> |
operators
names of available operators |
(package private) java.lang.String |
packageName
Name of the package containing the operators. |
(package private) java.lang.String |
packagePath
Path to the directory containing the operators |
Constructor Summary | |
---|---|
AssemblerCompiler()
Creates a new compiler. |
Method Summary | |
---|---|
CodeBlock |
compile(java.lang.String assemblyCode,
ExecutionContext context)
Compiles a string into an executable code block |
CodeBlock |
compileCodeBlock(Parser parser,
ExecutionContext context)
Reads tokens in assembly language from a parser until the end of a code block and compiles them to an executable codeblock. |
protected AbstractElementList |
compileList(AbstractElementList list,
Parser parser,
ExecutionContext context)
|
java.util.ArrayList<java.lang.String> |
createListOfOperators()
Looks for class files in de/projectory/koivima/operators/ and creates an internal list of operators. |
void |
setOperatorsPath(java.lang.String pathname)
Sets the path to a new set of operators. |
protected Element |
tokenToElement(java.lang.String token,
Parser parser,
ExecutionContext context)
Converts a token to an executable element of the virtual machine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.util.ArrayList<java.lang.String> operators
java.lang.String packagePath
java.lang.String packageName
Constructor Detail |
---|
public AssemblerCompiler()
Method Detail |
---|
public void setOperatorsPath(java.lang.String pathname)
pathname
- Directory containing the operators, for example de/projectory/koivima/operators/public java.util.ArrayList<java.lang.String> createListOfOperators()
protected Element tokenToElement(java.lang.String token, Parser parser, ExecutionContext context) throws java.io.IOException
java.io.IOException
protected AbstractElementList compileList(AbstractElementList list, Parser parser, ExecutionContext context) throws java.io.IOException
java.io.IOException
public CodeBlock compileCodeBlock(Parser parser, ExecutionContext context) throws java.io.IOException
parser
- Previously created Parser that provides the tokens for the compiler.
java.io.IOException
public CodeBlock compile(java.lang.String assemblyCode, ExecutionContext context) throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |