Class Segment
java.lang.Object
svm.segment.Segment
- Direct Known Subclasses:
DataSegment, ProgramSegment
Segment.
Link to GitHub: Source File.
- Author:
- Øystein Myhre Andersen
-
Field Summary
FieldsModifier and TypeFieldDescriptionSegment identprotected intK_SEG_DATA, K_SEG_CONST, K_SEG_CODEprivate intSegment Sequence numberprivate static intUsed to generate Segment Sequence numbers -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCompare two Segment addresses according to the given relation.abstract voidUtility: Segment dumpabstract voidUtility: Segment dumpprivate static booleanReturns true if the two specified Strings are equal to one another.static SegmentLookup Segment by its identtoString()voidwrite(AttributeOutputStream oupt) Writes a Segment to the given output.
-
Field Details
-
ident
Segment ident -
segmentKind
protected int segmentKindK_SEG_DATA, K_SEG_CONST, K_SEG_CODE -
sequ
private int sequSegment Sequence number -
SEQU
private static int SEQUUsed to generate Segment Sequence numbers
-
-
Constructor Details
-
Segment
Segment constructor.- Parameters:
ident- the Segment identsegmentKind- K_SEG_DATA, K_SEG_CONST, K_SEG_CODE
-
-
Method Details
-
lookup
-
compare
public static boolean compare(String LHSegID, int lhSegOfst, int relation, String RHSegID, int rhSegOfst) Compare two Segment addresses according to the given relation.- Parameters:
LHSegID- the left hand Segment identlhSegOfst- the left hand Segment address offsetrelation- one of: LT, LE, EQ, GE, GT, NERHSegID- the right hand Segment identrhSegOfst- the right hand Segment address offset- Returns:
- true if the relation holds
-
equals
-
dump
Utility: Segment dump- Parameters:
title- the printout title
-
dump
Utility: Segment dump- Parameters:
title- the printout titlefrom- Segment indexto- Segment index
-
toString
-
write
Writes a Segment to the given output.- Parameters:
oupt- the output stream- Throws:
IOException- if IOException occur
-