Class SimulatorException

java.lang.Object
java.lang.Throwable
java.lang.Exception
mars.simulator.SimulatorException
All Implemented Interfaces:
Serializable

public class SimulatorException extends Exception
Class to represent error that occurs while assembling or running a MIPS program.
Version:
August 2003
Author:
Pete Sanderson
See Also:
  • Constructor Details

    • SimulatorException

      public SimulatorException(String message)
      Constructor for ProcessingException.
      Parameters:
      message -
    • SimulatorException

      public SimulatorException(AddressErrorException exception)
      Constructor for ProcessingException.
      Parameters:
      exception - AddressErrorException object containing specialized error message, cause, address
    • SimulatorException

      public SimulatorException(BasicStatement statement, String message)
      Constructor for ProcessingException to handle runtime exceptions
      Parameters:
      statement - BasicStatement of statement causing runtime exception
      message - String containing specialized error message
    • SimulatorException

      public SimulatorException(BasicStatement statement, String message, int cause)
      Constructor for ProcessingException to handle runtime exceptions
      Parameters:
      statement - BasicStatement of statement causing runtime exception
      message - String containing specialized error message
      cause - exception cause (see Exceptions class for list)
    • SimulatorException

      public SimulatorException(BasicStatement statement, AddressErrorException exception)
      Constructor for ProcessingException to handle address runtime exceptions
      Parameters:
      statement - a BasicStatement of statement causing runtime exception
      exception - 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

      public Integer getExitCode()
      Produce the error code passed by the program.
      Returns:
      Returns the error code.