Ens.Rule.ExpressionParser
abstract class Ens.Rule.ExpressionParser extends %Library.RegisteredObject
Expression Parser for RuleSets.Method Inventory
- Evaluate()
- GenExpression()
- GenSetCode()
- GenerateCode()
- GetArguments()
- GetListOfMethods()
- GetOpType()
- GetXPathValues()
- IsBinaryOperator()
- IsIdentChar()
- IsOperatorChar()
- IsSpecialChar()
- IsUnaryOperator()
- IsUnaryOperatorChar()
- IsWhiteSpace()
- Parse()
- PrintParseNode()
- Test()
- TestPrecedence()
- TestTokenize()
- Tokenize()
- Validate()
Parameters
parameter DOMAIN = Ensemble;
Use our own domain for localization
Methods
classmethod Evaluate(pExpr As %String, pContextObj As %RegisteredObject = "", Output pErrorMsg As %String) as %String
Evaluate the given expression using the given context object
classmethod GenExpression(ByRef pErr As %String, pContext As %String, ByRef tree As %String, node As %String = "") as %String
Generate an executable ObjectScript expression for part of the parse tree
context is the name of the object variable containing runtime context.
Returns "" for error (assumes that parse tree has already been checked)
context is the name of the object variable containing runtime context.
Returns "" for error (assumes that parse tree has already been checked)
Generate a statement that sets a given property to a given value
classmethod GenerateCode(pExpr As %String, Output pCode As %String, Output pErrorMsg As %String) as %Status
Returns executable code (a single expression) for the given expression.
Get a list of the arguments for element el in a parse tree
Generate list of functions used by the parse tree
Returns the type of an expression (used by the value editor).
classmethod GetXPathValues(pStream, pExpression, pValSepString As %String = "<>", Output pStatus As %Status) as %String
Test if token is a binary operator
Test if char can be part of an identifier
Test if char is a part of an operator name
Test if char is a special character "(" ")" or ","
Test if token is a unary operator
Test if char is a part of an unary operator name
Test if char is a whitespace character
classmethod Parse(expr As %String, Output tree As %String, Output pPropList As %String, Output pFuncList As %String) as %String
Parse the expr into a parse tree tree
Returns "" if ok or else an error message.
pPropList returns an array of properties referenced by the expression. pFuncList returns an array of functions referenced by the expression.
Returns "" if ok or else an error message.
pPropList returns an array of properties referenced by the expression. pFuncList returns an array of functions referenced by the expression.
classmethod Test(expr As %String, ByRef tree)
Returns true if op1 has precedence over op2.
classmethod Tokenize(expr As %String, ByRef tokens As %String, pQuotedIdent As %Boolean = 0) as %String
Split the formula expr into a token list:
tokens(n,"token") = token
tokens(n,"pos") = position in expr
tokens(n,"type") = string | number | ident | func |op |unary | ( | ) | , | end Returns "" if the formula is correct else an error message. If pQuotedIdent, then support {ident},[ident], as ident
tokens(n,"token") = token
tokens(n,"pos") = position in expr
tokens(n,"type") = string | number | ident | func |op |unary | ( | ) | , | end Returns "" if the formula is correct else an error message. If pQuotedIdent, then support {ident},[ident],
classmethod Validate(pExpr As %String, Output pMsg As %String, pContextClass As %String = "", pDocumentClass As %String = "") as %Boolean
Validate the given expression.
If pContextClass is provided, make sure properties exist in it.
Inherited Members
Inherited Methods
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %SerializeObject()
- %SetModified()
- %ValidateObject()