Class Symbol

java.lang.Object
mars.assembler.Symbol

public class Symbol extends Object
Represents a MIPS program identifier to be stored in the symbol table.
Version:
June 2003
Author:
Jason Bumgarner, Jason Shrewsbury
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static boolean
     
    static boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Symbol​(String name, int address, boolean data)
    Basic constructor, creates a symbol object.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the address of the the Symbol.
    Returns the label of the the Symbol.
    boolean
    Finds the type of symbol, text or data.
    void
    setAddress​(int newAddress)
    Sets (replaces) the address of the the Symbol.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Symbol

      public Symbol(String name, int address, boolean data)
      Basic constructor, creates a symbol object.
      Parameters:
      name - The name of the Symbol.
      address - The memory address that the Symbol refers to.
      data - The type of Symbol that it is.
  • Method Details

    • getAddress

      public int getAddress()
      Returns the address of the the Symbol.
      Returns:
      The address of the Symbol.
    • getName

      public String getName()
      Returns the label of the the Symbol.
      Returns:
      The label of the Symbol.
    • getType

      public boolean getType()
      Finds the type of symbol, text or data.
      Returns:
      The type of the data.
    • setAddress

      public void setAddress(int newAddress)
      Sets (replaces) the address of the the Symbol.
      Parameters:
      newAddress - The revised address of the Symbol.