FB_BA_StringTokenizerLX

Abstract function block for concatenating strings with an unlimited number of nesting levels. The function block analyzes strings containing nested placeholders and tokens and provides structured information for evaluation. This function block is designed to serve as the foundation for derived tokenizer implementations and enables specialized processing of the parsed tokens. Derived classes must implement the abstract method TermSign() to define the required delimiters.
Syntax
FUNCTION_BLOCK ABSTRACT FB_BA_StringTokenizerLX
VAR_OUTPUT
nTokenCount : BYTE;
nMaxTokenLevel : BYTE;
END_VAR
END_FUNCTION_BLOCK
Outputs
Name | Type | Description |
|---|---|---|
nTokenCount | BYTE | Number of tokens recognized in the analyzed string. |
nMaxTokenLevel | BYTE | Maximum nesting depth of the detected tokens. |
Methods
Name | Definition location | Description |
|---|---|---|
Local | Primary method for concatenation. Parses the input string and generates the token structure. | |
Local | Variant for the ANY_STRING parameter. | |
Local | Resets the tokenizer and deletes all parsed tokens. | |
Local | Abstract method. Must be implemented by derived classes. Defines the opening, closing, and separator characters for the tokenization levels. | |
Local | Compares the name of a term with a passed-in string. | |
Local | Compares the value of a term to a passed-in string. | |
Local | Retrieves a child term at a specific index. | |
Local | Retrieves a child token at a specific index. | |
Local | Retrieves information about the terms contained in a token (number, name, and value). | |
Local | Determines the maximum nesting depth of a term. | |
Local | Determines the maximum nesting depth of a token. | |
Local | Retrieves the name of a term as an ANY type. | |
Local | Retrieves the name of a term as a pointer. | |
Local | Retrieves the value of a term as an ANY type. | |
Local | Retrieves the value of a term as a pointer. | |
Local | Replaces a token with a new value (ANY_STRING parameter). | |
Local | Replaces a token with a new value. |
Properties
Name | Type | Access | Definition location | Description |
|---|---|---|---|---|
LogMsg | Get | Local | Reference to the logging framework (can be overridden in subclasses, if desired). |
Examples of token formats
"Some text with a [Placeholder]."Token: Placeholder
"Some text with a [Placeholder=123]."Token: Placeholder with value: 123
"[AA=11{BB=22(xxx=666,yyy=777,zzz=888),CC=33(xx=66),DD=44(yy=77)},EE=55,FF=66]"Nested tokens with values (3 levels)
![]() |
|
