class Ens.Rule.Model.expression
extends %RegisteredObject, %XML.Adaptor, %JSON.Adaptor
model class for an expression
• property defaultValue
as %String(MAXLEN="");
• property errorOffset
as %String;
• property errorText
as %String;
• property operands
as list of Ens.Rule.Model.expression;
• property operator
as %String(MAXLEN="");
• property type
as %String(%JSONINCLUDE="NONE",MAXLEN="",XMLPROJECTION="NONE");
• property value
as %String(MAXLEN="");
• property warningText
as %String;
• classmethod IsInterpretationChanged(pExpression, pInterpretationOld, pInterpretationNew)
as %Boolean
This method returns 1 if the expression's intepretation is changed under the new operator precedence order
• classmethod addTokenList(tokenList, tokenString, tokenOffset)
• classmethod addTokenTree(tokenTree, tokenIndex, tokenString, tokenOffset, tokenType)
• classmethod canAppendToken(currentToken, newToken)
as %Boolean
• method constructAssign(pExpression, variables)
as %Status
variables(name) contains the list of declared variables
• method constructCOS(pExpression, variables)
as %Status
variables(name) contains the list of declared variables
• method constructExpression(pParentOperator="", pLogicalOnly=1)
as %String
• classmethod convertToCOS(pExpression, pExpressionCOS, variables, isAssignProp As %Boolean = 0)
as %Status
• classmethod dumpData(tokenData, description)
• classmethod getToken(tokenList, tokenCount, tokenString, tokenOffset)
as %Boolean
• classmethod isBinaryOperator(token)
as %Boolean
• classmethod isMultiaryOperator(token)
as %Boolean
• method isSimpleValue()
as %Boolean
• classmethod isUnaryOperator(token)
as %Boolean
• classmethod isValidCollectionsMethod(token)
as %Boolean
• classmethod isValidFunction(token)
as %Boolean
• method makeLogical()
as %Status
• classmethod operatorPrecedence(pOperator)
as %String
• classmethod operatorPrecedenceLegacy(pOperator)
as %String
• classmethod parse(pExpression As %String, pObject As Ens.Rule.Model.expression, pLogicalOnly As %Boolean)
as %Status
This method is called by the Portal to parse an expression string
When encountering syntax error, it returns an value object with errorText and errorOffset
• classmethod parseExpression(pExpression As %String, pObject As Ens.Rule.Model.expression, pAllowNullOperand=0, pUseLegacyOperatorPrecedence=0)
as %Status
This method parses an expressions string and outputs the model object by reference
It returns a error status code if there are syntax errors
If pAllowNullOperand is true, the expression will allow "()" as place holder for empty operands
If pUseLegacyOperatorPrecedence is true, the parser will use legacy operator precedence
• classmethod parseToken(tokenList, tokenCount, pObject, pTokenOffset, pAllowNullOperand, pUseLegacyOperatorPrecedence)
as %Status
parseToken accepts tokenList which is a linear list of all tokens
1) It first converts tokenList to tokenTree by resolving nested structures.
2) At each heiarchical level, tokenTree contains a flat structure of operands, binary operators, unary operators, functions and arguments
3) We resolve functions into on single model object
4) We resolve unary operators into model objects
5) At each binary operator precedence level, from high to low, we combining tokens into binary or multiary model objects
• classmethod test(pExpression, variables, pLogicalOnly=0, pAllowNullOperand=0, pUseLegacyOperatorPrecedence=0)
as %Status
• classmethod tokenize(pExpression, tokenList)
as %Status
• method typeGet()
as %String
This is a Get accessor method for the type property.
Copyright (c) 2025 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.