|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmars.assembler.Assembler
public class Assembler
An Assembler is capable of assembling a MIPS program. It has only one public method, assemble(), which implements a two-pass assembler. It translates MIPS source code into binary machine code.
Constructor Summary | |
---|---|
Assembler()
|
Method Summary | |
---|---|
ArrayList |
assemble(ArrayList tokenizedProgramFiles,
boolean extendedAssemblerEnabled)
Parse and generate machine code for the given MIPS program. |
ArrayList |
assemble(ArrayList tokenizedProgramFiles,
boolean extendedAssemblerEnabled,
boolean warningsAreErrors)
Parse and generate machine code for the given MIPS program. |
ArrayList |
assemble(MIPSprogram p,
boolean extendedAssemblerEnabled)
Parse and generate machine code for the given MIPS program. |
ArrayList |
assemble(MIPSprogram p,
boolean extendedAssemblerEnabled,
boolean warningsAreErrors)
Parse and generate machine code for the given MIPS program. |
ErrorList |
getErrorList()
Get list of assembler errors and warnings |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Assembler()
Method Detail |
---|
public ArrayList assemble(MIPSprogram p, boolean extendedAssemblerEnabled) throws ProcessingException
p
- A MIPSprogram object representing the program source.extendedAssemblerEnabled
- A boolean value that if true permits use of extended (pseudo)
instructions in the source code. If false, these are flagged
as errors.
ProcessingException
ProgramStatement
public ArrayList assemble(MIPSprogram p, boolean extendedAssemblerEnabled, boolean warningsAreErrors) throws ProcessingException
p
- A MIPSprogram object representing the program source.extendedAssemblerEnabled
- A boolean value that if true permits use of extended (pseudo)
instructions in the source code. If false, these are flagged
as errors.warningsAreErrors
- A boolean value - true means assembler warnings will be
considered errors and terminate the assemble; false means the
assembler will produce warning message but otherwise ignore
warnings.
ProcessingException
ProgramStatement
public ErrorList getErrorList()
public ArrayList assemble(ArrayList tokenizedProgramFiles, boolean extendedAssemblerEnabled) throws ProcessingException
tokenizedProgramFiles
- An ArrayList of MIPSprogram objects, each produced from a
different source code file, representing the program source.extendedAssemblerEnabled
- A boolean value that if true permits use of extended (pseudo)
instructions in the source code. If false, these are flagged
as errors.
ProcessingException
ProgramStatement
public ArrayList assemble(ArrayList tokenizedProgramFiles, boolean extendedAssemblerEnabled, boolean warningsAreErrors) throws ProcessingException
tokenizedProgramFiles
- An ArrayList of MIPSprogram objects, each produced from a
different source code file, representing the program source.extendedAssemblerEnabled
- A boolean value that if true permits use of extended (pseudo)
instructions in the source code. If false, these are flagged
as errors.warningsAreErrors
- A boolean value - true means assembler warnings will be
considered errors and terminate the assemble; false means the
assembler will produce warning message but otherwise ignore
warnings.
ProcessingException
ProgramStatement
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |