Class ProgramSegment
java.lang.Object
svm.segment.Segment
svm.segment.ProgramSegment
Program Segment.
Link to GitHub: Source File.
- Author:
- Øystein Myhre Andersen
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe set of instructions in this ProgramSegment.private intListing utility: index to the last listed instruction.Fields inherited from class Segment
ident, segmentKind -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidUtility: Segment dumpvoidUtility: Segment dumpvoidemit(SVM_Instruction instr) Emit an instruction by adding it to this ProgramSegment.voidListing utility: list all instructions not yet listed.voidlistIntruction(String indent, int idx) Listing utility: List an instructionReturns the next ProgramAddressstatic ProgramSegmentReturns a ProgramSegment read from the given AttributeInputStreamtoString()voidwrite(AttributeOutputStream oupt) Writes a Segment to the given output.
-
Field Details
-
instructions
The set of instructions in this ProgramSegment. -
lastListed
private int lastListedListing utility: index to the last listed instruction.
-
-
Constructor Details
-
ProgramSegment
ProgramSegment constructor.- Parameters:
ident- the ProgramSegment ident
-
-
Method Details
-
nextAddress
Returns the next ProgramAddress- Returns:
- the next ProgramAddress
-
emit
Emit an instruction by adding it to this ProgramSegment.- Parameters:
instr- instr to be added
-
listInstructions
public void listInstructions()Listing utility: list all instructions not yet listed. -
listIntruction
Listing utility: List an instruction- Parameters:
indent- indentation Stringidx- index to the instruction
-
dump
-
dump
-
toString
-
write
Description copied from class:SegmentWrites a Segment to the given output.- Overrides:
writein classSegment- Parameters:
oupt- the output stream- Throws:
IOException- if IOException occur
-
readObject
Returns a ProgramSegment read from the given AttributeInputStream- Parameters:
inpt- the AttributeInputStream- Returns:
- a ProgramSegment read from the given AttributeInputStream
- Throws:
IOException- if IOException occur
-