1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef FORMULA_OPCODE_HXX 25 #define FORMULA_OPCODE_HXX 26 27 #include "formula/compiler.hrc" // OpCodes 28 #include <tools/solar.h> 29 30 enum OpCodeEnum 31 { 32 // Special commands 33 ocPush = SC_OPCODE_PUSH, 34 ocCall = SC_OPCODE_CALL, 35 ocStop = SC_OPCODE_STOP, 36 ocExternal = SC_OPCODE_EXTERNAL, 37 ocName = SC_OPCODE_NAME, 38 ocExternalRef = SC_OPCODE_EXTERNAL_REF, 39 // Jump commands 40 ocIf = SC_OPCODE_IF, 41 ocChose = SC_OPCODE_CHOSE, 42 // Parentheses and separators 43 ocOpen = SC_OPCODE_OPEN, 44 ocClose = SC_OPCODE_CLOSE, 45 ocSep = SC_OPCODE_SEP, 46 ocArrayOpen = SC_OPCODE_ARRAY_OPEN, 47 ocArrayClose = SC_OPCODE_ARRAY_CLOSE, 48 ocArrayRowSep = SC_OPCODE_ARRAY_ROW_SEP, 49 ocArrayColSep = SC_OPCODE_ARRAY_COL_SEP, 50 // Special OpCodes 51 ocMissing = SC_OPCODE_MISSING, 52 ocBad = SC_OPCODE_BAD, 53 ocSpaces = SC_OPCODE_SPACES, 54 ocMatRef = SC_OPCODE_MAT_REF, 55 // Access commands 56 ocDBArea = SC_OPCODE_DB_AREA, 57 ocMacro = SC_OPCODE_MACRO, 58 ocColRowName = SC_OPCODE_COL_ROW_NAME, 59 ocColRowNameAuto = SC_OPCODE_COL_ROW_NAME_AUTO, 60 // Percent operator _follows_ value 61 ocPercentSign = SC_OPCODE_PERCENT_SIGN, 62 // Error constants 63 ocErrNull = SC_OPCODE_ERROR_NULL, 64 ocErrDivZero = SC_OPCODE_ERROR_DIVZERO, 65 ocErrValue = SC_OPCODE_ERROR_VALUE, 66 ocErrRef = SC_OPCODE_ERROR_REF, 67 ocErrName = SC_OPCODE_ERROR_NAME, 68 ocErrNum = SC_OPCODE_ERROR_NUM, 69 ocErrNA = SC_OPCODE_ERROR_NA, 70 // Binary operators 71 ocAdd = SC_OPCODE_ADD, 72 ocSub = SC_OPCODE_SUB, 73 ocMul = SC_OPCODE_MUL, 74 ocDiv = SC_OPCODE_DIV, 75 ocAmpersand = SC_OPCODE_AMPERSAND, 76 ocPow = SC_OPCODE_POW, 77 ocEqual = SC_OPCODE_EQUAL, 78 ocNotEqual = SC_OPCODE_NOT_EQUAL, 79 ocLess = SC_OPCODE_LESS, 80 ocGreater = SC_OPCODE_GREATER, 81 ocLessEqual = SC_OPCODE_LESS_EQUAL, 82 ocGreaterEqual = SC_OPCODE_GREATER_EQUAL, 83 ocAnd = SC_OPCODE_AND, 84 ocOr = SC_OPCODE_OR, 85 ocIntersect = SC_OPCODE_INTERSECT, 86 ocUnion = SC_OPCODE_UNION, 87 ocRange = SC_OPCODE_RANGE, 88 // Unary operators 89 ocNot = SC_OPCODE_NOT, 90 ocNeg = SC_OPCODE_NEG, 91 ocNegSub = SC_OPCODE_NEG_SUB, 92 // Functions with no parameters 93 ocPi = SC_OPCODE_PI, 94 ocRandom = SC_OPCODE_RANDOM, 95 ocTrue = SC_OPCODE_TRUE, 96 ocFalse = SC_OPCODE_FALSE, 97 ocGetActDate = SC_OPCODE_GET_ACT_DATE, 98 ocGetActTime = SC_OPCODE_GET_ACT_TIME, 99 ocNotAvail = SC_OPCODE_NO_VALUE, 100 ocCurrent = SC_OPCODE_CURRENT, 101 // Functions with one parameter 102 ocDeg = SC_OPCODE_DEG, 103 ocRad = SC_OPCODE_RAD, 104 ocSin = SC_OPCODE_SIN, 105 ocCos = SC_OPCODE_COS, 106 ocTan = SC_OPCODE_TAN, 107 ocCot = SC_OPCODE_COT, 108 ocArcSin = SC_OPCODE_ARC_SIN, 109 ocArcCos = SC_OPCODE_ARC_COS, 110 ocArcTan = SC_OPCODE_ARC_TAN, 111 ocArcCot = SC_OPCODE_ARC_COT, 112 ocSinHyp = SC_OPCODE_SIN_HYP, 113 ocCosHyp = SC_OPCODE_COS_HYP, 114 ocTanHyp = SC_OPCODE_TAN_HYP, 115 ocCotHyp = SC_OPCODE_COT_HYP, 116 ocArcSinHyp = SC_OPCODE_ARC_SIN_HYP, 117 ocArcCosHyp = SC_OPCODE_ARC_COS_HYP, 118 ocArcTanHyp = SC_OPCODE_ARC_TAN_HYP, 119 ocArcCotHyp = SC_OPCODE_ARC_COT_HYP, 120 ocCosecant = SC_OPCODE_COSECANT, 121 ocSecant = SC_OPCODE_SECANT, 122 ocCosecantHyp = SC_OPCODE_COSECANT_HYP, 123 ocSecantHyp = SC_OPCODE_SECANT_HYP, 124 ocExp = SC_OPCODE_EXP, 125 ocLn = SC_OPCODE_LN, 126 ocSqrt = SC_OPCODE_SQRT, 127 ocFact = SC_OPCODE_FACT, 128 ocGetYear = SC_OPCODE_GET_YEAR, 129 ocGetMonth = SC_OPCODE_GET_MONTH, 130 ocGetDay = SC_OPCODE_GET_DAY, 131 ocGetHour = SC_OPCODE_GET_HOUR, 132 ocGetMin = SC_OPCODE_GET_MIN, 133 ocGetSec = SC_OPCODE_GET_SEC, 134 ocPlusMinus = SC_OPCODE_PLUS_MINUS, 135 ocAbs = SC_OPCODE_ABS, 136 ocInt = SC_OPCODE_INT, 137 ocPhi = SC_OPCODE_PHI, 138 ocGauss = SC_OPCODE_GAUSS, 139 ocIsEmpty = SC_OPCODE_IS_EMPTY, 140 ocIsString = SC_OPCODE_IS_STRING, 141 ocIsNonString = SC_OPCODE_IS_NON_STRING, 142 ocIsLogical = SC_OPCODE_IS_LOGICAL, 143 ocType = SC_OPCODE_TYPE, 144 ocCell = SC_OPCODE_CELL, 145 ocIsRef = SC_OPCODE_IS_REF, 146 ocIsValue = SC_OPCODE_IS_VALUE, 147 ocIsFormula = SC_OPCODE_IS_FORMULA, 148 ocIsNA = SC_OPCODE_IS_NV, 149 ocIsErr = SC_OPCODE_IS_ERR, 150 ocIsError = SC_OPCODE_IS_ERROR, 151 ocIsEven = SC_OPCODE_IS_EVEN, 152 ocIsOdd = SC_OPCODE_IS_ODD, 153 ocN = SC_OPCODE_N, 154 // String functions 155 ocGetDateValue = SC_OPCODE_GET_DATE_VALUE, 156 ocGetTimeValue = SC_OPCODE_GET_TIME_VALUE, 157 ocCode = SC_OPCODE_CODE, 158 ocTrim = SC_OPCODE_TRIM, 159 ocUpper = SC_OPCODE_UPPER, 160 ocPropper = SC_OPCODE_PROPPER, 161 ocLower = SC_OPCODE_LOWER, 162 ocLen = SC_OPCODE_LEN, 163 ocT = SC_OPCODE_T, 164 ocValue = SC_OPCODE_VALUE, 165 ocClean = SC_OPCODE_CLEAN, 166 ocChar = SC_OPCODE_CHAR, 167 ocLog10 = SC_OPCODE_LOG10, 168 ocEven = SC_OPCODE_EVEN, 169 ocOdd = SC_OPCODE_ODD, 170 ocStdNormDist = SC_OPCODE_STD_NORM_DIST, 171 ocFisher = SC_OPCODE_FISHER, 172 ocFisherInv = SC_OPCODE_FISHER_INV, 173 ocSNormInv = SC_OPCODE_S_NORM_INV, 174 ocGammaLn = SC_OPCODE_GAMMA_LN, 175 ocGamma = SC_OPCODE_GAMMA, 176 ocErrorType = SC_OPCODE_ERROR_TYPE, 177 ocErrCell = SC_OPCODE_ERR_CELL, 178 ocFormula = SC_OPCODE_FORMULA, 179 ocArabic = SC_OPCODE_ARABIC, 180 ocInfo = SC_OPCODE_INFO, 181 ocBahtText = SC_OPCODE_BAHTTEXT, 182 ocJis = SC_OPCODE_JIS, 183 ocAsc = SC_OPCODE_ASC, 184 ocUnicode = SC_OPCODE_UNICODE, 185 ocUnichar = SC_OPCODE_UNICHAR, 186 // Functions with more than one parameters 187 ocArcTan2 = SC_OPCODE_ARC_TAN_2, 188 ocCeil = SC_OPCODE_CEIL, 189 ocFloor = SC_OPCODE_FLOOR, 190 ocRound = SC_OPCODE_ROUND, 191 ocRoundUp = SC_OPCODE_ROUND_UP, 192 ocRoundDown = SC_OPCODE_ROUND_DOWN, 193 ocTrunc = SC_OPCODE_TRUNC, 194 ocLog = SC_OPCODE_LOG, 195 ocPower = SC_OPCODE_POWER, 196 ocGCD = SC_OPCODE_GGT, 197 ocLCM = SC_OPCODE_KGV, 198 ocMod = SC_OPCODE_MOD, 199 ocSumProduct = SC_OPCODE_SUM_PRODUCT, 200 ocSumSQ = SC_OPCODE_SUM_SQ, 201 ocSumX2MY2 = SC_OPCODE_SUM_X2MY2, 202 ocSumX2DY2 = SC_OPCODE_SUM_X2DY2, 203 ocSumXMY2 = SC_OPCODE_SUM_XMY2, 204 ocGetDate = SC_OPCODE_GET_DATE, 205 ocGetTime = SC_OPCODE_GET_TIME, 206 ocGetDiffDate = SC_OPCODE_GET_DIFF_DATE, 207 ocGetDiffDate360 = SC_OPCODE_GET_DIFF_DATE_360, 208 ocMin = SC_OPCODE_MIN, 209 ocMax = SC_OPCODE_MAX, 210 ocSum = SC_OPCODE_SUM, 211 ocProduct = SC_OPCODE_PRODUCT, 212 ocAverage = SC_OPCODE_AVERAGE, 213 ocCount = SC_OPCODE_COUNT, 214 ocCount2 = SC_OPCODE_COUNT_2, 215 ocNPV = SC_OPCODE_NBW, 216 ocIRR = SC_OPCODE_IKV, 217 ocMIRR = SC_OPCODE_MIRR, 218 ocISPMT = SC_OPCODE_ISPMT, 219 ocVar = SC_OPCODE_VAR, 220 ocVarP = SC_OPCODE_VAR_P, 221 ocStDev = SC_OPCODE_ST_DEV, 222 ocStDevP = SC_OPCODE_ST_DEV_P, 223 ocB = SC_OPCODE_B, 224 ocNormDist = SC_OPCODE_NORM_DIST, 225 ocExpDist = SC_OPCODE_EXP_DIST, 226 ocBinomDist = SC_OPCODE_BINOM_DIST, 227 ocPoissonDist = SC_OPCODE_POISSON_DIST, 228 ocKombin = SC_OPCODE_KOMBIN, 229 ocKombin2 = SC_OPCODE_KOMBIN_2, 230 ocVariationen = SC_OPCODE_VARIATIONEN, 231 ocVariationen2 = SC_OPCODE_VARIATIONEN_2, 232 ocBW = SC_OPCODE_BW, 233 ocDIA = SC_OPCODE_DIA, 234 ocGDA = SC_OPCODE_GDA, 235 ocGDA2 = SC_OPCODE_GDA_2, 236 ocVBD = SC_OPCODE_VBD, 237 ocLaufz = SC_OPCODE_LAUFZ, 238 ocLIA = SC_OPCODE_LIA, 239 ocRMZ = SC_OPCODE_RMZ, 240 ocColumns = SC_OPCODE_COLUMNS, 241 ocRows = SC_OPCODE_ROWS, 242 ocColumn = SC_OPCODE_COLUMN, 243 ocRow = SC_OPCODE_ROW, 244 ocZGZ = SC_OPCODE_ZGZ, 245 ocZW = SC_OPCODE_ZW, 246 ocZZR = SC_OPCODE_ZZR, 247 ocZins = SC_OPCODE_ZINS, 248 ocZinsZ = SC_OPCODE_ZINS_Z, 249 ocKapz = SC_OPCODE_KAPZ, 250 ocKumZinsZ = SC_OPCODE_KUM_ZINS_Z, 251 ocKumKapZ = SC_OPCODE_KUM_KAP_Z, 252 ocEffektiv = SC_OPCODE_EFFEKTIV, 253 ocNominal = SC_OPCODE_NOMINAL, 254 ocSubTotal = SC_OPCODE_SUB_TOTAL, 255 // Database functions 256 ocDBSum = SC_OPCODE_DB_SUM, 257 ocDBCount = SC_OPCODE_DB_COUNT, 258 ocDBCount2 = SC_OPCODE_DB_COUNT_2, 259 ocDBAverage = SC_OPCODE_DB_AVERAGE, 260 ocDBGet = SC_OPCODE_DB_GET, 261 ocDBMax = SC_OPCODE_DB_MAX, 262 ocDBMin = SC_OPCODE_DB_MIN, 263 ocDBProduct = SC_OPCODE_DB_PRODUCT, 264 ocDBStdDev = SC_OPCODE_DB_STD_DEV, 265 ocDBStdDevP = SC_OPCODE_DB_STD_DEV_P, 266 ocDBVar = SC_OPCODE_DB_VAR, 267 ocDBVarP = SC_OPCODE_DB_VAR_P, 268 // Management functions 269 ocIndirect = SC_OPCODE_INDIRECT, 270 ocIndirectXL = SC_OPCODE_INDIRECT_XL, 271 ocAddress = SC_OPCODE_ADDRESS, 272 ocAddressXL = SC_OPCODE_ADDRESS_XL, 273 ocMatch = SC_OPCODE_MATCH, 274 ocCountEmptyCells = SC_OPCODE_COUNT_EMPTY_CELLS, 275 ocCountIf = SC_OPCODE_COUNT_IF, 276 ocSumIf = SC_OPCODE_SUM_IF, 277 ocAverageIf = SC_OPCODE_AVERAGE_IF, 278 ocSumIfs = SC_OPCODE_SUM_IFS, 279 ocAverageIfs = SC_OPCODE_AVERAGE_IFS, 280 ocCountIfs = SC_OPCODE_COUNT_IFS, 281 ocLookup = SC_OPCODE_LOOKUP, 282 ocVLookup = SC_OPCODE_V_LOOKUP, 283 ocHLookup = SC_OPCODE_H_LOOKUP, 284 ocMultiArea = SC_OPCODE_MULTI_AREA, 285 ocOffset = SC_OPCODE_OFFSET, 286 ocIndex = SC_OPCODE_INDEX, 287 ocAreas = SC_OPCODE_AREAS, 288 // String functions 289 ocCurrency = SC_OPCODE_CURRENCY, 290 ocReplace = SC_OPCODE_REPLACE, 291 ocFixed = SC_OPCODE_FIXED, 292 ocFind = SC_OPCODE_FIND, 293 ocExact = SC_OPCODE_EXACT, 294 ocLeft = SC_OPCODE_LEFT, 295 ocRight = SC_OPCODE_RIGHT, 296 ocSearch = SC_OPCODE_SEARCH, 297 ocMid = SC_OPCODE_MID, 298 ocText = SC_OPCODE_TEXT, 299 ocSubstitute = SC_OPCODE_SUBSTITUTE, 300 ocRept = SC_OPCODE_REPT, 301 ocConcat = SC_OPCODE_CONCAT, 302 ocLenB = SC_OPCODE_LENB, 303 ocRightB = SC_OPCODE_RIGHTB, 304 ocLeftB = SC_OPCODE_LEFTB, 305 ocMidB = SC_OPCODE_MIDB, 306 // Matrix functions 307 ocMatValue = SC_OPCODE_MAT_VALUE, 308 ocMatDet = SC_OPCODE_MAT_DET, 309 ocMatInv = SC_OPCODE_MAT_INV, 310 ocMatMult = SC_OPCODE_MAT_MULT, 311 ocMatTrans = SC_OPCODE_MAT_TRANS, 312 ocMatrixUnit = SC_OPCODE_MATRIX_UNIT, 313 // BackSolver 314 ocBackSolver = SC_OPCODE_BACK_SOLVER, 315 // Statistical functions 316 ocHypGeomDist = SC_OPCODE_HYP_GEOM_DIST, 317 ocLogNormDist = SC_OPCODE_LOG_NORM_DIST, 318 ocTDist = SC_OPCODE_T_DIST, 319 ocFDist = SC_OPCODE_F_DIST, 320 ocChiDist = SC_OPCODE_CHI_DIST, 321 ocChiSqDist = SC_OPCODE_CHISQ_DIST, 322 ocChiSqInv = SC_OPCODE_CHISQ_INV, 323 ocWeibull = SC_OPCODE_WEIBULL, 324 ocNegBinomVert = SC_OPCODE_NEG_BINOM_VERT, 325 ocKritBinom = SC_OPCODE_KRIT_BINOM, 326 ocKurt = SC_OPCODE_KURT, 327 ocHarMean = SC_OPCODE_HAR_MEAN, 328 ocGeoMean = SC_OPCODE_GEO_MEAN, 329 ocStandard = SC_OPCODE_STANDARD, 330 ocAveDev = SC_OPCODE_AVE_DEV, 331 ocSchiefe = SC_OPCODE_SCHIEFE, 332 ocDevSq = SC_OPCODE_DEV_SQ, 333 ocMedian = SC_OPCODE_MEDIAN, 334 ocModalValue = SC_OPCODE_MODAL_VALUE, 335 ocZTest = SC_OPCODE_Z_TEST, 336 ocTTest = SC_OPCODE_T_TEST, 337 ocRank = SC_OPCODE_RANK, 338 ocPercentile = SC_OPCODE_PERCENTILE, 339 ocPercentrank = SC_OPCODE_PERCENT_RANK, 340 ocLarge = SC_OPCODE_LARGE, 341 ocSmall = SC_OPCODE_SMALL, 342 ocFrequency = SC_OPCODE_FREQUENCY, 343 ocQuartile = SC_OPCODE_QUARTILE, 344 ocNormInv = SC_OPCODE_NORM_INV, 345 ocConfidence = SC_OPCODE_CONFIDENCE, 346 ocFTest = SC_OPCODE_F_TEST, 347 ocTrimMean = SC_OPCODE_TRIM_MEAN, 348 ocProb = SC_OPCODE_PROB, 349 ocCorrel = SC_OPCODE_CORREL, 350 ocCovar = SC_OPCODE_COVAR, 351 ocPearson = SC_OPCODE_PEARSON, 352 ocRSQ = SC_OPCODE_RSQ, 353 ocSTEYX = SC_OPCODE_STEYX, 354 ocSlope = SC_OPCODE_SLOPE, 355 ocIntercept = SC_OPCODE_INTERCEPT, 356 ocTrend = SC_OPCODE_TREND, 357 ocGrowth = SC_OPCODE_GROWTH, 358 ocRGP = SC_OPCODE_RGP, 359 ocRKP = SC_OPCODE_RKP, 360 ocForecast = SC_OPCODE_FORECAST, 361 ocChiInv = SC_OPCODE_CHI_INV, 362 ocGammaDist = SC_OPCODE_GAMMA_DIST, 363 ocGammaInv = SC_OPCODE_GAMMA_INV, 364 ocTInv = SC_OPCODE_T_INV, 365 ocFInv = SC_OPCODE_F_INV, 366 ocChiTest = SC_OPCODE_CHI_TEST, 367 ocLogInv = SC_OPCODE_LOG_INV, 368 ocTableOp = SC_OPCODE_TABLE_OP, 369 ocBetaDist = SC_OPCODE_BETA_DIST, 370 ocBetaInv = SC_OPCODE_BETA_INV, 371 // miscellaneous 372 ocWeek = SC_OPCODE_WEEK, 373 ocGetDayOfWeek = SC_OPCODE_GET_DAY_OF_WEEK, 374 ocNoName = SC_OPCODE_NO_NAME, 375 ocStyle = SC_OPCODE_STYLE, 376 ocDde = SC_OPCODE_DDE, 377 ocBase = SC_OPCODE_BASE, 378 ocTable = SC_OPCODE_TABLE, 379 ocTables = SC_OPCODE_TABLES, 380 ocMinA = SC_OPCODE_MIN_A, 381 ocMaxA = SC_OPCODE_MAX_A, 382 ocAverageA = SC_OPCODE_AVERAGE_A, 383 ocStDevA = SC_OPCODE_ST_DEV_A, 384 ocStDevPA = SC_OPCODE_ST_DEV_P_A, 385 ocVarA = SC_OPCODE_VAR_A, 386 ocVarPA = SC_OPCODE_VAR_P_A, 387 ocEasterSunday = SC_OPCODE_EASTERSUNDAY, 388 ocDecimal = SC_OPCODE_DECIMAL, 389 ocConvert = SC_OPCODE_CONVERT, 390 ocRoman = SC_OPCODE_ROMAN, 391 ocHyperLink = SC_OPCODE_HYPERLINK, 392 ocGetPivotData = SC_OPCODE_GET_PIVOT_DATA, 393 ocEuroConvert = SC_OPCODE_EUROCONVERT, 394 ocNumberValue = SC_OPCODE_NUMBERVALUE, 395 ocXor = SC_OPCODE_XOR, 396 //bitwise functions 397 ocBitAnd = SC_OPCODE_BITAND, 398 ocBitOr = SC_OPCODE_BITOR, 399 ocBitXor = SC_OPCODE_BITXOR, 400 ocBitLShift = SC_OPCODE_BITLSHIFT, 401 ocBitRShift = SC_OPCODE_BITRSHIFT, 402 // internal stuff 403 ocInternalBegin = SC_OPCODE_INTERNAL_BEGIN, 404 ocTTT = SC_OPCODE_TTT, 405 ocInternalEnd = SC_OPCODE_INTERNAL_END, 406 // from here on ExtraData 407 ocDataToken1 = SC_OPCODE_DATA_TOKEN_1, 408 // no OpCode 409 ocNone = SC_OPCODE_NONE 410 }; 411 412 #ifndef DBG_UTIL 413 // save memory since compilers tend to int an enum 414 typedef sal_uInt16 OpCode; 415 #else 416 // have enum names in debugger 417 typedef OpCodeEnum OpCode; 418 #endif 419 420 #endif 421