Class GeneralAddress

java.lang.Object
svm.value.Value
svm.value.GeneralAddress

public class GeneralAddress extends Value

GeneralAddress.

general_address	::= c-gaddr global_or_const:tag

Link to GitHub: Source File.

Author:
S-Port: Definition of S-code, Øystein Myhre Andersen
  • Field Details

    • base

      public ObjectAddress base
      Base Object address
    • ofst

      public int ofst
      The offset
  • Constructor Details

    • GeneralAddress

      public GeneralAddress()
      Default Constructor
    • GeneralAddress

      public GeneralAddress(ObjectAddress base, int ofst)
      Construct a new GeneralAddress with the given base and offset
      Parameters:
      base - the Base Object address
      ofst - The offset
  • Method Details

    • ofScode

      public static GeneralAddress ofScode()
      Scans the remaining S-Code (if any) belonging to this GeneralAddress Value. Then construct a new GeneralAddress instance.
      Returns:
      that GeneralAddress instance.
    • compare

      public boolean compare(int relation, Value other)
      Description copied from class: Value
      Compare this Value with the given Value according to the given relation.
      Overrides:
      compare in class Value
      Parameters:
      relation - one of: LT, LE, EQ, GE, GT, NE
      other - the other Value
      Returns:
      true: if the relation holds
    • add

      public Value add(Value other)
      Description copied from class: Value
      Returns the result of: this value + other value
      Overrides:
      add in class Value
      Parameters:
      other - the other value
      Returns:
      the result of: this value + other value
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • write

      public void write(AttributeOutputStream oupt) throws IOException
      Description copied from class: Value
      Writes this Value to the given output.
      Overrides:
      write in class Value
      Parameters:
      oupt - the output stream
      Throws:
      IOException - if IOException occur
    • read

      public static GeneralAddress read(AttributeInputStream inpt) throws IOException
      Reads a GeneralAddress from the given input.
      Parameters:
      inpt - the AttributeInputStream
      Returns:
      the GeneralAddress read
      Throws:
      IOException - if IOException occur