Package edu.iu.jrsalata
Class SingleStatement
java.lang.Object
edu.iu.jrsalata.Statement
edu.iu.jrsalata.BaseStatement
edu.iu.jrsalata.SingleStatement
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:
-
Field Summary
Fields inherited from class edu.iu.jrsalata.BaseStatement
format, location, opcode
Fields inherited from class edu.iu.jrsalata.Statement
block, controlSection, line, size
-
Constructor Summary
ConstructorDescriptionDefault constructor for the SingleStatement class.SingleStatement
(HexNum location, HexNum opcode) Constructs a SingleStatement object with the specified location and opcode. -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(VisitorInterface visitor) Accepts a visitor object and allows it to visit this instance of SingleStatement.assemble()
Assembles the opcode into its hex string representation.Methods inherited from class edu.iu.jrsalata.BaseStatement
getLocation, setLocation
Methods inherited from class edu.iu.jrsalata.Statement
getBlock, getControlSection, getLine, getSize, setBlock, setControlSection, setLine
-
Constructor Details
-
SingleStatement
public SingleStatement()Default constructor for the SingleStatement class. Calls the BaseStatement constructor. -
SingleStatement
Constructs a SingleStatement object with the specified location and opcode.- Parameters:
location
- the memory location of the statement as a HexNumopcode
- the operation code of the statement as a HexNum
-
-
Method Details
-
assemble
Assembles the opcode into its hex string representation. -
accept
Accepts a visitor object and allows it to visit this instance of SingleStatement.
-