Class SingleStatement


public class SingleStatement extends BaseStatement
The SingleStatement class represents a single assembly statement. It extends the BaseStatement class and provides specific implementations for assembling the statement and accepting a visitor.
See Also:
  • Constructor Details

    • SingleStatement

      public SingleStatement()
      Default constructor for the SingleStatement class. Calls the BaseStatement constructor.
    • SingleStatement

      public SingleStatement(HexNum location, HexNum opcode)
      Constructs a SingleStatement object with the specified location and opcode.
      Parameters:
      location - the memory location of the statement as a HexNum
      opcode - the operation code of the statement as a HexNum
  • Method Details

    • assemble

      public String assemble()
      Assembles the opcode into its hex string representation.
      Specified by:
      assemble in class Statement
      Returns:
      A hex string representation of the opcode.
    • accept

      public void accept(VisitorInterface visitor)
      Accepts a visitor object and allows it to visit this instance of SingleStatement.
      Specified by:
      accept in class Statement
      Parameters:
      visitor - the visitor object that will visit this instance