Top Method Summary
Options Name Purpose
CHARACTER BuildImplementsPhrase (character, character, character, character) Builds the IMPLEMENTS phrase text for the given interface list
INTEGER ColumnOfPosition (longchar, integer) Returns the 1-based column of the given position within its source code line
CHARACTER GetImplementedInterfaces (character) Returns the comma-delimited list of interfaces named in the IMPLEMENTS phrase of the CLASS statement of the given file
CHARACTER GetImplementedInterfacesFromSource (longchar) Returns the comma-delimited list of interfaces named in the IMPLEMENTS phrase of the CLASS statement of the given source code
CHARACTER GetImplementsPhraseInterfaces () Returns the comma-delimited list of interface names of the IMPLEMENTS phrase in the tokenized CLASS statement header
INTEGER GetInsertAnchor () Returns the position at which a new IMPLEMENTS phrase is inserted into the tokenized CLASS statement header
CHARACTER GetLineBreak (longchar) Returns the line break style of the given source code
CHARACTER GetOptionIndent (longchar) Returns the indentation for a CLASS statement option inserted on a line of its own
CHARACTER GetTailIndent (longchar, integer) Returns the indentation for a header option moved to a line of its own after the IMPLEMENTS phrase
LocateClassHeader (longchar, integer, integer) Locates the CLASS statement header in the given source code
LocateImplementsPhrase (integer, integer) Locates the IMPLEMENTS phrase in the tokenized CLASS statement header
CHARACTER NormalizeInterfaceList (character) Normalizes the given comma-delimited interface list
LONGCHAR RemoveImplementsPhrase (longchar, integer, integer) Removes the IMPLEMENTS phrase from the given source code
CHARACTER ResolveFileName (character) Resolves the given file name against the file system
INTEGER SkipSpacesAndTabs (longchar, integer) Returns the position of the first character at or after the given position that is neither a space nor a tab
LOGICAL TailStartsHeaderOption (longchar, integer) Returns whether the given position starts a further CLASS statement header option on the same line
TokenizeClassHeader (longchar, integer, integer) Tokenizes the CLASS statement header into the ttHeaderToken temp-table
LOGICAL UpdateImplementsPhrase (character, character, character) Inserts, updates or removes the IMPLEMENTS phrase of the CLASS statement of the given file so that it matches the given comma-delimited list of interfaces
LONGCHAR UpdateImplementsPhraseInSource (longchar, character, character) Inserts, updates or removes the IMPLEMENTS phrase of the CLASS statement of the given source code so that it matches the given comma-delimited list of interfaces


Method Detail
Top

CHARACTER BuildImplementsPhrase (character, character, character, character)

Purpose: Builds the IMPLEMENTS phrase text for the given interface list
Notes: With multiple interfaces one interface is written per line,
the continuation lines aligned with the first interface name

Parameters:
pcInterfaces CHARACTER
The normalized comma-delimited list of interface names
pcImplementsKeyword CHARACTER
The keyword text to use for IMPLEMENTS
pcIndent CHARACTER
The indentation whitespace of the line the phrase starts on
pcLineBreak CHARACTER
The line break characters of the source code
Returns CHARACTER
The IMPLEMENTS phrase text
Top

INTEGER ColumnOfPosition (longchar, integer)

Purpose: Returns the 1-based column of the given position within its
source code line
Notes:

Parameters:
plcSource LONGCHAR
The source code
piPosition INTEGER
The 1-based character position
Returns INTEGER
The 1-based column of the position within its line
Top

CHARACTER GetImplementedInterfaces (character)

Purpose: Returns the comma-delimited list of interfaces named in the
IMPLEMENTS phrase of the CLASS statement of the given file
Notes: Returns an empty string when the CLASS statement carries no
IMPLEMENTS phrase

Parameters:
pcFileName CHARACTER
The name of the class file to inspect
Returns CHARACTER
The comma-delimited list of implemented interfaces
Top

CHARACTER GetImplementedInterfacesFromSource (longchar)

Purpose: Returns the comma-delimited list of interfaces named in the
IMPLEMENTS phrase of the CLASS statement of the given source
code
Notes: Returns an empty string when the CLASS statement carries no
IMPLEMENTS phrase

Parameters:
plcSource LONGCHAR
The source code of the class file to inspect
Returns CHARACTER
The comma-delimited list of implemented interfaces
Top

CHARACTER GetImplementsPhraseInterfaces ()

Purpose: Returns the comma-delimited list of interface names of the
IMPLEMENTS phrase in the tokenized CLASS statement header
Notes: Requires a previous TokenizeClassHeader call

Returns CHARACTER
The comma-delimited list of implemented interfaces
Top

INTEGER GetInsertAnchor ()

Purpose: Returns the position at which a new IMPLEMENTS phrase is
inserted into the tokenized CLASS statement header
Notes: Requires a previous TokenizeClassHeader call. The phrase is
inserted after the INHERITS option when present, otherwise
after the class type name

Returns INTEGER
The 1-based position of the first character after the anchor token
Top

CHARACTER GetLineBreak (longchar)

Purpose: Returns the line break style of the given source code
Notes: Returns CR/LF when the source contains a CR/LF sequence,
a plain LF otherwise

Parameters:
plcSource LONGCHAR
The source code
Returns CHARACTER
The line break characters
Top

CHARACTER GetOptionIndent (longchar)

Purpose: Returns the indentation for a CLASS statement option inserted
on a line of its own
Notes: Requires a previous TokenizeClassHeader call. Uses the
indentation of the line the INHERITS keyword starts on when
the keyword is the first token on its line, four spaces
otherwise

Parameters:
plcSource LONGCHAR
The source code the header was tokenized from
Returns CHARACTER
The indentation whitespace
Top

CHARACTER GetTailIndent (longchar, integer)

Purpose: Returns the indentation for a header option moved to a line of
its own after the IMPLEMENTS phrase
Notes: Uses the indentation of the line the phrase starts on when the
phrase is the first token on its line, the option indentation
otherwise

Parameters:
plcSource LONGCHAR
The source code
piFrom INTEGER
The 1-based position of the IMPLEMENTS keyword
Returns CHARACTER
The indentation whitespace
Top

LocateClassHeader (longchar, integer, integer)

Purpose: Locates the CLASS statement header in the given source code
Notes: The CLASS keyword is matched as a whole token outside of
comments and string literals. The header ends at the first
colon outside of comments and string literals that follows
the CLASS keyword

Parameters:
plcSource LONGCHAR
The source code to scan
piClassStart INTEGER
OUTPUT The 1-based position of the CLASS keyword
piColon INTEGER
OUTPUT The 1-based position of the terminating colon
Top

LocateImplementsPhrase (integer, integer)

Purpose: Locates the IMPLEMENTS phrase in the tokenized CLASS statement
header
Notes: Requires a previous TokenizeClassHeader call. The phrase spans
from the IMPLEMENTS keyword to the end of the last interface
name token before the next CLASS statement option

Parameters:
piFrom INTEGER
OUTPUT The 1-based position of the IMPLEMENTS keyword, 0 when the header carries no phrase
piTo INTEGER
OUTPUT The 1-based position of the first character after the last interface name token
Top

CHARACTER NormalizeInterfaceList (character)

Purpose: Normalizes the given comma-delimited interface list
Notes: Entries are trimmed, empty entries are removed

Parameters:
pcInterfaces CHARACTER
The comma-delimited list of interface names
Returns CHARACTER
The normalized comma-delimited list of interface names
Top

LONGCHAR RemoveImplementsPhrase (longchar, integer, integer)

Purpose: Removes the IMPLEMENTS phrase from the given source code
Notes: When the phrase occupies complete lines, those lines are
removed including the preceding line break. When it shares its
line with other header options, only the phrase itself and one
adjacent whitespace run are removed, so the remaining options
keep their spacing

Parameters:
plcSource LONGCHAR
The source code to rewrite
piFrom INTEGER
The 1-based position of the IMPLEMENTS keyword, 0 when the header carries no phrase
piTo INTEGER
The 1-based position of the first character after the last interface name token
Returns LONGCHAR
The resulting source code
Top

CHARACTER ResolveFileName (character)

Purpose: Resolves the given file name against the file system
Notes: Raises an error when the file does not exist

Parameters:
pcFileName CHARACTER
The name of the class file
Returns CHARACTER
The resolved file name
Top

INTEGER SkipSpacesAndTabs (longchar, integer)

Purpose: Returns the position of the first character at or after the
given position that is neither a space nor a tab
Notes:

Parameters:
plcSource LONGCHAR
The source code
piPosition INTEGER
The 1-based character position to start at
Returns INTEGER
The 1-based position of the first character that is neither a space nor a tab
Top

LOGICAL TailStartsHeaderOption (longchar, integer)

Purpose: Returns whether the given position starts a further CLASS
statement header option on the same line
Notes: Returns FALSE when the position is beyond the source, on a
line break or on the terminating colon - those may follow the
IMPLEMENTS phrase directly

Parameters:
plcSource LONGCHAR
The source code
piPosition INTEGER
The 1-based position of the first character after the phrase and its trailing whitespace
Returns LOGICAL
TRUE when a further header option follows on the same line
Top

TokenizeClassHeader (longchar, integer, integer)

Purpose: Tokenizes the CLASS statement header into the ttHeaderToken
temp-table
Notes: Comments inside the header act as token separators, a comma
becomes a token of its own

Parameters:
plcSource LONGCHAR
The source code to scan
piClassStart INTEGER
The 1-based position of the CLASS keyword
piColon INTEGER
The 1-based position of the terminating colon
Top

LOGICAL UpdateImplementsPhrase (character, character, character)

Purpose: Inserts, updates or removes the IMPLEMENTS phrase of the CLASS
statement of the given file so that it matches the given
comma-delimited list of interfaces
Notes: An empty interface list removes the phrase. The file is only
written when the resulting source differs from the current
content, so running the writer over an already-correct header
leaves the file untouched

Parameters:
pcFileName CHARACTER
The name of the class file to rewrite
pcInterfaces CHARACTER
The comma-delimited list of interfaces the class should implement
pcImplementsKeyword CHARACTER
The keyword text to use for IMPLEMENTS (e.g. "implements" or "IMPLEMENTS")
Returns LOGICAL
TRUE when the file has been rewritten, FALSE when it was already up to date
Top

LONGCHAR UpdateImplementsPhraseInSource (longchar, character, character)

Purpose: Inserts, updates or removes the IMPLEMENTS phrase of the CLASS
statement of the given source code so that it matches the
given comma-delimited list of interfaces
Notes: An empty interface list removes the phrase. When the header
already matches the requested interface list, the source is
returned unchanged. With multiple interfaces the phrase is
written one interface per line, the continuation lines aligned
with the first interface name. A header option following the
last interface on the same line moves to a line of its own -
unless only the terminating colon follows

Parameters:
plcSource LONGCHAR
The source code of the class file to rewrite
pcInterfaces CHARACTER
The comma-delimited list of interfaces the class should implement
pcImplementsKeyword CHARACTER
The keyword text to use for IMPLEMENTS (e.g. "implements" or "IMPLEMENTS")
Returns LONGCHAR
The resulting source code


©2006-2026 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       19.09.2026 10:18:52