Skip to main content

%DeepSee.WorksheetEngine

Class %DeepSee.WorksheetEngine Extends %RegisteredObject [ Abstract, System = 4 ]

Server-side implementation and utilities for Worksheet formulae.

Parameters​

DOMAIN​

Parameter DOMAIN = "%DeepSee";

Methods​

%LoadDataSet​

ClassMethod %LoadDataSet(pWorksheetName As %String, pGrid As %ZEN.Component.dynaGrid, pDataSet As %ZEN.Auxiliary.dataSet, pComputed As %Boolean = 0) As %Status [ Internal ]

Given a worksheet name, open it and load the data needed to drive a dyna grid control. If pComputed is true return the computed values for each cell, otherwise return the original values, which could include formula.

TestTokens​

ClassMethod TestTokens(pExpr As %String) [ Internal ]

DIAGNOSTIC!!!

%Tokenize​

ClassMethod %Tokenize(expr As %String, ByRef pTokens As %String) As %String [ Internal ]

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. Note that idents are also returned as escaped: [a]

TestPrecedence​

ClassMethod TestPrecedence(op1 As %String, op2 As %String) As %Boolean [ Internal ]

Returns true if op1 has precedence over op2.

IsValidIdent​

ClassMethod IsValidIdent(token As %String) As %Boolean [ Internal ]

Test if token is a valid (unquoted) identifier.

IsUnaryOperator​

ClassMethod IsUnaryOperator(token As %String) As %Boolean [ CodeMode = expression, Internal ]

Test if token is a unary operator

IsBinaryOperator​

ClassMethod IsBinaryOperator(token As %String) As %Boolean [ CodeMode = expression, Internal ]

Test if token is a binary operator

IsUnaryOperatorChar​

ClassMethod IsUnaryOperatorChar(char As %String) As %Boolean [ CodeMode = expression, Internal ]

Test if char is a part of an unary operator name

IsOperatorChar​

ClassMethod IsOperatorChar(char As %String) As %Boolean [ CodeMode = expression, Internal ]

Test if char is a part of an operator name

IsSpecialChar​

ClassMethod IsSpecialChar(char As %String) As %Boolean [ CodeMode = expression, Internal ]

Test if char is a special character "(" ")" or ","

IsIdentChar​

ClassMethod IsIdentChar(char As %String) As %Boolean [ CodeMode = expression, Internal ]

Test if char can be part of an identifier

IsWhiteSpace​

ClassMethod IsWhiteSpace(char As %String) As %Boolean [ CodeMode = expression, Internal ]

Test if char is a whitespace character

%Evaluate​

ClassMethod %Evaluate(pExpr As %String, pContextObj As %RegisteredObject = "", Output pErrorMsg As %String, Output pSC As %Status) As %String [ Internal ]

Evaluate the given expression.

Test​

ClassMethod Test(expr As %String, ByRef tree) [ Internal ]

DIAGNOSTIC!!!

%PrintParseNode​

ClassMethod %PrintParseNode(ByRef tree, node As %Integer, level As %Integer = 0) [ Internal ]

%Parse​

ClassMethod %Parse(pExpr As %String, Output tree As %String, Output pPropList As %String, Output pFuncList As %String) As %String [ Internal ]

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.

%GenExpression​

ClassMethod %GenExpression(ByRef pErr As %String, pContext As %String, ByRef tree As %String, node As %String = "") As %String

Generate an executable COS 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) NOT USED

%EvalExpression​

ClassMethod %EvalExpression(ByRef pErr As %String, pContext As %String, ByRef tree As %String, node As %String = "") As %String

Evaluates part of the parse tree.
pContext is the object variable containing runtime context.
Returns "" for error (assumes that parse tree has already been checked)

%CreateTestWorksheet​

ClassMethod %CreateTestWorksheet(pName As %String, Output pWorksheet) As %Status [ Internal ]

Diagnostic method. Create a test worksheet and save it.

%LoadWorksheet​

ClassMethod %LoadWorksheet(pWorksheetName As %String, pComputed As %Boolean = 0, Output pObject As %DeepSee.UserLibrary.Worksheet) As %Status [ Internal ]

Given a worksheet name (with no extension), open it and load the data needed to drive a json provider. If pComputed is true return the computed values for each cell, otherwise return the original values, which could include formula.

%SaveWorksheet​

ClassMethod %SaveWorksheet(pWorksheetName As %String, pObject As %ZEN.proxyObject) As %Status [ Internal ]

Given a worksheet name and a proxy object, save it as a folder item.