Top Method Summary
Options Name Purpose
AssignLineBounds (longchar, integer) Assigns the LineStart / LineEnd / WholeLines fields of the current ttAnnotation record
CHARACTER EscapeValue (character) Escapes the tildes and double quotes of an annotation value
INTEGER FindClosingParenthesis (longchar, integer, integer) Returns the position of the parenthesis closing the one at the given position
CHARACTER FormatAnnotation (character, JsonObject) Formats an annotation statement from the given attributes
Progress.Json.ObjectModel.JsonArray GetAnnotations (longchar, character) Returns the annotation statements with the given name from the given source code
Progress.Json.ObjectModel.JsonArray GetAnnotationsFromFile (character, character) Returns the annotation statements with the given name from the given source file
CHARACTER GetAttributeValue (JsonObject, character) Returns the value of the given attribute of the given JsonObject
CHARACTER GetLineBreak (longchar) Returns the line break style of the given source code
INTEGER LineStartOf (longchar, integer) Returns the 1-based position of the first character of the line containing the given position
INTEGER LocateClassStatement (longchar) Locates the CLASS statement in the given source code
CHARACTER NormalizeAnnotationName (character) Returns the annotation name with the leading @
ParseAttributes (character, JsonObject) Parses the parameter list of an annotation statement into the given JsonObject
INTEGER ParseStatement (longchar, integer, integer) Parses the annotation statement starting at the given position
ScanAnnotations (longchar) Scans the given source code for annotation statements
INTEGER SkipAnnotation (longchar, integer, integer) Returns the position following the annotation statement starting at the given position
INTEGER SkipStringLiteral (longchar, integer, integer) Returns the position following the string literal starting at the given position
INTEGER SkipWhitespace (longchar, integer, integer) Returns the position of the first non-whitespace character at or after the given position
CHARACTER UnescapeValue (character) Resolves the tilde escape sequences of an annotation value
LOGICAL UpdateAnnotations (character, character, longchar, character, character) Removes the selected annotation statements from the given class file and inserts the given block of annotation statements in their place
LONGCHAR UpdateAnnotationsInSource (longchar, character, longchar, character, character) Removes the selected annotation statements from the given source code and inserts the given block of annotation statements in their place


Method Detail
Top

AssignLineBounds (longchar, integer)

Purpose: Assigns the LineStart / LineEnd / WholeLines fields of the
current ttAnnotation record
Notes: A statement occupies its lines alone when only spaces and tabs
precede it on its first line and follow it on its last line.
Then the span to remove covers the whole lines including the
trailing line break, otherwise it covers the statement only

Parameters:
plcSource LONGCHAR
The source code
piLength INTEGER
The length of the source code
Top

CHARACTER EscapeValue (character)

Purpose: Escapes the tildes and double quotes of an annotation value
Notes:

Parameters:
pcValue CHARACTER
The value to escape
Returns CHARACTER
The value as it has to be written into a double quoted annotation attribute
Top

INTEGER FindClosingParenthesis (longchar, integer, integer)

Purpose: Returns the position of the parenthesis closing the one at the
given position
Notes: String literals and nested parentheses are honoured

Parameters:
plcSource LONGCHAR
The source code
piPosition INTEGER
The 1-based position of the opening parenthesis
piLength INTEGER
The length of the source code
Returns INTEGER
The 1-based position of the closing parenthesis, or 0 when it is missing
Top

CHARACTER FormatAnnotation (character, JsonObject)

Purpose: Formats an annotation statement from the given attributes
Notes: The attributes are written in the order of the JsonObject
properties, one attribute per line, the continuation lines
aligned with the first attribute. Logical properties are
written as true / false, null properties are skipped, every
other property is written as a quoted string. Tildes and
double quotes inside a value are escaped with a tilde

Parameters:
pcAnnotationName CHARACTER
The name of the annotation, with or without the leading @
poAttributes Progress.Json.ObjectModel.JsonObject
The JsonObject with the attributes of the statement
Returns CHARACTER
The formatted annotation statement
Top

Progress.Json.ObjectModel.JsonArray GetAnnotations (longchar, character)

Purpose: Returns the annotation statements with the given name from the
given source code
Notes: Each entry of the array is a JsonObject with the attributes of
one statement, in source order. The attribute names keep the
casing used in the source, the attribute values are returned
without the surrounding quotes and with the tilde escape
sequences resolved

Parameters:
plcSource LONGCHAR
The source code to scan
pcAnnotationName CHARACTER
The name of the annotation, with or without the leading @
Returns Progress.Json.ObjectModel.JsonArray
The JsonArray with the attributes of the matching statements
Top

Progress.Json.ObjectModel.JsonArray GetAnnotationsFromFile (character, character)

Purpose: Returns the annotation statements with the given name from the
given source file
Notes: Returns an empty JsonArray when the file does not exist. Each
entry of the array is a JsonObject with the attributes of one
statement, in source order

Parameters:
pcFileName CHARACTER
The name of the source file to scan
pcAnnotationName CHARACTER
The name of the annotation, with or without the leading @
Returns Progress.Json.ObjectModel.JsonArray
The JsonArray with the attributes of the matching statements
Top

CHARACTER GetAttributeValue (JsonObject, character)

Purpose: Returns the value of the given attribute of the given JsonObject
Notes: The attribute name is compared case-insensitively. Returns the
unknown value when the attribute does not exist

Parameters:
poAttributes Progress.Json.ObjectModel.JsonObject
The JsonObject with the attributes
pcAttributeName CHARACTER
The name of the attribute
Returns CHARACTER
The value of the attribute or ?
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

INTEGER LineStartOf (longchar, integer)

Purpose: Returns the 1-based position of the first character of the
line containing the given position
Notes:

Parameters:
plcSource LONGCHAR
The source code
piPosition INTEGER
The 1-based character position
Returns INTEGER
The 1-based position of the first character of that line
Top

INTEGER LocateClassStatement (longchar)

Purpose: Locates the CLASS statement in the given source code
Notes: The CLASS keyword is matched as a whole token outside of
comments and string literals

Parameters:
plcSource LONGCHAR
The source code to scan
Returns INTEGER
The 1-based position of the CLASS keyword, or 0 when the source has no CLASS statement
Top

CHARACTER NormalizeAnnotationName (character)

Purpose: Returns the annotation name with the leading @
Notes:

Parameters:
pcAnnotationName CHARACTER
The name of the annotation, with or without the leading @
Returns CHARACTER
The annotation name with the leading @
Top

ParseAttributes (character, JsonObject)

Purpose: Parses the parameter list of an annotation statement into the
given JsonObject
Notes: The parameters are name=value pairs separated by commas. A
value is either a string literal (double or single quoted, with
tilde escapes) or a bare token. A parameter without a value is
stored with an empty string

Parameters:
pcText CHARACTER
The text between the parentheses of the parameter list
poAttributes Progress.Json.ObjectModel.JsonObject
The JsonObject to add the parameters to
Top

INTEGER ParseStatement (longchar, integer, integer)

Purpose: Parses the annotation statement starting at the given position
Notes: Creates a ttAnnotation record when the @ is followed by an
annotation name. The statement ends with the period following
the optional parameter list; a statement without that period
ends with the closing parenthesis or the annotation name

Parameters:
plcSource LONGCHAR
The source code to scan
piStart INTEGER
The 1-based position of the @
piLength INTEGER
The length of the source code
Returns INTEGER
The 1-based position of the last character of the statement
Top

ScanAnnotations (longchar)

Purpose: Scans the given source code for annotation statements
Notes: Fills the ttAnnotation temp-table. Occurrences inside comments
(which nest in ABL) and inside string literals are ignored

Parameters:
plcSource LONGCHAR
The source code to scan
Top

INTEGER SkipAnnotation (longchar, integer, integer)

Purpose: Returns the position following the annotation statement
starting at the given position
Notes: Used while locating the CLASS statement, does not create a
ttAnnotation record

Parameters:
plcSource LONGCHAR
The source code
piPosition INTEGER
The 1-based position of the @
piLength INTEGER
The length of the source code
Returns INTEGER
The 1-based position following the statement
Top

INTEGER SkipStringLiteral (longchar, integer, integer)

Purpose: Returns the position following the string literal starting at
the given position
Notes: Tilde escapes inside the literal are honoured

Parameters:
plcSource LONGCHAR
The source code
piPosition INTEGER
The 1-based position of the opening quote
piLength INTEGER
The length of the source code
Returns INTEGER
The 1-based position following the closing quote
Top

INTEGER SkipWhitespace (longchar, integer, integer)

Purpose: Returns the position of the first non-whitespace character at
or after the given position
Notes:

Parameters:
plcSource LONGCHAR
The source code
piPosition INTEGER
The 1-based position to start at
piLength INTEGER
The length of the source code
Returns INTEGER
The 1-based position of the first non-whitespace character, or piLength + 1
Top

CHARACTER UnescapeValue (character)

Purpose: Resolves the tilde escape sequences of an annotation value
Notes: A tilde in front of a quote, a tilde or a curly brace is
removed, every other tilde sequence is kept as it is

Parameters:
pcValue CHARACTER
The value as written in the source
Returns CHARACTER
The value with the escape sequences resolved
Top

LOGICAL UpdateAnnotations (character, character, longchar, character, character)

Purpose: Removes the selected annotation statements from the given class
file and inserts the given block of annotation statements in
their place
Notes: See UpdateAnnotationsInSource for the rules. The file is only
rewritten when its content changes

Parameters:
pcFileName CHARACTER
The name of the class file to rewrite
pcRemoveKeys CHARACTER
The comma-delimited list of the statements to remove, see UpdateAnnotationsInSource
plcAnnotationBlock LONGCHAR
The annotation statements to insert, separated by line breaks - may be empty
pcGroupAnnotations CHARACTER
The comma-delimited list of annotation names the block is grouped with when nothing is removed
pcAnchorAnnotations CHARACTER
The comma-delimited list of annotation names the block is inserted in front of, in order of preference
Returns LOGICAL
TRUE when the file has been rewritten, FALSE when it was already up to date
Top

LONGCHAR UpdateAnnotationsInSource (longchar, character, longchar, character, character)

Purpose: Removes the selected annotation statements from the given
source code and inserts the given block of annotation
statements in their place
Notes: The statements to remove are selected by the entries of
pcRemoveKeys: an entry of the form @Name removes every
statement of that annotation, an entry of the form
@Name:value value removes the statements of that annotation whose
name attribute has the given value. A statement that occupies
its lines alone is removed together with those lines.
The block is inserted at the position of the first removed
statement. When nothing is removed, it is inserted directly
after the last remaining statement of the pcGroupAnnotations
annotations, so that the annotations of one group stay
together. When no such statement exists either, it is inserted
in front of the first pcAnchorAnnotations annotation found (in
the order of that list), and as a last resort in front of the
CLASS statement, separated from it by an empty line

Parameters:
plcSource LONGCHAR
The source code to rewrite
pcRemoveKeys CHARACTER
The comma-delimited list of the statements to remove
plcAnnotationBlock LONGCHAR
The annotation statements to insert, separated by line breaks - may be empty
pcGroupAnnotations CHARACTER
The comma-delimited list of annotation names the block is grouped with when nothing is removed
pcAnchorAnnotations CHARACTER
The comma-delimited list of annotation names the block is inserted in front of, in order of preference
Returns LONGCHAR
The resulting source code


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