Package mars.simulator
Class SimulatorException
java.lang.Object
java.lang.Throwable
java.lang.Exception
mars.simulator.SimulatorException
- All Implemented Interfaces:
Serializable
Class to represent error that occurs while assembling or running a MIPS program.
- Version:
- August 2003
- Author:
- Pete Sanderson
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for ProcessingException.SimulatorException
(int exitCode) Constructor for ProcessingException.SimulatorException
(String message) Constructor for ProcessingException.SimulatorException
(BasicStatement statement, String message) Constructor for ProcessingException to handle runtime exceptionsSimulatorException
(BasicStatement statement, String message, int cause) Constructor for ProcessingException to handle runtime exceptionsSimulatorException
(BasicStatement statement, AddressErrorException exception) Constructor for ProcessingException to handle address runtime exceptionsSimulatorException
(AddressErrorException exception) Constructor for ProcessingException. -
Method Summary
Modifier and TypeMethodDescriptionProduce the error code passed by the program.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
SimulatorException
Constructor for ProcessingException.- Parameters:
message
-
-
SimulatorException
Constructor for ProcessingException.- Parameters:
exception
- AddressErrorException object containing specialized error message, cause, address
-
SimulatorException
Constructor for ProcessingException to handle runtime exceptions- Parameters:
statement
- BasicStatement of statement causing runtime exceptionmessage
- String containing specialized error message
-
SimulatorException
Constructor for ProcessingException to handle runtime exceptions- Parameters:
statement
- BasicStatement of statement causing runtime exceptionmessage
- String containing specialized error messagecause
- exception cause (see Exceptions class for list)
-
SimulatorException
Constructor for ProcessingException to handle address runtime exceptions- Parameters:
statement
- a BasicStatement of statement causing runtime exceptionexception
- AddressErrorException object containing specialized error message, cause, address
-
SimulatorException
public SimulatorException(int exitCode) Constructor for ProcessingException.No error list, but allows passing of exit code (i.e., syscall 17 for exiting with exit code).
- Parameters:
exitCode
- exit code
-
SimulatorException
public SimulatorException()Constructor for ProcessingException.No parameter and thus no error list. Use this for normal MIPS program termination (e.g. syscall 10 for exit).
-
-
Method Details
-
getExitCode
Produce the error code passed by the program.- Returns:
- Returns the error code.
-