A text object is conceptually an instance of
class TEXTOBJ( SIZE, CONST); integer SIZE; boolean CONST; begin character array MAIN( 1:SIZE ); end;Any text value processed by the program is contained within a text frame, i.e. a non-empty segment of the MAIN attribute of some TEXTOBJ instance, or it is empty (i.e. notext). See 2.5.
Any non-empty sequence of consecutive elements of the array attribute MAIN constitutes a text frame. More specifically, any text frame is completely identified by the following information:
- a reference to the text object containing the frame,
- the start position of the frame, being an ordinal number less than or equal to SIZE,
- the length of the frame.
A frame which is completely contained by another frame is called a "subframe" of that frame. The text frame associated with the entire array attribute MAIN is called the "main frame" of the text object. All frames of the text object are subframes of the main frame.
Note: A main frame is a subframe of no frame except itself.
The frames of a text object are either all constant or all variable, as indicated by the attribute CONST. The value of this attribute remains fixed throughout the lifetime of the text object. A constant main frame always corresponds to a string (see 1.6).
The attribute SIZE is always positive and remains fixed throughout the lifetime of a text object.
Note: The identifier TEXTOBJ and its three attribute identifiers are not accessible to the user. Instead, properties of a text object are accessible through text variables, using the dot notation.
Note: In this implementation the characters in MAIN are indexed 0 through SIZE-1.
Link to GitHub: Source File.
- Author:
- SIMULA Standards Group, Øystein Myhre Andersen
-
Nested Class Summary
Nested classes/interfaces inherited from class simula.runtime.RTS_RTObject
RTS_RTObject.ForElt, RTS_RTObject.ForList, RTS_RTObject.ForListIterator, RTS_RTObject.OperationalState, RTS_RTObject.RTS_BOOLEAN_ARRAY, RTS_RTObject.RTS_BOUNDS, RTS_RTObject.RTS_CHARACTER_ARRAY, RTS_RTObject.RTS_INTEGER_ARRAY, RTS_RTObject.RTS_LABEL, RTS_RTObject.RTS_LONG_REAL_ARRAY, RTS_RTObject.RTS_NAME<T>, RTS_RTObject.RTS_REAL_ARRAY, RTS_RTObject.RTS_REALTYPE_ARRAY, RTS_RTObject.RTS_REF_ARRAY<T>, RTS_RTObject.RTS_TEXT_ARRAY, RTS_RTObject.SingleElt<T>, RTS_RTObject.SingleTValElt, RTS_RTObject.StepUntil, RTS_RTObject.UncaughtExceptionHandler, RTS_RTObject.WhileElt<T>, RTS_RTObject.WhileTValElt
-
Field Summary
Modifier and TypeFieldDescription(package private) final boolean
True: Indicates a text constant(package private) final char[]
The characters(package private) final int
Number of characters in the text object.Fields inherited from class simula.runtime.RTS_RTObject
_CORUT, _CTX, _CUR, _DL, _INPUT_LINELENGTH, _JTX, _OUTPUT_LINELENGTH, _SL, _STATE, _SYSIN, _SYSOUT, NOTEXT
-
Constructor Summary
ConstructorDescriptionRTS_TEXTOBJ
(int size, boolean cnst) Create a new TEXTOBJ of the given size.Create a new TEXTOBJ with initial text. -
Method Summary
Methods inherited from class simula.runtime.RTS_RTObject
_ASGSTR, _ASGTXT, _GOTO, _JUMPTABLE, _JUMPTABLE, _LABEL, _PRE_LABEL, _PRE_TABLE, _SIM_LABEL, _STM, _TXTREL_EQ, _TXTREL_GE, _TXTREL_GT, _TXTREL_LE, _TXTREL_LT, _TXTREL_NE, _VALUE, arrayValue, BBLK, blanks, BPRG, call, call, CONC, copy, detach, detach, detach, doubleValue, EBLK, edObjectAttributes, edObjectIdent, floatValue, getErrorMessage, intValue, isDetachUsed, isQPSystemBlock, objectTraceIdentifier, objectTraceIdentifier, objectValue, procValue, resume, resume, resume, swapCoroutines, sysin, sysout, terminate_program, TRACE_GOTO, TRF_EQ, TRF_NE
-
Field Details
-
SIZE
final int SIZENumber of characters in the text object. -
CONST
final boolean CONSTTrue: Indicates a text constant -
MAIN
final char[] MAINThe characters
-
-
Constructor Details
-
RTS_TEXTOBJ
RTS_TEXTOBJ(int size, boolean cnst) Create a new TEXTOBJ of the given size.- Parameters:
size
- the givent sizecnst
- true if this text object is constant
-
RTS_TEXTOBJ
RTS_TEXTOBJ(String s) Create a new TEXTOBJ with initial text.- Parameters:
s
- the initial text value
-
-
Method Details
-
fill
void fill(char c) Utility to fill the text object with the given character.- Parameters:
c
- the given character
-
edText
Edit a part of this text into a String.- Parameters:
start
- the start indexlength
- the length- Returns:
- the resulting String
-
toString
Description copied from class:RTS_RTObject
Returns a string representation of the object.- Overrides:
toString
in classRTS_RTObject
-