Top Method Summary
Options Name Purpose
AppendTypeArguments (integer) Appends an immediately adjacent type-argument / array suffix (<...> / [...]) of a bound generic type to a TYPE_NAME node Notes : Mirrors the reference grammar's type_name2 rule, which appends adjacent type_name_part tokens (no hidden token in between; LEFTBRACE / RIGHTBRACE / LEFTANGLE / RIGHTANGLE explicitly allowed for generics and .NET arrays) to the TYPE_NAME token text - a bound generic type (Foo<Bar>) is ONE TYPE_NAME node. The merge deliberately starts only at a LEFTANGLE / LEFTBRACE directly behind the base name and ends when the bracket depth returns to zero (unless another suffix follows directly), at a hidden token, or at one of the tokens non_punctuating excludes (PERIOD / LEXCOLON / LEFTPAREN) (SCL-5563). @param piNodeId The TYPE_NAME node id */
ApplyNaturalOfType (integer, integer) Applies the reference engine's natural flag for a node type Notes : Natural is a property of the node TYPE, not of the individual node (SCL-5477): a node whose type is a real ABL token type is natural even when the parser synthesised it (the INPUT wrapping a parameter), while Proparse's imaginary structural types (Field_ref, Widget_ref, Array_subscript, ...) are not. @param piNodeId The node id @param piNodeType The node type */
BeginParse (NodeStore, ListProToken, integer) Adopts a store, token stream and start index for a parse Notes : Shared setup of ParseInto / ParseOperandInto. @param poStore The node store to build into @param poTokens The token stream @param piStartIndex The 1-based token index to start at */
INTEGER ComparisonNodeType (integer) Returns the canonical comparison node type for a token type Notes : Maps the symbolic forms to their keyword equivalents; returns 0 when the token is not a comparison operator. @param piType The token type @return The canonical comparison node type, or 0 */
INTEGER ConsumeAs (integer, integer) Creates a node for the current natural token but with an overriding (canonical) node type, keeping the token text, and advances Notes : Used for operators whose lexer token type differs from the Proparse operator node type (e.g. EQUAL -> EQ, STAR -> MULTIPLY, prefix MINUS -> UNARY_MINUS). @param piParentId The parent node id @param piNodeType The canonical node type to assign @return The new node id */
INTEGER ConsumeAs (integer, integer, integer) Creates a node for the current natural token with an overriding node type and node sub type, keeping the token text, and advances Notes : The sub type decides which INode implementation the node store hands out - a RECORD_NAME has to be created as a RecordNameNode for consumers to reach the IRecordNameNode members (SCL-5482). @param piParentId The parent node id @param piNodeType The canonical node type to assign @param piSubType The node sub type (a NodeSubTypesEnum numeric value) @return The new node id */
ConsumeMemberName (integer) Consumes a member name after a colon accessor Notes : Any token may serve as a member name and it keeps its token type (o:total stays TOTAL, SCL-5460) - except a RESERVED keyword that is not a system handle and is itself followed by another colon, which the reference re-types to ID (the token BEFORE an OBJCOLON, TokenList.reviewObjcolon, SCL-5499): hBuffer:table-handle:origin-handle yields an ID for table-handle, while a trailing hBuffer:table-handle keeps the keyword type. @param piWidgetId The Widget_ref node id the member is appended to */
INTEGER ConsumeNatural (integer) Creates a node for the current natural token (its own type and text) as a child of a parent, and advances Notes : Assumes the cursor is on a natural token. @param piParentId The parent node id @return The new node id */
INTEGER CreateStructural (integer, integer) Creates a synthetic structural node (no source token) with empty text as a child of a parent Notes : Used for the Proparse structural nodes Field_ref / Widget_ref / Array_subscript / Method_param_list / INPUT. @param piParentId The parent node id @param piNodeType The node type @return The new node id */
INTEGER CreateStructural (integer, integer, integer) Creates a synthetic structural node of a given node sub type Notes : The sub type decides which INode implementation the node store hands out, so a Field_ref has to be created as a FieldRefNode for consumers to reach the IFieldRefNode members (SCL-5475). The sub type-less overload leaves the node a plain JPNode. @param piParentId The parent node id @param piNodeType The node type @param piSubType The node sub type (a NodeSubTypesEnum numeric value) @return The new node id */
CHARACTER CurrentText () Returns the text of the current natural token Notes : Assumes the cursor was positioned via CurrentType. @return The token text */
INTEGER CurrentType () Returns the type of the current natural token (skipping hidden) Notes : @return The token type, or 0 at end of the stream */
LOGICAL IsFunctionName (character) Returns whether a name is a known user-defined function name Notes : Case-insensitive lookup in the comma-delimited FunctionNames list. @param pcName The identifier text @return Logical value */
LOGICAL IsHidden (integer) Returns whether a token type is hidden (whitespace / comment / marker) and therefore skipped by the expression parser Notes : @param piType The token type @return Logical value */
LOGICAL IsIdentifierType (integer) Returns whether a token type may serve as an identifier Notes : An ID, or an unreserved keyword (the .NET Proparse grammar's unreservedkeyword rule) - such a token is re-typed to ID at the identifier position. @param piType The token type @return Logical value */
LOGICAL IsMethodName (character) Returns whether a name is a registered keyword-colliding method name of the current unit Notes : Case-insensitive lookup in the comma-delimited MethodNames list. @param pcName The identifier text @return Logical value */
LOGICAL IsRecordFunctionType (integer) Returns whether a token type is a record function keyword Notes : The reference grammar's recordfunc rule, without ERROR and NEW (both also head non-record forms and need the schema to decide) @param piType The token type @return Logical value */
INTEGER NextNaturalType () Returns the type of the natural token following the current one without moving the cursor Notes : One-token natural lookahead (function-call detection). @return The token type, or 0 when there is no such token */
INTEGER ParseAdditive (integer) Parses an additive expression (+ / -) Notes : @param piParentId The parent node id @return The expression subtree root id */
INTEGER ParseAnd (integer) Parses an AND expression Notes : @param piParentId The parent node id @return The expression subtree root id */
ParseArraySubscript (integer) Parses an array subscript ( [ expression ] ) under a parent Notes : Structure: Array_subscript > { LEFTBRACE, <expression>, RIGHTBRACE }. @param piParentId The parent node id (a Field_ref or Widget_ref) */
INTEGER ParseBuiltinFunction (integer) Parses a built-in function call keyword ( args ) under a parent Notes : Structure: <FUNC> > { LEFTPAREN, <expr>, COMMA, <expr>, ..., RIGHTPAREN }. Built-in function arguments are plain expressions, NOT INPUT-wrapped (unlike method parameters). @param piParentId The parent node id @return The function node id */
ParseCallArgument (integer) Parses one call argument with its parameter mode wrapper Notes : An explicit INPUT / OUTPUT / INPUT-OUTPUT keyword is the argument's wrapper node itself (a natural node carrying the keyword text); without one a synthetic INPUT is created - the reference never stacks a synthetic INPUT on top of an explicit mode (SCL-5498). @param piListId The parent node id (the call or parameter list node) */
INTEGER ParseCallWithInputArgs (integer, integer) Parses a user-defined function or local method call: USER_FUNC | LOCAL_METHOD_REF > { LEFTPAREN, INPUT > <expr>, COMMA, ..., RIGHTPAREN } Notes : Verified against the .NET Proparse AST: each argument is wrapped in a synthetic INPUT node; the commas are direct children of the call node (there is no Method_param_list wrapper). The same shape serves USER_FUNC (a registered function name) and LOCAL_METHOD_REF (a method call in a class unit, SCL-5497). @param piParentId The parent node id @param piNodeType The call node type (USER_FUNC or LOCAL_METHOD_REF) @return The call node id */
INTEGER ParseCanFind (integer) Parses a CAN-FIND function with its embedded record phrase Notes : Structure: CANFIND > { LEFTPAREN, [FIRST | LAST], RECORD_NAME > { [WHERE > <expression>], <lock / wait options> }, RIGHTPAREN }, verified against the .NET AST (SCL-5482). Lock / wait options (NO-LOCK, SHARE-LOCK, EXCLUSIVE-LOCK, NO-WAIT, NO-PREFETCH) belong to the record phrase and nest under the RECORD_NAME (SCL-5514); any other token before the closing parenthesis is kept flat under the CANFIND node. The CANFIND node carries the BlockNode subtype - CAN-FIND opens a scope in the reference engine (canFindBegin in the Java TP01Support), so the reference AST hands the node out as a BlockNode (SCL-5510). @param piParentId The parent node id @return The CANFIND node id */
INTEGER ParseComparison (integer) Parses a comparison expression Notes : Canonicalizes the symbolic comparison tokens to the Proparse operator node types. @param piParentId The parent node id @return The expression subtree root id */
INTEGER ParseDynamicFunction (integer) Parses a DYNAMIC-FUNCTION call: DYNAMICFUNCTION > { LEFTPAREN, <name-expr>, COMMA, INPUT > <expr>, ..., RIGHTPAREN, [NOERROR_KW] } Notes : Verified against the .NET Proparse AST: the first argument (the function name expression) is NOT INPUT-wrapped; the remaining arguments are. An IN <handle> clause after the name expression is consumed flat, so no token is lost. A trailing NO-ERROR belongs to the call - the reference grammar's alternative ends in a greedy (NOERROR_KW)?, which DYNAMIC-INVOKE and plain function calls do not have (SCL-5531). @param piParentId The parent node id @return The DYNAMICFUNCTION node id */
INTEGER ParseDynamicInvoke (integer) Parses a DYNAMIC-INVOKE call: DYNAMICINVOKE > { LEFTPAREN, <target-expr>, COMMA, <name-expr>, COMMA, INPUT > <expr>, ..., RIGHTPAREN } Notes : The reference grammar's DYNAMICINVOKE alternative: the target (an expression term or type name) and the method name expression are NOT INPUT-wrapped - a name concatenation builds a real expression tree - while the remaining arguments are (SCL-5502). @param piParentId The parent node id @return The DYNAMICINVOKE node id */
INTEGER ParseDynamicNewExpression (integer) Parses a DYNAMIC-NEW object expression Notes : Shape: DYNAMICNEW > { <type expression>, Parameter_list > { LEFTPAREN, <arguments>, RIGHTPAREN } }, matching the reference grammar's "dynamic_new : DYNAMICNEW^ expression parameterlist". * Unlike NEW, the type is an arbitrary character expression rather than a type name, so it keeps its own node type (a QSTRING stays a QSTRING, a variable becomes a Field_ref) instead of being re-typed to TYPE_NAME. The lInDynamicNew flag is held over the type expression only, so the argument list is not mistaken for a method call's (SCL-5535). @param piParentId The parent node id @return The DYNAMICNEW node id */
INTEGER ParseFieldReference (integer) Parses an identifier reference: Field_ref, growing into a Widget_ref when an attribute / method chain (:) follows Notes : @param piParentId The parent node id @return The Field_ref or Widget_ref node id */
INTEGER ParseIfExpression (integer) Parses an IF expression: IF > { <condition>, THEN, <expr>, [ ELSE, <expr> ] } Notes : Verified against the .NET Proparse AST: THEN and ELSE are flat children of the IF node; the branch expressions are their following siblings. @param piParentId The parent node id @return The IF node id */
INTEGER ParseInto (NodeStore, ListProToken, integer, integer) Parses one expression from a token stream into an existing store Notes : The reusable entry point a statement parser calls at an expression position. Parsing starts at piStartIndex; the expression subtree is built as (the last) child of piParentId (pass 0 to build the root as a store root node). NextIndex is left at the first token the expression did not consume. @param poStore The node store to build into @param poTokens The token stream @param piStartIndex The 1-based token index to start at @param piParentId The parent node id the expression is appended under (0 for a root) @return The expression root node id, or 0 when there is no expression */
ParseInUicTail (integer) Consumes the optional IN FRAME / MENU / BROWSE / SUB-MENU / BUFFER tail of a widget attribute reference Notes : The reference grammar's inuic clause roots IN_KW over the object keyword and the widget name (re-typed to ID) and nests inside the Widget_ref - widattr is the attribute chain followed by (inuic)?, on either side of an assignment (x:SENSITIVE IN FRAME f = ..., y = x:SENSITIVE IN FRAME f) (SCL-5533, SCL-5748). IN WINDOW is not an inuic form and is left to the statement parser. @param piWidgetId The Widget_ref node id */
ParseMethodParamList (integer) Parses a method parameter list ( ( arg, arg, ... ) ) under a parent Notes : Structure: Method_param_list > { LEFTPAREN, INPUT > <expr>, COMMA, INPUT > <expr>, ..., RIGHTPAREN }. Each argument is wrapped in a synthetic INPUT node (the default parameter mode). @param piParentId The parent node id (a Widget_ref) */
INTEGER ParseMultiplicative (integer) Parses a multiplicative expression (* / MODULO) Notes : Canonicalizes STAR -> MULTIPLY and SLASH -> DIVIDE. @param piParentId The parent node id @return The expression subtree root id */
INTEGER ParseNewExpression (integer) Parses a NEW expression: NEW > { TYPE_NAME, Parameter_list > { LEFTPAREN, INPUT > <expr>, COMMA, ..., RIGHTPAREN } } Notes : The class name is re-typed to TYPE_NAME even when it collides with a keyword, e.g. "new Dictionary ()" (SCL-5470). Without a following LEFTPAREN the bare NEW node is returned unchanged. @param piParentId The parent node id @return The NEW node id */
INTEGER ParseNot (integer) Parses a NOT expression (prefix, lower precedence than comparison) Notes : @param piParentId The parent node id @return The expression subtree root id */
INTEGER ParseOperandInto (NodeStore, ListProToken, integer, integer) Parses one AND-level operand from a token stream into an existing store (an expression up to but not including a top-level OR) Notes : Used at expression positions where a top-level OR is a separator rather than a boolean operator - notably a CASE WHEN value list (WHEN a OR WHEN b), where the driving parser groups the operands under the OR / nested WHEN nodes itself. Otherwise identical to ParseInto (starts one precedence level above OR). @param poStore The node store to build into @param poTokens The token stream @param piStartIndex The 1-based token index to start at @param piParentId The parent node id the operand is appended under (0 for a root) @return The operand root node id, or 0 when there is no operand */
INTEGER ParseOr (integer) Parses an OR expression Notes : @param piParentId The parent node id @return The expression subtree root id */
ParseParameterDatasetOptions (integer) Consumes the optional APPEND / BY-VALUE / BY-REFERENCE / BIND options of a TABLE / DATASET style call argument Notes : The reference grammar's parameter_dataset_options rule - "(APPEND)? (BYVALUE|BYREFERENCE|BIND)?" - the option keywords sit flat inside the parameter's mode node (SCL-5553). @param piModeId The parameter mode node id */
INTEGER ParsePrimary (integer) Parses a primary (atom) expression Notes : @param piParentId The parent node id @return The primary subtree root id, or 0 at end of the stream */
INTEGER ParseRecordFunction (integer) Parses a record function: <FUNC> > { [LEFTPAREN,] RECORD_NAME [, RIGHTPAREN] } Notes : The reference grammar's recordfunc rule - AVAILABLE / AMBIGUOUS / LOCKED / RECID / ROWID / ... own a record reference, bare or parenthesized, and the table name becomes a RECORD_NAME (SCL-5486). @param piParentId The parent node id @return The function node id */
INTEGER ParseReferenceInto (NodeStore, ListProToken, integer, integer) Parses one primary-level reference (Field_ref / Widget_ref chain with array subscripts) from a token stream into an existing store Notes : Used by a statement parser for an assignment left-hand side, where a following "=" is the assignment operator and must NOT be consumed as a comparison. Parses exactly one primary; NextIndex is left at the first token the reference did not consume. @param poStore The node store to build into @param poTokens The token stream @param piStartIndex The 1-based token index to start at @param piParentId The parent node id the reference is appended under (0 for a root) @return The reference root node id, or 0 when there is no reference */
INTEGER ParseSource (longchar, character) Lexes and parses a single in-memory expression into a record AST Notes : Convenience entry point for testing an isolated expression. A fresh NodeStore is created; the expression root is built directly as a root node and returned via RootNodeId. @param plcSource The expression source (without a terminating period) @param pcFileName The (nominal) file name for position reporting @return The expression root node id */
INTEGER ParseSuperCall (integer) Parses a SUPER call: SUPER > { Parameter_list > { LEFTPAREN, INPUT > <expr>, COMMA, ..., RIGHTPAREN } } Notes : The reference grammar's "SUPER^ parameterlist" builtin function form (SCL-5503). The arguments are INPUT-wrapped inside the synthetic Parameter_list, as in a NEW expression. @param piParentId The parent node id @return The SUPER node id */
INTEGER ParseSystemHandleReference (integer) Parses a system handle member reference chain (THIS-OBJECT, SUPER, SESSION, THIS-PROCEDURE, CURRENT-WINDOW, SELF, ...) Notes : Structure: Widget_ref > { <system handle>, OBJCOLON | DOUBLECOLON, <member>, ... }. The chain part is identical to the one an identifier grows into, the difference being that the chain head is not itself a Field_ref (SCL-5490). @param piParentId The parent node id @return The Widget_ref node id */
INTEGER ParseTypeNameFunction (integer, logical) Parses a built-in function whose (last) argument is a type name: <FUNC> > { LEFTPAREN, [<expression>, COMMA,] TYPE_NAME, RIGHTPAREN } Notes : GET-CLASS (T), CAST (expr, T) and TYPE-OF (expr, T) - the type name is re-typed to TYPE_NAME as at the other type-name positions (SCL-5487). Like the NEW class name it may be a token that happens to be a keyword. @param piParentId The parent node id @param plLeadingExpression Whether an expression and a comma precede the type name @return The function node id */
INTEGER ParseUnary (integer) Parses a unary +/- expression (prefix, higher than multiplicative) Notes : A leading MINUS / PLUS becomes UNARY_MINUS / UNARY_PLUS. @param piParentId The parent node id @return The expression subtree root id */
INTEGER ParseWidnameReference (integer) Parses a named widget reference headed by a widget-kind keyword (BUFFER b:NAME, TEMP-TABLE tt:WRITE-XML (...), DATASET ds:...) Notes : Structure: Widget_ref > { <widget-kind keyword>, ID, OBJCOLON | DOUBLECOLON, <member>, ... } - the reference grammar's widname rule (without its systemhandlename alternative, which ParseSystemHandleReference covers). The keyword keeps its type and the widget name is re-typed to ID; neither is wrapped in a Field_ref (SCL-5500). @param piParentId The parent node id @return The Widget_ref node id */
INTEGER ParseXor (integer) Parses an XOR expression (lowest precedence) Notes : XOR binds looser than both OR and AND. Verified against the reference engine (SCL-5472): "lA or lB xor lC" yields XOR (OR (lA, lB), lC) and "lA xor lB and lC" yields XOR (lA, AND (lB, lC)), so XOR sits above OR in the ladder. @param piParentId The parent node id @return The expression subtree root id */
INTEGER PeekNaturalType (integer) Returns the type of the n-th natural token from the cursor without moving it Notes : PeekNaturalType (1) is the current natural token, PeekNaturalType (2) the one NextNaturalType returns, and so on. @param piAhead The 1-based natural token distance from the cursor @return The token type, or 0 when there is no such token */
SkipHidden () Advances the cursor over any hidden tokens, queueing them in the node store as pending leading hidden segments Notes : The pending queue lives in the shared node store, so hidden tokens survive the hand-over between the statement parser and this expression parser (SCL-5479) */
Consultingwerk.Studio.ProparseApi.Implementation.ProparseAbl.ProToken TokenAt (integer) Returns the token at a 1-based index Notes : @param piIndex The 1-based token index @return The ProToken */
INTEGER WrapAttributeChain (integer, integer) Wraps an expression term into a Widget_ref when an attribute / method chain follows it Notes : The reference grammar's exprt rule: exprt2 followed by attr_colon becomes a Widget_ref - cast (x, T):Attribute chains like any field reference (SCL-5499). Without a following chain the term is returned unchanged. @param piNodeId The expression term node id @param piParentId The parent node id the Widget_ref is appended under @return The Widget_ref node id, or the unchanged term node id */
INTEGER WrapEnteredFunction (integer, integer) Wraps a field-reference operand in an Entered_func node when it is followed by the ENTERED / NOT ENTERED postfix Notes : The reference grammar's exprt2 field alternative ends with "((NOT)? ENTERED)?" and wraps the whole thing: {## = #([Entered_func], ##)} - so the postfix binds tighter than any binary operator, and the tree is Entered_func > { Field_ref, [NOT], ENTERED } (SCL-5538). @param piParentId The parent node id @param piRefId The already-parsed field-reference node id @return The Entered_func node id, or piRefId when no postfix follows */

Top Constructor Summary
Options Name Purpose
ExpressionParser () Constructor for the ExpressionParser class Notes : Resolves the token / node type numbers once from the shared ProparseKeywords table. */

Top Property Summary
Options Name Purpose
CHARACTER FunctionNames
LOGICAL InClassUnit
CHARACTER MethodNames
INTEGER NextIndex
INTEGER RootNodeId
Consultingwerk.Studio.ProparseApi.Implementation.ProparseAbl.Nodes.NodeStore Store


Method Detail
Top

AppendTypeArguments (integer)

Purpose: Appends an immediately adjacent type-argument / array suffix
(<...> / [...]) of a bound generic type to a TYPE_NAME node
Notes : Mirrors the reference grammar's type_name2 rule, which appends
adjacent type_name_part tokens (no hidden token in between;
LEFTBRACE / RIGHTBRACE / LEFTANGLE / RIGHTANGLE explicitly
allowed for generics and .NET arrays) to the TYPE_NAME token
text - a bound generic type (Foo<Bar>) is ONE TYPE_NAME node.
The merge deliberately starts only at a LEFTANGLE / LEFTBRACE
directly behind the base name and ends when the bracket depth
returns to zero (unless another suffix follows directly), at a
hidden token, or at one of the tokens non_punctuating excludes
(PERIOD / LEXCOLON / LEFTPAREN) (SCL-5563).

Parameters:
piNodeId INTEGER
The TYPE_NAME node id
Top

ApplyNaturalOfType (integer, integer)

Purpose: Applies the reference engine's natural flag for a node type
Notes : Natural is a property of the node TYPE, not of the individual
node (SCL-5477): a node whose type is a real ABL token type is
natural even when the parser synthesised it (the INPUT wrapping a
parameter), while Proparse's imaginary structural types
(Field_ref, Widget_ref, Array_subscript, ...) are not.

Parameters:
piNodeId INTEGER
The node id
piNodeType INTEGER
The node type
Top

BeginParse (NodeStore, ListProToken, integer)

Purpose: Adopts a store, token stream and start index for a parse
Notes : Shared setup of ParseInto / ParseOperandInto.

Parameters:
poStore Consultingwerk.Studio.ProparseApi.Implementation.ProparseAbl.Nodes.NodeStore
The node store to build into
poTokens Consultingwerk.Studio.ProparseApi.Implementation.ProparseAbl.ListProToken
The token stream
piStartIndex INTEGER
The 1-based token index to start at
Top

INTEGER ComparisonNodeType (integer)

Purpose: Returns the canonical comparison node type for a token type
Notes : Maps the symbolic forms to their keyword equivalents; returns 0
when the token is not a comparison operator.

Parameters:
piType INTEGER
The token type
Returns INTEGER
The canonical comparison node type, or 0
Top

INTEGER ConsumeAs (integer, integer)

Purpose: Creates a node for the current natural token but with an
overriding (canonical) node type, keeping the token text, and
advances
Notes : Used for operators whose lexer token type differs from the
Proparse operator node type (e.g. EQUAL -> EQ, STAR -> MULTIPLY,
prefix MINUS -> UNARY_MINUS).

Parameters:
piParentId INTEGER
The parent node id
piNodeType INTEGER
The canonical node type to assign
Returns INTEGER
The new node id
Top

INTEGER ConsumeAs (integer, integer, integer)

Purpose: Creates a node for the current natural token with an overriding
node type and node sub type, keeping the token text, and advances
Notes : The sub type decides which INode implementation the node store
hands out - a RECORD_NAME has to be created as a RecordNameNode
for consumers to reach the IRecordNameNode members (SCL-5482).

Parameters:
piParentId INTEGER
The parent node id
piNodeType INTEGER
The canonical node type to assign
piSubType INTEGER
The node sub type (a NodeSubTypesEnum numeric value)
Returns INTEGER
The new node id
Top

ConsumeMemberName (integer)

Purpose: Consumes a member name after a colon accessor
Notes : Any token may serve as a member name and it keeps its token
type (o:total stays TOTAL, SCL-5460) - except a RESERVED
keyword that is not a system handle and is itself followed by
another colon, which the reference re-types to ID (the token
BEFORE an OBJCOLON, TokenList.reviewObjcolon, SCL-5499):
hBuffer:table-handle:origin-handle table-handle:origin-handle yields an ID for
table-handle, while a trailing hBuffer:table-handle keeps the
keyword type.

Parameters:
piWidgetId INTEGER
The Widget_ref node id the member is appended to
Top

INTEGER ConsumeNatural (integer)

Purpose: Creates a node for the current natural token (its own type and
text) as a child of a parent, and advances
Notes : Assumes the cursor is on a natural token.

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The new node id
Top

INTEGER CreateStructural (integer, integer)

Purpose: Creates a synthetic structural node (no source token) with empty
text as a child of a parent
Notes : Used for the Proparse structural nodes Field_ref / Widget_ref /
Array_subscript / Method_param_list / INPUT.

Parameters:
piParentId INTEGER
The parent node id
piNodeType INTEGER
The node type
Returns INTEGER
The new node id
Top

INTEGER CreateStructural (integer, integer, integer)

Purpose: Creates a synthetic structural node of a given node sub type
Notes : The sub type decides which INode implementation the node store
hands out, so a Field_ref has to be created as a FieldRefNode for
consumers to reach the IFieldRefNode members (SCL-5475). The
sub type-less overload leaves the node a plain JPNode.

Parameters:
piParentId INTEGER
The parent node id
piNodeType INTEGER
The node type
piSubType INTEGER
The node sub type (a NodeSubTypesEnum numeric value)
Returns INTEGER
The new node id
Top

CHARACTER CurrentText ()

Purpose: Returns the text of the current natural token
Notes : Assumes the cursor was positioned via CurrentType.

Returns CHARACTER
The token text
Top

INTEGER CurrentType ()

Purpose: Returns the type of the current natural token (skipping hidden)
Notes :

Returns INTEGER
The token type, or 0 at end of the stream
Top

LOGICAL IsFunctionName (character)

Purpose: Returns whether a name is a known user-defined function name
Notes : Case-insensitive lookup in the comma-delimited FunctionNames list.

Parameters:
pcName CHARACTER
The identifier text
Returns LOGICAL
Logical value
Top

LOGICAL IsHidden (integer)

Purpose: Returns whether a token type is hidden (whitespace / comment /
marker) and therefore skipped by the expression parser
Notes :

Parameters:
piType INTEGER
The token type
Returns LOGICAL
Logical value
Top

LOGICAL IsIdentifierType (integer)

Purpose: Returns whether a token type may serve as an identifier
Notes : An ID, or an unreserved keyword (the .NET Proparse grammar's
unreservedkeyword rule) - such a token is re-typed to ID at the
identifier position.

Parameters:
piType INTEGER
The token type
Returns LOGICAL
Logical value
Top

LOGICAL IsMethodName (character)

Purpose: Returns whether a name is a registered keyword-colliding method
name of the current unit
Notes : Case-insensitive lookup in the comma-delimited MethodNames list.

Parameters:
pcName CHARACTER
The identifier text
Returns LOGICAL
Logical value
Top

LOGICAL IsRecordFunctionType (integer)

Purpose: Returns whether a token type is a record function keyword
Notes : The reference grammar's recordfunc rule, without ERROR and NEW
(both also head non-record forms and need the schema to decide)

Parameters:
piType INTEGER
The token type
Returns LOGICAL
Logical value
Top

INTEGER NextNaturalType ()

Purpose: Returns the type of the natural token following the current one
without moving the cursor
Notes : One-token natural lookahead (function-call detection).

Returns INTEGER
The token type, or 0 when there is no such token
Top

INTEGER ParseAdditive (integer)

Purpose: Parses an additive expression (+ / -)
Notes :

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The expression subtree root id
Top

INTEGER ParseAnd (integer)

Purpose: Parses an AND expression
Notes :

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The expression subtree root id
Top

ParseArraySubscript (integer)

Purpose: Parses an array subscript ( [ expression ] ) under a parent
Notes : Structure: Array_subscript > { LEFTBRACE, <expression>, RIGHTBRACE }.

Parameters:
piParentId INTEGER
The parent node id (a Field_ref or Widget_ref)
Top

INTEGER ParseBuiltinFunction (integer)

Purpose: Parses a built-in function call keyword ( args ) under a parent
Notes : Structure: <FUNC> > { LEFTPAREN, <expr>, COMMA, <expr>, ...,
RIGHTPAREN }. Built-in function arguments are plain expressions,
NOT INPUT-wrapped (unlike method parameters).

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The function node id
Top

ParseCallArgument (integer)

Purpose: Parses one call argument with its parameter mode wrapper
Notes : An explicit INPUT / OUTPUT / INPUT-OUTPUT keyword is the
argument's wrapper node itself (a natural node carrying the
keyword text); without one a synthetic INPUT is created - the
reference never stacks a synthetic INPUT on top of an explicit
mode (SCL-5498).

Parameters:
piListId INTEGER
The parent node id (the call or parameter list node)
Top

INTEGER ParseCallWithInputArgs (integer, integer)

Purpose: Parses a user-defined function or local method call:
USER_FUNC | LOCAL_METHOD_REF > { LEFTPAREN, INPUT > <expr>,
COMMA, ..., RIGHTPAREN }
Notes : Verified against the .NET Proparse AST: each argument is wrapped
in a synthetic INPUT node; the commas are direct children of the
call node (there is no Method_param_list wrapper). The same
shape serves USER_FUNC (a registered function name) and
LOCAL_METHOD_REF (a method call in a class unit, SCL-5497).

Parameters:
piParentId INTEGER
The parent node id
piNodeType INTEGER
The call node type (USER_FUNC or LOCAL_METHOD_REF)
Returns INTEGER
The call node id
Top

INTEGER ParseCanFind (integer)

Purpose: Parses a CAN-FIND function with its embedded record phrase
Notes : Structure: CANFIND > { LEFTPAREN, [FIRST | LAST],
RECORD_NAME > { [WHERE > <expression>], <lock / wait options> },
RIGHTPAREN }, verified against the .NET AST (SCL-5482). Lock /
wait options (NO-LOCK, SHARE-LOCK, EXCLUSIVE-LOCK, NO-WAIT,
NO-PREFETCH) belong to the record phrase and nest under the
RECORD_NAME (SCL-5514); any other token before the closing
parenthesis is kept flat under the CANFIND node. The CANFIND
node carries the BlockNode subtype - CAN-FIND opens a scope in
the reference engine (canFindBegin in the Java TP01Support), so
the reference AST hands the node out as a BlockNode (SCL-5510).

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The CANFIND node id
Top

INTEGER ParseComparison (integer)

Purpose: Parses a comparison expression
Notes : Canonicalizes the symbolic comparison tokens to the Proparse
operator node types.

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The expression subtree root id
Top

INTEGER ParseDynamicFunction (integer)

Purpose: Parses a DYNAMIC-FUNCTION call: DYNAMICFUNCTION > { LEFTPAREN,
<name-expr>, COMMA, INPUT > <expr>, ..., RIGHTPAREN,
[NOERROR_KW] }
Notes : Verified against the .NET Proparse AST: the first argument (the
function name expression) is NOT INPUT-wrapped; the remaining
arguments are. An IN <handle> clause after the name expression is
consumed flat, so no token is lost. A trailing NO-ERROR belongs
to the call - the reference grammar's alternative ends in a
greedy (NOERROR_KW)?, which DYNAMIC-INVOKE and plain function
calls do not have (SCL-5531).

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The DYNAMICFUNCTION node id
Top

INTEGER ParseDynamicInvoke (integer)

Purpose: Parses a DYNAMIC-INVOKE call: DYNAMICINVOKE > { LEFTPAREN,
<target-expr>, COMMA, <name-expr>, COMMA, INPUT > <expr>, ...,
RIGHTPAREN }
Notes : The reference grammar's DYNAMICINVOKE alternative: the target
(an expression term or type name) and the method name
expression are NOT INPUT-wrapped - a name concatenation builds
a real expression tree - while the remaining arguments are
(SCL-5502).

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The DYNAMICINVOKE node id
Top

INTEGER ParseDynamicNewExpression (integer)

Purpose: Parses a DYNAMIC-NEW object expression
Notes : Shape: DYNAMICNEW > { <type expression>, Parameter_list >
{ LEFTPAREN, <arguments>, RIGHTPAREN } }, matching the reference
grammar's "dynamic_new : DYNAMICNEW^ expression parameterlist".
Unlike NEW, the type is an arbitrary character expression rather
than a type name, so it keeps its own node type (a QSTRING stays
a QSTRING, a variable becomes a Field_ref) instead of being
re-typed to TYPE_NAME. The lInDynamicNew flag is held over the
type expression only, so the argument list is not mistaken for a
method call's (SCL-5535).

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The DYNAMICNEW node id
Top

INTEGER ParseFieldReference (integer)

Purpose: Parses an identifier reference: Field_ref, growing into a
Widget_ref when an attribute / method chain (:) follows
Notes :

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The Field_ref or Widget_ref node id
Top

INTEGER ParseIfExpression (integer)

Purpose: Parses an IF expression: IF > { <condition>, THEN, <expr>,
[ ELSE, <expr> ] }
Notes : Verified against the .NET Proparse AST: THEN and ELSE are flat
children of the IF node; the branch expressions are their
following siblings.

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The IF node id
Top

INTEGER ParseInto (NodeStore, ListProToken, integer, integer)

Purpose: Parses one expression from a token stream into an existing store
Notes : The reusable entry point a statement parser calls at an
expression position. Parsing starts at piStartIndex; the
expression subtree is built as (the last) child of piParentId
(pass 0 to build the root as a store root node). NextIndex is
left at the first token the expression did not consume.

Parameters:
poStore Consultingwerk.Studio.ProparseApi.Implementation.ProparseAbl.Nodes.NodeStore
The node store to build into
poTokens Consultingwerk.Studio.ProparseApi.Implementation.ProparseAbl.ListProToken
The token stream
piStartIndex INTEGER
The 1-based token index to start at
piParentId INTEGER
The parent node id the expression is appended under (0 for a root)
Returns INTEGER
The expression root node id, or 0 when there is no expression
Top

ParseInUicTail (integer)

Purpose: Consumes the optional IN FRAME / MENU / BROWSE / SUB-MENU /
BUFFER tail of a widget attribute reference
Notes : The reference grammar's inuic clause roots IN_KW over the
object keyword and the widget name (re-typed to ID) and nests
inside the Widget_ref - widattr is the attribute chain
followed by (inuic)?, on either side of an assignment
(x:SENSITIVE SENSITIVE IN FRAME f = ..., y = x:SENSITIVE IN FRAME f)
(SCL-5533, SCL-5748). IN WINDOW is not an inuic form and is
left to the statement parser.

Parameters:
piWidgetId INTEGER
The Widget_ref node id
Top

ParseMethodParamList (integer)

Purpose: Parses a method parameter list ( ( arg, arg, ... ) ) under a parent
Notes : Structure: Method_param_list > { LEFTPAREN, INPUT > <expr>,
COMMA, INPUT > <expr>, ..., RIGHTPAREN }. Each argument is
wrapped in a synthetic INPUT node (the default parameter mode).

Parameters:
piParentId INTEGER
The parent node id (a Widget_ref)
Top

INTEGER ParseMultiplicative (integer)

Purpose: Parses a multiplicative expression (* / MODULO)
Notes : Canonicalizes STAR -> MULTIPLY and SLASH -> DIVIDE.

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The expression subtree root id
Top

INTEGER ParseNewExpression (integer)

Purpose: Parses a NEW expression: NEW > { TYPE_NAME, Parameter_list >
{ LEFTPAREN, INPUT > <expr>, COMMA, ..., RIGHTPAREN } }
Notes : The class name is re-typed to TYPE_NAME even when it collides
with a keyword, e.g. "new Dictionary ()" (SCL-5470). Without a
following LEFTPAREN the bare NEW node is returned unchanged.

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The NEW node id
Top

INTEGER ParseNot (integer)

Purpose: Parses a NOT expression (prefix, lower precedence than comparison)
Notes :

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The expression subtree root id
Top

INTEGER ParseOperandInto (NodeStore, ListProToken, integer, integer)

Purpose: Parses one AND-level operand from a token stream into an existing
store (an expression up to but not including a top-level OR)
Notes : Used at expression positions where a top-level OR is a separator
rather than a boolean operator - notably a CASE WHEN value list
(WHEN a OR WHEN b), where the driving parser groups the operands
under the OR / nested WHEN nodes itself. Otherwise identical to
ParseInto (starts one precedence level above OR).

Parameters:
poStore Consultingwerk.Studio.ProparseApi.Implementation.ProparseAbl.Nodes.NodeStore
The node store to build into
poTokens Consultingwerk.Studio.ProparseApi.Implementation.ProparseAbl.ListProToken
The token stream
piStartIndex INTEGER
The 1-based token index to start at
piParentId INTEGER
The parent node id the operand is appended under (0 for a root)
Returns INTEGER
The operand root node id, or 0 when there is no operand
Top

INTEGER ParseOr (integer)

Purpose: Parses an OR expression
Notes :

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The expression subtree root id
Top

ParseParameterDatasetOptions (integer)

Purpose: Consumes the optional APPEND / BY-VALUE / BY-REFERENCE / BIND
options of a TABLE / DATASET style call argument
Notes : The reference grammar's parameter_dataset_options rule -
"(APPEND)? (BYVALUE|BYREFERENCE|BIND)?" - the option keywords
sit flat inside the parameter's mode node (SCL-5553).

Parameters:
piModeId INTEGER
The parameter mode node id
Top

INTEGER ParsePrimary (integer)

Purpose: Parses a primary (atom) expression
Notes :

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The primary subtree root id, or 0 at end of the stream
Top

INTEGER ParseRecordFunction (integer)

Purpose: Parses a record function: <FUNC> > { [LEFTPAREN,] RECORD_NAME
[, RIGHTPAREN] }
Notes : The reference grammar's recordfunc rule - AVAILABLE / AMBIGUOUS /
LOCKED / RECID / ROWID / ... own a record reference, bare or
parenthesized, and the table name becomes a RECORD_NAME
(SCL-5486).

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The function node id
Top

INTEGER ParseReferenceInto (NodeStore, ListProToken, integer, integer)

Purpose: Parses one primary-level reference (Field_ref / Widget_ref chain
with array subscripts) from a token stream into an existing store
Notes : Used by a statement parser for an assignment left-hand side,
where a following "=" is the assignment operator and must NOT be
consumed as a comparison. Parses exactly one primary; NextIndex
is left at the first token the reference did not consume.

Parameters:
poStore Consultingwerk.Studio.ProparseApi.Implementation.ProparseAbl.Nodes.NodeStore
The node store to build into
poTokens Consultingwerk.Studio.ProparseApi.Implementation.ProparseAbl.ListProToken
The token stream
piStartIndex INTEGER
The 1-based token index to start at
piParentId INTEGER
The parent node id the reference is appended under (0 for a root)
Returns INTEGER
The reference root node id, or 0 when there is no reference
Top

INTEGER ParseSource (longchar, character)

Purpose: Lexes and parses a single in-memory expression into a record AST
Notes : Convenience entry point for testing an isolated expression. A
fresh NodeStore is created; the expression root is built directly
as a root node and returned via RootNodeId.

Parameters:
plcSource LONGCHAR
The expression source (without a terminating period)
pcFileName CHARACTER
The (nominal) file name for position reporting
Returns INTEGER
The expression root node id
Top

INTEGER ParseSuperCall (integer)

Purpose: Parses a SUPER call: SUPER > { Parameter_list > { LEFTPAREN,
INPUT > <expr>, COMMA, ..., RIGHTPAREN } }
Notes : The reference grammar's "SUPER^ parameterlist" builtin function
form (SCL-5503). The arguments are INPUT-wrapped inside the
synthetic Parameter_list, as in a NEW expression.

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The SUPER node id
Top

INTEGER ParseSystemHandleReference (integer)

Purpose: Parses a system handle member reference chain (THIS-OBJECT,
SUPER, SESSION, THIS-PROCEDURE, CURRENT-WINDOW, SELF, ...)
Notes : Structure: Widget_ref > { <system handle>, OBJCOLON | DOUBLECOLON,
<member>, ... }. The chain part is identical to the one an
identifier grows into, the difference being that the chain head
is not itself a Field_ref (SCL-5490).

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The Widget_ref node id
Top

INTEGER ParseTypeNameFunction (integer, logical)

Purpose: Parses a built-in function whose (last) argument is a type name:
<FUNC> > { LEFTPAREN, [<expression>, COMMA,] TYPE_NAME,
RIGHTPAREN }
Notes : GET-CLASS (T), CAST (expr, T) and TYPE-OF (expr, T) - the type
name is re-typed to TYPE_NAME as at the other type-name
positions (SCL-5487). Like the NEW class name it may be a token
that happens to be a keyword.

Parameters:
piParentId INTEGER
The parent node id
plLeadingExpression LOGICAL
Whether an expression and a comma precede the type name
Returns INTEGER
The function node id
Top

INTEGER ParseUnary (integer)

Purpose: Parses a unary +/- expression (prefix, higher than multiplicative)
Notes : A leading MINUS / PLUS becomes UNARY_MINUS / UNARY_PLUS.

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The expression subtree root id
Top

INTEGER ParseWidnameReference (integer)

Purpose: Parses a named widget reference headed by a widget-kind keyword
(BUFFER b:NAME, TEMP-TABLE tt:WRITE-XML (...), DATASET ds:...)
Notes : Structure: Widget_ref > { <widget-kind keyword>, ID,
OBJCOLON | DOUBLECOLON, <member>, ... } - the reference
grammar's widname rule (without its systemhandlename
alternative, which ParseSystemHandleReference covers). The
keyword keeps its type and the widget name is re-typed to ID;
neither is wrapped in a Field_ref (SCL-5500).

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The Widget_ref node id
Top

INTEGER ParseXor (integer)

Purpose: Parses an XOR expression (lowest precedence)
Notes : XOR binds looser than both OR and AND. Verified against the
reference engine (SCL-5472): "lA or lB xor lC" yields
XOR (OR (lA, lB), lC) and "lA xor lB and lC" yields
XOR (lA, AND (lB, lC)), so XOR sits above OR in the ladder.

Parameters:
piParentId INTEGER
The parent node id
Returns INTEGER
The expression subtree root id
Top

INTEGER PeekNaturalType (integer)

Purpose: Returns the type of the n-th natural token from the cursor
without moving it
Notes : PeekNaturalType (1) is the current natural token,
PeekNaturalType (2) the one NextNaturalType returns, and so on.

Parameters:
piAhead INTEGER
The 1-based natural token distance from the cursor
Returns INTEGER
The token type, or 0 when there is no such token
Top

SkipHidden ()

Purpose: Advances the cursor over any hidden tokens, queueing them in
the node store as pending leading hidden segments
Notes : The pending queue lives in the shared node store, so hidden
tokens survive the hand-over between the statement parser and
this expression parser (SCL-5479)

Top

Consultingwerk.Studio.ProparseApi.Implementation.ProparseAbl.ProToken TokenAt (integer)

Purpose: Returns the token at a 1-based index
Notes :

Parameters:
piIndex INTEGER
The 1-based token index
Returns Consultingwerk.Studio.ProparseApi.Implementation.ProparseAbl.ProToken
The ProToken
Top

INTEGER WrapAttributeChain (integer, integer)

Purpose: Wraps an expression term into a Widget_ref when an attribute /
method chain follows it
Notes : The reference grammar's exprt rule: exprt2 followed by
attr_colon becomes a Widget_ref - cast (x, T):Attribute chains
like any field reference (SCL-5499). Without a following chain
the term is returned unchanged.

Parameters:
piNodeId INTEGER
The expression term node id
piParentId INTEGER
The parent node id the Widget_ref is appended under
Returns INTEGER
The Widget_ref node id, or the unchanged term node id
Top

INTEGER WrapEnteredFunction (integer, integer)

Purpose: Wraps a field-reference operand in an Entered_func node when it
is followed by the ENTERED / NOT ENTERED postfix
Notes : The reference grammar's exprt2 field alternative ends with
"((NOT)? ENTERED)?" and wraps the whole thing:
{## = #([Entered_func], ##)} - so the postfix binds tighter
than any binary operator, and the tree is
Entered_func > { Field_ref, [NOT], ENTERED } (SCL-5538).

Parameters:
piParentId INTEGER
The parent node id
piRefId INTEGER
The already-parsed field-reference node id
Returns INTEGER
The Entered_func node id, or piRefId when no postfix follows


Constructor Detail
Top

ExpressionParser ()

Purpose: Constructor for the ExpressionParser class
Notes : Resolves the token / node type numbers once from the shared
ProparseKeywords table.



Property Detail
Top

CHARACTER FunctionNames


Returns CHARACTER
Top

LOGICAL InClassUnit


Returns LOGICAL
Top

CHARACTER MethodNames


Returns CHARACTER
Top

INTEGER NextIndex


Returns INTEGER
Top

INTEGER RootNodeId


Returns INTEGER
Top

Consultingwerk.Studio.ProparseApi.Implementation.ProparseAbl.Nodes.NodeStore Store


Returns Consultingwerk.Studio.ProparseApi.Implementation.ProparseAbl.Nodes.NodeStore


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