|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.cornell.cs.sam.core.SamProgram
public class SamProgram
Implementation of Program using an ArrayList for storage. See Program interface for more information
| Constructor Summary | |
|---|---|
SamProgram()
|
|
| Method Summary | |
|---|---|
void |
addInst(Instruction i)
Add instruction to the program |
void |
addInst(Instruction[] arr)
Add multiple instructions to the program |
Instruction |
getInst(int pos)
Get instruction at specificed location |
java.util.List<Instruction> |
getInstList()
Get all instructions as a list |
int |
getLength()
Gets total number of instructions in program |
ReferenceTable |
getReferenceTable()
Returns the references table |
SymbolTable |
getSymbolTable()
Returns the symbol table |
boolean |
isExecutable()
Returns whether this program can be executed - it is executable if all symbols have been resolved. |
void |
resolveReferences()
Resolves references in this program from the symbol table |
void |
resolveReferencesFrom(Program prog)
Resolves prog's references from the symbol table |
void |
setReferenceTable(ReferenceTable table)
Sets the references table |
void |
setSymbolTable(SymbolTable table)
Sets the symbol table |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SamProgram()
| Method Detail |
|---|
public Instruction getInst(int pos)
Program
getInst in interface Programpos - The instruction address
public java.util.List<Instruction> getInstList()
Program
getInstList in interface Programpublic void addInst(Instruction i)
Program
addInst in interface Programi - The instruction to addpublic void addInst(Instruction[] arr)
Program
addInst in interface Programarr - An array of instructions to addpublic int getLength()
Program
getLength in interface Programpublic SymbolTable getSymbolTable()
Program
getSymbolTable in interface Programpublic ReferenceTable getReferenceTable()
Program
getReferenceTable in interface Programpublic void setSymbolTable(SymbolTable table)
Program
setSymbolTable in interface Programtable - The symbol table for this programpublic void setReferenceTable(ReferenceTable table)
Program
setReferenceTable in interface Programtable - The references table for this programpublic void resolveReferences()
Program
resolveReferences in interface Programpublic void resolveReferencesFrom(Program prog)
Program
resolveReferencesFrom in interface Programprog - The program whose references to resolvepublic boolean isExecutable()
Program
isExecutable in interface Programpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||