├── README.md ├── docs ├── busy.gif ├── diag.gif ├── erlang-server.md ├── function-info.gif ├── lisp-handler.md ├── lisp1.jpg ├── lisp2.jpg ├── lisp3.jpg ├── logo.gif ├── python-server.md ├── r-server.md └── ruby-server.md ├── org.boris.expr ├── .classpath ├── .gitignore ├── .project ├── META-INF │ └── MANIFEST.MF ├── README ├── build.properties ├── java │ ├── src │ │ └── org │ │ │ └── boris │ │ │ └── expr │ │ │ ├── AbstractBinaryOperator.java │ │ │ ├── AbstractComparisonOperator.java │ │ │ ├── AbstractMathematicalOperator.java │ │ │ ├── Expr.java │ │ │ ├── ExprAddition.java │ │ │ ├── ExprArray.java │ │ │ ├── ExprBoolean.java │ │ │ ├── ExprDivision.java │ │ │ ├── ExprDouble.java │ │ │ ├── ExprEqual.java │ │ │ ├── ExprError.java │ │ │ ├── ExprEvaluatable.java │ │ │ ├── ExprException.java │ │ │ ├── ExprExpression.java │ │ │ ├── ExprFunction.java │ │ │ ├── ExprGreaterThan.java │ │ │ ├── ExprGreaterThanOrEqualTo.java │ │ │ ├── ExprInteger.java │ │ │ ├── ExprLessThan.java │ │ │ ├── ExprLessThanOrEqualTo.java │ │ │ ├── ExprMap.java │ │ │ ├── ExprMissing.java │ │ │ ├── ExprMultiplication.java │ │ │ ├── ExprNotEqual.java │ │ │ ├── ExprNumber.java │ │ │ ├── ExprPower.java │ │ │ ├── ExprString.java │ │ │ ├── ExprStringConcat.java │ │ │ ├── ExprSubtraction.java │ │ │ ├── ExprType.java │ │ │ ├── ExprTypes.java │ │ │ ├── ExprVariable.java │ │ │ ├── IBinaryOperator.java │ │ │ ├── IEvaluationCallback.java │ │ │ ├── IExprFunction.java │ │ │ ├── engine │ │ │ ├── AbstractCalculationEngine.java │ │ │ ├── DependencyEngine.java │ │ │ ├── EngineProvider.java │ │ │ ├── GridMap.java │ │ │ ├── GridReference.java │ │ │ ├── IEngineListener.java │ │ │ ├── IterationEngine.java │ │ │ ├── ListenerEngine.java │ │ │ ├── MultiThreadedDependencyEngine.java │ │ │ ├── Range.java │ │ │ └── SimpleGraphEngine.java │ │ │ ├── function │ │ │ ├── AbstractDatabaseFunction.java │ │ │ ├── AbstractFunction.java │ │ │ ├── AbstractVarianceFunction.java │ │ │ ├── DoubleInOutFunction.java │ │ │ ├── DoubleInOutFunctionErr.java │ │ │ ├── ExcelFunctionProvider.java │ │ │ ├── ExprAlias.java │ │ │ ├── ForEachFunction.java │ │ │ ├── ForEachNumberAFunction.java │ │ │ ├── ForEachNumberFunction.java │ │ │ ├── FunctionManager.java │ │ │ ├── FunctionMap.java │ │ │ ├── IFunctionProvider.java │ │ │ ├── SimpleDatabaseFunction.java │ │ │ └── excel │ │ │ │ ├── ABS.java │ │ │ │ ├── ACOS.java │ │ │ │ ├── ACOSH.java │ │ │ │ ├── ADDRESS.java │ │ │ │ ├── AND.java │ │ │ │ ├── AREAS.java │ │ │ │ ├── ASIN.java │ │ │ │ ├── ASINH.java │ │ │ │ ├── ATAN.java │ │ │ │ ├── ATAN2.java │ │ │ │ ├── ATANH.java │ │ │ │ ├── AVEDEV.java │ │ │ │ ├── AVERAGE.java │ │ │ │ ├── AVERAGEA.java │ │ │ │ ├── BAHTTEXT.java │ │ │ │ ├── BETADIST.java │ │ │ │ ├── BETAINV.java │ │ │ │ ├── BINOMDIST.java │ │ │ │ ├── CEILING.java │ │ │ │ ├── CELL.java │ │ │ │ ├── CHAR.java │ │ │ │ ├── CHIDIST.java │ │ │ │ ├── CHIINV.java │ │ │ │ ├── CHITEST.java │ │ │ │ ├── CHOOSE.java │ │ │ │ ├── CLEAN.java │ │ │ │ ├── CODE.java │ │ │ │ ├── COLUMN.java │ │ │ │ ├── COLUMNS.java │ │ │ │ ├── COMBIN.java │ │ │ │ ├── CONCATENATE.java │ │ │ │ ├── CONFIDENCE.java │ │ │ │ ├── CORREL.java │ │ │ │ ├── COS.java │ │ │ │ ├── COSH.java │ │ │ │ ├── COUNT.java │ │ │ │ ├── COUNTA.java │ │ │ │ ├── COUNTBLANK.java │ │ │ │ ├── COUNTIF.java │ │ │ │ ├── COVAR.java │ │ │ │ ├── CRITBINOM.java │ │ │ │ ├── DATE.java │ │ │ │ ├── DATEVALUE.java │ │ │ │ ├── DAVERAGE.java │ │ │ │ ├── DAY.java │ │ │ │ ├── DAYS360.java │ │ │ │ ├── DB.java │ │ │ │ ├── DCOUNT.java │ │ │ │ ├── DCOUNTA.java │ │ │ │ ├── DDB.java │ │ │ │ ├── DEGREES.java │ │ │ │ ├── DEVSQ.java │ │ │ │ ├── DGET.java │ │ │ │ ├── DMAX.java │ │ │ │ ├── DMIN.java │ │ │ │ ├── DOLLAR.java │ │ │ │ ├── DPRODUCT.java │ │ │ │ ├── DSTDEV.java │ │ │ │ ├── DSTDEVP.java │ │ │ │ ├── DSUM.java │ │ │ │ ├── DVAR.java │ │ │ │ ├── DVARP.java │ │ │ │ ├── ERRORTYPE.java │ │ │ │ ├── EVEN.java │ │ │ │ ├── EXACT.java │ │ │ │ ├── EXP.java │ │ │ │ ├── EXPONDIST.java │ │ │ │ ├── FACT.java │ │ │ │ ├── FALSE.java │ │ │ │ ├── FDIST.java │ │ │ │ ├── FIND.java │ │ │ │ ├── FINV.java │ │ │ │ ├── FISHER.java │ │ │ │ ├── FISHERNV.java │ │ │ │ ├── FIXED.java │ │ │ │ ├── FLOOR.java │ │ │ │ ├── FORECAST.java │ │ │ │ ├── FREQUENCY.java │ │ │ │ ├── FTEST.java │ │ │ │ ├── FV.java │ │ │ │ ├── GAMMADIST.java │ │ │ │ ├── GAMMAINV.java │ │ │ │ ├── GAMMALN.java │ │ │ │ ├── GEOMEAN.java │ │ │ │ ├── GETPIVOTDATA.java │ │ │ │ ├── GROWTH.java │ │ │ │ ├── HARMEAN.java │ │ │ │ ├── HLOOKUP.java │ │ │ │ ├── HOUR.java │ │ │ │ ├── HYPERLINK.java │ │ │ │ ├── HYPGEOMDIST.java │ │ │ │ ├── IF.java │ │ │ │ ├── INDEX.java │ │ │ │ ├── INDIRECT.java │ │ │ │ ├── INFO.java │ │ │ │ ├── INT.java │ │ │ │ ├── INTERCEPT.java │ │ │ │ ├── IPMT.java │ │ │ │ ├── IRR.java │ │ │ │ ├── ISBLANK.java │ │ │ │ ├── ISERR.java │ │ │ │ ├── ISLOGICAL.java │ │ │ │ ├── ISNA.java │ │ │ │ ├── ISNONTEXT.java │ │ │ │ ├── ISNUMBER.java │ │ │ │ ├── ISPMT.java │ │ │ │ ├── ISREF.java │ │ │ │ ├── ISTEXT.java │ │ │ │ ├── KURT.java │ │ │ │ ├── LARGE.java │ │ │ │ ├── LEFT.java │ │ │ │ ├── LEN.java │ │ │ │ ├── LINEST.java │ │ │ │ ├── LN.java │ │ │ │ ├── LOG.java │ │ │ │ ├── LOG10.java │ │ │ │ ├── LOGEST.java │ │ │ │ ├── LOGINV.java │ │ │ │ ├── LOGNORMDIST.java │ │ │ │ ├── LOOKUP.java │ │ │ │ ├── LOWER.java │ │ │ │ ├── MATCH.java │ │ │ │ ├── MAX.java │ │ │ │ ├── MAXA.java │ │ │ │ ├── MDETERM.java │ │ │ │ ├── MEDIAN.java │ │ │ │ ├── MID.java │ │ │ │ ├── MIN.java │ │ │ │ ├── MINA.java │ │ │ │ ├── MINUTE.java │ │ │ │ ├── MINVERSE.java │ │ │ │ ├── MIRR.java │ │ │ │ ├── MMULT.java │ │ │ │ ├── MOD.java │ │ │ │ ├── MODE.java │ │ │ │ ├── MONTH.java │ │ │ │ ├── N.java │ │ │ │ ├── NA.java │ │ │ │ ├── NEGBINOMDIST.java │ │ │ │ ├── NORMDIST.java │ │ │ │ ├── NORMINV.java │ │ │ │ ├── NORMSDIST.java │ │ │ │ ├── NORMSINV.java │ │ │ │ ├── NOT.java │ │ │ │ ├── NOW.java │ │ │ │ ├── NPER.java │ │ │ │ ├── NPV.java │ │ │ │ ├── ODD.java │ │ │ │ ├── OFFSET.java │ │ │ │ ├── OR.java │ │ │ │ ├── PEARSON.java │ │ │ │ ├── PERCENTILE.java │ │ │ │ ├── PERCENTRANK.java │ │ │ │ ├── PERMUT.java │ │ │ │ ├── PI.java │ │ │ │ ├── PMT.java │ │ │ │ ├── POISSON.java │ │ │ │ ├── POWER.java │ │ │ │ ├── PPMT.java │ │ │ │ ├── PROB.java │ │ │ │ ├── PRODUCT.java │ │ │ │ ├── PROPER.java │ │ │ │ ├── PV.java │ │ │ │ ├── QUARTILE.java │ │ │ │ ├── RADIANS.java │ │ │ │ ├── RAND.java │ │ │ │ ├── RANK.java │ │ │ │ ├── RATE.java │ │ │ │ ├── REPLACE.java │ │ │ │ ├── REPT.java │ │ │ │ ├── RIGHT.java │ │ │ │ ├── ROMAN.java │ │ │ │ ├── ROUND.java │ │ │ │ ├── ROUNDDOWN.java │ │ │ │ ├── ROUNDUP.java │ │ │ │ ├── ROW.java │ │ │ │ ├── ROWS.java │ │ │ │ ├── RSQ.java │ │ │ │ ├── RTD.java │ │ │ │ ├── SEARCH.java │ │ │ │ ├── SECOND.java │ │ │ │ ├── SIGN.java │ │ │ │ ├── SIN.java │ │ │ │ ├── SINH.java │ │ │ │ ├── SKEW.java │ │ │ │ ├── SLN.java │ │ │ │ ├── SLOPE.java │ │ │ │ ├── SMALL.java │ │ │ │ ├── SQRT.java │ │ │ │ ├── STANDARDIZE.java │ │ │ │ ├── STDEV.java │ │ │ │ ├── STDEVA.java │ │ │ │ ├── STDEVP.java │ │ │ │ ├── STDEVPA.java │ │ │ │ ├── STEYX.java │ │ │ │ ├── SUBSTITUTE.java │ │ │ │ ├── SUBTOTAL.java │ │ │ │ ├── SUM.java │ │ │ │ ├── SUMIF.java │ │ │ │ ├── SUMPRODUCT.java │ │ │ │ ├── SUMSQ.java │ │ │ │ ├── SUMX2MY2.java │ │ │ │ ├── SUMX2PY2.java │ │ │ │ ├── SUMXMY2.java │ │ │ │ ├── SYD.java │ │ │ │ ├── T.java │ │ │ │ ├── TAN.java │ │ │ │ ├── TANH.java │ │ │ │ ├── TDIST.java │ │ │ │ ├── TEXT.java │ │ │ │ ├── TIME.java │ │ │ │ ├── TIMEVALUE.java │ │ │ │ ├── TINV.java │ │ │ │ ├── TODAY.java │ │ │ │ ├── TRANSPOSE.java │ │ │ │ ├── TREND.java │ │ │ │ ├── TRIM.java │ │ │ │ ├── TRIMMEAN.java │ │ │ │ ├── TRUE.java │ │ │ │ ├── TRUNC.java │ │ │ │ ├── TTEST.java │ │ │ │ ├── TYPE.java │ │ │ │ ├── UPPER.java │ │ │ │ ├── VALUE.java │ │ │ │ ├── VAR.java │ │ │ │ ├── VARA.java │ │ │ │ ├── VARP.java │ │ │ │ ├── VARPA.java │ │ │ │ ├── VDB.java │ │ │ │ ├── VLOOKUP.java │ │ │ │ ├── WEEKDAY.java │ │ │ │ ├── WEIBULL.java │ │ │ │ ├── YEAR.java │ │ │ │ ├── ZTEST.java │ │ │ │ └── flist.txt │ │ │ ├── graph │ │ │ ├── Edge.java │ │ │ ├── Graph.java │ │ │ ├── GraphCycleException.java │ │ │ └── GraphTraversalListener.java │ │ │ ├── parser │ │ │ ├── ExprLexer.java │ │ │ ├── ExprParser.java │ │ │ ├── ExprToken.java │ │ │ ├── ExprTokenType.java │ │ │ ├── IParserVisitor.java │ │ │ └── TokenReader.java │ │ │ └── util │ │ │ ├── CSV.java │ │ │ ├── Condition.java │ │ │ ├── Counter.java │ │ │ ├── Criteria.java │ │ │ ├── Database.java │ │ │ ├── ExcelDate.java │ │ │ ├── ExprArrayBuilder.java │ │ │ ├── Exprs.java │ │ │ ├── Financials.java │ │ │ ├── IO.java │ │ │ ├── LongMap.java │ │ │ ├── Maths.java │ │ │ ├── Reflect.java │ │ │ ├── Statistics.java │ │ │ ├── ValueFormatter.java │ │ │ └── ValueParser.java │ └── test │ │ └── org │ │ └── boris │ │ └── expr │ │ ├── AllTests.java │ │ ├── BasicEngineProvider.java │ │ ├── BasicEvaluationCallback.java │ │ ├── DebugEngineListener.java │ │ ├── DependencyEngineTest.java │ │ ├── ExcelCompatTest.java │ │ ├── ExcelDatabaseFunctionsTest.java │ │ ├── ExcelDateAndTimeFunctionsTest.java │ │ ├── ExcelDateTest.java │ │ ├── ExcelFinancialFunctionsTest.java │ │ ├── ExcelInformationFunctionsTest.java │ │ ├── ExcelLogicalFunctionsTest.java │ │ ├── ExcelLookupAndReferenceFunctionsTest.java │ │ ├── ExcelMathAndTrigFunctionsTest.java │ │ ├── ExcelStatisticalFunctionsTest.java │ │ ├── ExcelTextFunctionsTest.java │ │ ├── ExprFunctionTest.java │ │ ├── ExprTest.java │ │ ├── FunctionTestRange.java │ │ ├── GraphTest.java │ │ ├── GridReferenceTest.java │ │ ├── IterationEngineTest.java │ │ ├── LexerTest.java │ │ ├── ListenerEngineTest.java │ │ ├── OptimizeTest.java │ │ ├── ParserTest.java │ │ ├── RangeTest.java │ │ ├── SimpleGraphEngineTest.java │ │ ├── TH.java │ │ ├── TestGen.java │ │ ├── ValueParserTest.java │ │ ├── countif1.txt │ │ ├── date_test_data.txt │ │ ├── db1-c.txt │ │ ├── db1-d.txt │ │ ├── db1.txt │ │ ├── index1.txt │ │ └── lookup1.txt └── site │ ├── favicon.ico │ ├── index.html │ ├── logo.gif │ └── style.css ├── org.boris.jxll ├── .classpath ├── .gitignore ├── .project ├── .settings │ └── org.eclipse.jdt.core.prefs ├── META-INF │ └── MANIFEST.MF ├── README ├── build.properties ├── build.xml ├── cpl-v10.html ├── java │ ├── src │ │ └── org │ │ │ └── boris │ │ │ └── jxll │ │ │ ├── Addin.java │ │ │ ├── ArgType.java │ │ │ ├── FunctionInformation.java │ │ │ ├── FunctionSpec.java │ │ │ ├── IXLLHost.java │ │ │ ├── JNI.java │ │ │ ├── JXLL.java │ │ │ ├── XLCommandNumber.java │ │ │ ├── XLErrType.java │ │ │ ├── XLFunctionNumber.java │ │ │ ├── XLLException.java │ │ │ ├── XLOper.java │ │ │ ├── XLOperHolder.java │ │ │ ├── XLOperType.java │ │ │ ├── XLRef.java │ │ │ ├── XLReturnType.java │ │ │ └── util │ │ │ ├── JXLLExample.java │ │ │ ├── JXLLTestCase.java │ │ │ ├── LibraryLoader.java │ │ │ ├── ManualExample.java │ │ │ └── Reflection.java │ └── test │ │ └── org │ │ └── boris │ │ └── jxll │ │ ├── XLLTester.java │ │ └── XLLoopStressTester.java ├── jni │ ├── .cvsignore │ ├── .gitignore │ ├── build │ │ ├── .cvsignore │ │ ├── JXLL.vcproj │ │ ├── TestXLL.vcproj │ │ └── XLLstub.vcproj │ ├── jxll.sln │ ├── lib │ │ └── xlcall32.lib │ └── src │ │ ├── JXLL.cpp │ │ ├── JXLL.def │ │ ├── JXLL.h │ │ ├── TestXLL.cpp │ │ ├── TestXLL.def │ │ ├── TestXLL.h │ │ ├── XLLstub.cpp │ │ ├── XLLstub.def │ │ └── xlcall.h ├── site │ ├── favicon.ico │ ├── index.html │ ├── logo.gif │ ├── others │ │ ├── expr4j.gif │ │ ├── jvst.gif │ │ ├── jxll.gif │ │ ├── variantcodec.gif │ │ ├── winrun4j.gif │ │ └── xlloop.gif │ └── style.css └── todo.txt ├── org.boris.xlloop ├── .classpath ├── .gitignore ├── .project ├── .pydevproject ├── .settings │ └── org.eclipse.jdt.core.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── build.xml ├── cpl-v10.html ├── java │ ├── src │ │ └── org │ │ │ └── boris │ │ │ └── xlloop │ │ │ ├── FunctionMap.java │ │ │ ├── FunctionServer.java │ │ │ ├── IBuiltinFunctions.java │ │ │ ├── IFunction.java │ │ │ ├── IFunctionContext.java │ │ │ ├── IFunctionHandler.java │ │ │ ├── IFunctionServerListener.java │ │ │ ├── IRequestProtocol.java │ │ │ ├── RequestException.java │ │ │ ├── RequestExecutor.java │ │ │ ├── codec │ │ │ ├── BinaryCodec.java │ │ │ └── BinaryRequestProtocol.java │ │ │ ├── command │ │ │ └── CommandResult.java │ │ │ ├── handler │ │ │ ├── AddinFunctionHandler.java │ │ │ ├── CompositeFunctionHandler.java │ │ │ ├── DebugFunctionHandler.java │ │ │ ├── FunctionInformation.java │ │ │ ├── FunctionInformationHandler.java │ │ │ ├── FunctionProvider.java │ │ │ └── InitializeHandler.java │ │ │ ├── http │ │ │ ├── FunctionExecutor.java │ │ │ ├── FunctionRequest.java │ │ │ ├── FunctionService.java │ │ │ ├── FunctionServlet.java │ │ │ └── JSONCodec.java │ │ │ ├── menu │ │ │ ├── IMenuProvider.java │ │ │ ├── Menu.java │ │ │ ├── MenuCodec.java │ │ │ ├── MenuHandler.java │ │ │ ├── MenuItem.java │ │ │ └── SubMenu.java │ │ │ ├── reflect │ │ │ ├── AnnotationHelper.java │ │ │ ├── DelegateFunction.java │ │ │ ├── DelegateFunctionHandler.java │ │ │ ├── InstanceMethod.java │ │ │ ├── OverloadedMethod.java │ │ │ ├── ParameterNameExtractor.java │ │ │ ├── Reflect.java │ │ │ ├── ReflectFunctionHandler.java │ │ │ └── XLFunction.java │ │ │ ├── script │ │ │ ├── BSFScript.java │ │ │ ├── JavaScriptFactory.java │ │ │ ├── LispFunctionHandler.java │ │ │ ├── ScriptFactory.java │ │ │ └── ScriptRepository.java │ │ │ ├── util │ │ │ ├── CSV.java │ │ │ ├── CSVFunctionInformationReader.java │ │ │ ├── CircularIterator.java │ │ │ ├── CompTest1.java │ │ │ ├── CompositeFunctionServer.java │ │ │ ├── Day.java │ │ │ ├── ExcelDate.java │ │ │ ├── FileSystemWatcher.java │ │ │ ├── FunctionHandlerServer.java │ │ │ ├── IO.java │ │ │ ├── Maths.java │ │ │ ├── ObjectRegistry.java │ │ │ ├── ServerExample.java │ │ │ ├── XLLServer.java │ │ │ ├── XLList.java │ │ │ ├── XLMap.java │ │ │ ├── XLSparseArray.java │ │ │ ├── XLoperCache.java │ │ │ ├── XLoperObjectConverter.java │ │ │ └── math.csv │ │ │ └── xloper │ │ │ ├── XLArray.java │ │ │ ├── XLBool.java │ │ │ ├── XLError.java │ │ │ ├── XLInt.java │ │ │ ├── XLMissing.java │ │ │ ├── XLNil.java │ │ │ ├── XLNum.java │ │ │ ├── XLSRef.java │ │ │ ├── XLString.java │ │ │ └── XLoper.java │ └── test │ │ └── org │ │ └── boris │ │ └── xlloop │ │ ├── AnnotationsTest.java │ │ ├── BasicTest.java │ │ ├── BinaryCodecTest.java │ │ ├── CSVFITester.java │ │ ├── Client1.java │ │ ├── ClientServerTester.java │ │ ├── CompTest1.java │ │ ├── EchoHandler.java │ │ ├── ExecuteHandler.java │ │ ├── FileSystemWatcherTest.java │ │ ├── Finance1.java │ │ ├── FunctionInformationTest.java │ │ ├── GenDef.java │ │ ├── LispTest1.java │ │ ├── MakeList.java │ │ ├── MarshallTest.java │ │ ├── ParameterNameExtractorTest.java │ │ ├── ReflectFunctionHandlerTest.java │ │ ├── Reflection.java │ │ ├── ScriptRepTest1.java │ │ ├── ScriptTest1.java │ │ ├── ServerTest1.java │ │ ├── Test.java │ │ ├── TestMenu.java │ │ ├── TestMultipleServers.java │ │ ├── Threads.java │ │ ├── XLLServerTest.java │ │ ├── function_info1.csv │ │ └── http │ │ ├── ClientTest1.java │ │ ├── HttpServerTest1.java │ │ ├── ServletContainer.java │ │ ├── ServletHandler.java │ │ ├── ServletRequest.java │ │ ├── ServletResponse.java │ │ └── ServletTest1.java ├── lib │ ├── bsf-src.zip │ ├── bsf.jar │ ├── commons-logging-1.1.1.jar │ ├── jatha-2.8-src.jar │ ├── jatha-2.8.jar │ ├── js-src.zip │ ├── js.jar │ ├── json-src.jar │ ├── json.jar │ ├── rupy-0.3.3-src.zip │ ├── rupy-0.3.3.jar │ └── servlet-api-2.5.jar ├── servers │ ├── bsf │ │ ├── linint.js │ │ ├── linint.vc │ │ ├── mult.js │ │ ├── mult.vc │ │ ├── sum-list.lisp │ │ ├── sum.js │ │ └── sum.vc │ ├── c++ │ │ ├── XLLServer.exe │ │ ├── XLLServer.ini │ │ └── jxll-0.0.2.jar │ ├── csharp │ │ ├── BinaryCodec.cs │ │ ├── FunctionServer.cs │ │ ├── ReflectFunctionHandler.cs │ │ ├── ServerExample.cs │ │ └── XLLoop.cs │ ├── erlang │ │ ├── .cvsignore │ │ ├── erlang.txt │ │ ├── server_example.erl │ │ ├── variant_codec.erl │ │ ├── xlloop_server.erl │ │ └── xloper_codec.erl │ ├── java │ │ ├── ServerExample.exe │ │ └── ServerExample.ini │ ├── lua │ │ ├── .gitignore │ │ ├── binarycodec.lua │ │ ├── client_example.lua │ │ ├── server_example.lua │ │ └── xlloop.lua │ ├── php │ │ ├── TestServer.php │ │ └── XLLoop.php │ ├── python │ │ ├── .cvsignore │ │ ├── reflect-example.py │ │ ├── server-example.py │ │ └── xlloop.py │ ├── r │ │ ├── r.bat │ │ └── xlloop.R │ └── ruby │ │ ├── reflect-server.rb │ │ ├── server-example.rb │ │ └── xlloop.rb ├── site │ ├── busy.gif │ ├── diag.gif │ ├── erlangserver.html │ ├── favicon.ico │ ├── functioninfo.gif │ ├── index.html │ ├── lisp1.jpg │ ├── lisp2.jpg │ ├── lisp3.jpg │ ├── lisphandler.html │ ├── logo.gif │ ├── oldchangehistory.html │ ├── others │ │ ├── expr4j.gif │ │ ├── jvst.gif │ │ ├── jxll.gif │ │ ├── variantcodec.gif │ │ ├── winrun4j.gif │ │ └── xlloop.gif │ ├── pythonserver.html │ ├── relnotes.txt │ ├── rserver.html │ ├── rubyserver.html │ ├── style.css │ └── tcpstream.html ├── test │ ├── embed-ini.cmd │ ├── embed.ini │ └── make-release-xll.cmd └── todo.txt ├── xlloop-addin ├── .cvsignore ├── .gitignore ├── .project ├── XLLoop.sln ├── build │ ├── .cvsignore │ ├── .gitignore │ └── XLLoop.vcproj ├── cpl-v10.html ├── epl-v10.html ├── lib │ ├── BufferOverflowU.lib │ ├── msvcrt.lib │ ├── xlcall32.lib │ └── yajl.lib ├── resources │ ├── spinner1.gif │ ├── spinner10.gif │ ├── spinner11.gif │ ├── spinner12.gif │ ├── spinner2.gif │ ├── spinner3.gif │ ├── spinner4.gif │ ├── spinner5.gif │ ├── spinner6.gif │ ├── spinner7.gif │ ├── spinner8.gif │ └── spinner9.gif ├── src │ ├── XLLoop.cpp │ ├── XLLoop.def │ ├── XLLoop.rc │ ├── common │ │ ├── Dictionary.cpp │ │ ├── Dictionary.h │ │ ├── INI.cpp │ │ ├── INI.h │ │ ├── Log.cpp │ │ ├── Log.h │ │ ├── Runtime.cpp │ │ └── Runtime.h │ ├── xll │ │ ├── BinaryProtocol.cpp │ │ ├── BinaryProtocol.h │ │ ├── HttpProtocol.cpp │ │ ├── HttpProtocol.h │ │ ├── JSONCodec.cpp │ │ ├── JSONCodec.h │ │ ├── SheetGenerator.cpp │ │ ├── SheetGenerator.h │ │ ├── Timeout.cpp │ │ ├── Timeout.h │ │ ├── XLCodec.cpp │ │ ├── XLCodec.h │ │ ├── XLUtil.cpp │ │ ├── XLUtil.h │ │ └── xlcall.h │ └── yajl │ │ ├── yajl_common.h │ │ ├── yajl_gen.h │ │ └── yajl_parse.h └── test │ ├── FSTest.xls │ ├── XLLoop-Error.ico │ ├── XLLoop-Warning.ico │ └── XLLoop.ico └── xllua ├── .gitignore ├── .project ├── README.md ├── TODO ├── XLLua.sln ├── build ├── .gitignore ├── XLLua-Debug │ ├── .gitignore │ └── XLLua-Debug.lua └── XLLua.vcproj ├── examples ├── README.md ├── addins.lua ├── basic.lua ├── csv.lua └── redis_client.lua ├── lib ├── BufferOverflowU.lib ├── lua51.lib ├── msvcrt.lib └── xlcall32.lib ├── src ├── .gitignore ├── XLLua.c ├── XLLua.def ├── XLLua.lua ├── XLLua.rc └── xlcall.h └── test ├── test1.xls └── unittest.lua /docs/busy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/docs/busy.gif -------------------------------------------------------------------------------- /docs/diag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/docs/diag.gif -------------------------------------------------------------------------------- /docs/function-info.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/docs/function-info.gif -------------------------------------------------------------------------------- /docs/lisp1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/docs/lisp1.jpg -------------------------------------------------------------------------------- /docs/lisp2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/docs/lisp2.jpg -------------------------------------------------------------------------------- /docs/lisp3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/docs/lisp3.jpg -------------------------------------------------------------------------------- /docs/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/docs/logo.gif -------------------------------------------------------------------------------- /docs/r-server.md: -------------------------------------------------------------------------------- 1 | # ![XLLoop](./logo.gif) XLLoop 2 | An R Function Server 3 | 4 | ## About 5 | 6 | Included in the download is an R implementation of the XLLoop server process. For more information on R try www.r-project.org. 7 | 8 | ## Usage 9 | 10 | The R server implementation consists of a single file: xlloop.R. The code listing for an example server is as follows: 11 | 12 | ```r 13 | > ProductTest <- function(x, y) x*y 14 | > 15 | > source("xlloop.R") 16 | > 17 | > XLLoopServer() 18 | ``` 19 | 20 | This creates a new server (a socket listening on port 5454) and will provide the function ProductTest, which can be invoked as: 21 | 22 | ``` 23 | =FS("ProductTest", 32, 1886.5) 24 | ``` -------------------------------------------------------------------------------- /docs/ruby-server.md: -------------------------------------------------------------------------------- 1 | # ![XLLoop](./logo.gif) XLLoop 2 | A Ruby Function Server 3 | 4 | ## About 5 | 6 | Included in the download is a Ruby implementation of the XLLoop server process. For more information on Ruby try www.ruby-lang.org. 7 | 8 | ## Usage 9 | 10 | The Ruby server implementation consists of a single file: xlloop.rb. The code listing for a reflection-based example server is as follows: 11 | 12 | ```ruby 13 | require "xlloop" 14 | 15 | class MyFuncs 16 | def sum(*a) 17 | a.flatten.compact.inject(0) { |b,i| b+i } 18 | end 19 | 20 | def product(a,b) 21 | a*b 22 | end 23 | end 24 | 25 | h = ReflectionHandler.new 26 | h.push(MyFuncs.new, "MyFuncs.") 27 | f = XLLoopServer.new(h) 28 | f.start 29 | ``` 30 | 31 | This creates a new server (a socket listening on port 5454) and exposes to functions in Excel; MyFuncs.sum and MyFuncs.product. -------------------------------------------------------------------------------- /org.boris.expr/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /org.boris.expr/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | -------------------------------------------------------------------------------- /org.boris.expr/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.boris.expr 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.jdt.core.javanature 26 | org.eclipse.pde.PluginNature 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.boris.expr/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Expr 4 | Bundle-SymbolicName: org.boris.expr 5 | Bundle-Version: 1.0.0 6 | Export-Package: org.boris.expr, 7 | org.boris.expr.engine, 8 | org.boris.expr.function, 9 | org.boris.expr.function.excel, 10 | org.boris.expr.parser, 11 | org.boris.expr.util 12 | -------------------------------------------------------------------------------- /org.boris.expr/README: -------------------------------------------------------------------------------- 1 | Expr4J - a general purpose expression parser and calculation. 2 | 3 | For more information see http://expr4j.sourceforge.net -------------------------------------------------------------------------------- /org.boris.expr/build.properties: -------------------------------------------------------------------------------- 1 | source.. = java/src/,\ 2 | java/test/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/ExprEqual.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public class ExprEqual extends AbstractComparisonOperator 13 | { 14 | public ExprEqual(Expr lhs, Expr rhs) { 15 | super(ExprType.Equal, lhs, rhs); 16 | } 17 | 18 | public Expr evaluate() throws ExprException { 19 | return bool(compare() == 0); 20 | } 21 | 22 | public String toString() { 23 | return lhs + "=" + rhs; 24 | } 25 | } -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/ExprEvaluatable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public abstract class ExprEvaluatable extends Expr 13 | { 14 | public ExprEvaluatable(ExprType type) { 15 | super(type, true); 16 | } 17 | 18 | public boolean isVolatile() { 19 | return true; 20 | } 21 | 22 | public abstract Expr evaluate() throws ExprException; 23 | } 24 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/ExprException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public class ExprException extends Exception 13 | { 14 | public ExprException() { 15 | super(); 16 | } 17 | 18 | public ExprException(String message, Throwable cause) { 19 | super(message, cause); 20 | } 21 | 22 | public ExprException(String message) { 23 | super(message); 24 | } 25 | 26 | public ExprException(Throwable cause) { 27 | super(cause); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/ExprGreaterThan.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public class ExprGreaterThan extends AbstractComparisonOperator 13 | { 14 | public ExprGreaterThan(Expr lhs, Expr rhs) { 15 | super(ExprType.GreaterThan, lhs, rhs); 16 | } 17 | 18 | public Expr evaluate() throws ExprException { 19 | return bool(compare() > 0); 20 | } 21 | 22 | public String toString() { 23 | return lhs + ">" + rhs; 24 | } 25 | } -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/ExprGreaterThanOrEqualTo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public class ExprGreaterThanOrEqualTo extends AbstractComparisonOperator 13 | { 14 | public ExprGreaterThanOrEqualTo(Expr lhs, Expr rhs) { 15 | super(ExprType.GreaterThanOrEqualTo, lhs, rhs); 16 | } 17 | 18 | public Expr evaluate() throws ExprException { 19 | return bool(compare() >= 0); 20 | } 21 | 22 | public String toString() { 23 | return lhs + ">=" + rhs; 24 | } 25 | } -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/ExprLessThan.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public class ExprLessThan extends AbstractComparisonOperator 13 | { 14 | public ExprLessThan(Expr lhs, Expr rhs) { 15 | super(ExprType.LessThan, lhs, rhs); 16 | } 17 | 18 | public Expr evaluate() throws ExprException { 19 | return bool(compare() < 0); 20 | } 21 | 22 | public String toString() { 23 | return lhs + "<" + rhs; 24 | } 25 | } -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/ExprLessThanOrEqualTo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public class ExprLessThanOrEqualTo extends AbstractComparisonOperator 13 | { 14 | public ExprLessThanOrEqualTo(Expr lhs, Expr rhs) { 15 | super(ExprType.LessThanOrEqualTo, lhs, rhs); 16 | } 17 | 18 | public Expr evaluate() throws ExprException { 19 | return bool(compare() <= 0); 20 | } 21 | 22 | public String toString() { 23 | return lhs + "<=" + rhs; 24 | } 25 | } -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/ExprMissing.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | 13 | public class ExprMissing extends Expr 14 | { 15 | public static final ExprMissing MISSING = new ExprMissing(); 16 | 17 | public ExprMissing() { 18 | super(ExprType.Missing, false); 19 | } 20 | 21 | public String toString() { 22 | return ""; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/ExprMultiplication.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public class ExprMultiplication extends AbstractMathematicalOperator 13 | { 14 | public ExprMultiplication(Expr lhs, Expr rhs) { 15 | super(ExprType.Multiplication, lhs, rhs); 16 | } 17 | 18 | protected Expr evaluate(double lhs, double rhs) throws ExprException { 19 | return new ExprDouble(lhs * rhs); 20 | } 21 | 22 | public String toString() { 23 | return lhs + "*" + rhs; 24 | } 25 | } -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/ExprNotEqual.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public class ExprNotEqual extends AbstractComparisonOperator 13 | { 14 | public ExprNotEqual(Expr lhs, Expr rhs) { 15 | super(ExprType.NotEqual, lhs, rhs); 16 | } 17 | 18 | public Expr evaluate() throws ExprException { 19 | return bool(compare() != 0); 20 | } 21 | 22 | public String toString() { 23 | return lhs + "!=" + rhs; 24 | } 25 | } -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/ExprNumber.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public abstract class ExprNumber extends Expr 13 | { 14 | ExprNumber(ExprType type) { 15 | super(type, false); 16 | } 17 | 18 | public void validate() throws ExprException { 19 | } 20 | 21 | public boolean booleanValue() { 22 | return intValue() != 0; 23 | } 24 | 25 | public abstract int intValue(); 26 | 27 | public abstract double doubleValue(); 28 | } 29 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/ExprPower.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public class ExprPower extends AbstractMathematicalOperator 13 | { 14 | public ExprPower(Expr lhs, Expr rhs) { 15 | super(ExprType.Power, lhs, rhs); 16 | } 17 | 18 | protected Expr evaluate(double lhs, double rhs) throws ExprException { 19 | return new ExprDouble(Math.pow(lhs, rhs)); 20 | } 21 | 22 | public String toString() { 23 | return lhs + "^" + rhs; 24 | } 25 | } -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/ExprTypes.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public class ExprTypes 13 | { 14 | public static void assertType(Expr value, ExprType... types) 15 | throws ExprException { 16 | for (ExprType t : types) { 17 | if (t.equals(value.type)) 18 | return; 19 | } 20 | throw new ExprException("Unexpected type: " + value.type); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/IBinaryOperator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public interface IBinaryOperator 13 | { 14 | public Expr getLHS(); 15 | 16 | public void setLHS(Expr lhs); 17 | 18 | public Expr getRHS(); 19 | 20 | public void setRHS(Expr rhs); 21 | } 22 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/IEvaluationCallback.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public interface IEvaluationCallback 13 | { 14 | public Expr evaluateFunction(ExprFunction function) throws ExprException; 15 | 16 | public Expr evaluateVariable(ExprVariable variable) throws ExprException; 17 | } 18 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/IExprFunction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public interface IExprFunction 13 | { 14 | Expr evaluate(Expr[] args) throws ExprException; 15 | 16 | boolean isVolatile(); 17 | } 18 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/engine/IEngineListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr.engine; 11 | 12 | import org.boris.expr.Expr; 13 | 14 | public interface IEngineListener 15 | { 16 | void beforeCalculation(String name); 17 | 18 | void afterCalculation(String name, Expr value); 19 | } 20 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/IFunctionProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr.function; 11 | 12 | import org.boris.expr.Expr; 13 | import org.boris.expr.ExprException; 14 | import org.boris.expr.ExprFunction; 15 | 16 | public interface IFunctionProvider 17 | { 18 | boolean hasFunction(ExprFunction function); 19 | 20 | Expr evaluate(ExprFunction function) throws ExprException; 21 | } 22 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ABS.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class ABS extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return Math.abs(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ACOS.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class ACOS extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return Math.acos(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ACOSH.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | import org.boris.expr.util.Maths; 6 | 7 | public class ACOSH extends DoubleInOutFunction 8 | { 9 | protected double evaluate(double value) throws ExprException { 10 | return Maths.acosh(value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/AREAS.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.ExprVariable; 7 | import org.boris.expr.function.AbstractFunction; 8 | 9 | public class AREAS extends AbstractFunction 10 | { 11 | public Expr evaluate(Expr[] args) throws ExprException { 12 | assertArgCount(args, 1); 13 | Expr e = args[0]; 14 | if (e instanceof ExprVariable) { 15 | return new ExprDouble(1); 16 | } 17 | return null; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ASIN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class ASIN extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return Math.asin(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ASINH.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | import org.boris.expr.util.Maths; 6 | 7 | public class ASINH extends DoubleInOutFunction 8 | { 9 | protected double evaluate(double value) throws ExprException { 10 | return Maths.asinh(value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ATAN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class ATAN extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return Math.atan(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ATAN2.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class ATAN2 extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 2); 12 | double x = asDouble(args[0], true); 13 | double y = asDouble(args[1], true); 14 | return new ExprDouble(Math.atan2(y, x)); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ATANH.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | import org.boris.expr.util.Maths; 6 | 7 | public class ATANH extends DoubleInOutFunction 8 | { 9 | protected double evaluate(double value) throws ExprException { 10 | return Maths.atanh(value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/AVERAGEA.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.ForEachNumberAFunction; 7 | import org.boris.expr.util.Counter; 8 | 9 | public class AVERAGEA extends ForEachNumberAFunction 10 | { 11 | protected void value(Counter counter, double value) { 12 | counter.count++; 13 | counter.value += value; 14 | } 15 | 16 | protected Expr evaluate(Counter counter) throws ExprException { 17 | return new ExprDouble(counter.value / counter.count); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/BAHTTEXT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class BAHTTEXT extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/CEILING.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprError; 6 | import org.boris.expr.ExprException; 7 | import org.boris.expr.function.AbstractFunction; 8 | 9 | public class CEILING extends AbstractFunction 10 | { 11 | public Expr evaluate(Expr[] args) throws ExprException { 12 | assertArgCount(args, 2); 13 | double val = asDouble(args[0], true); 14 | double rnd = asDouble(args[1], true); 15 | if (rnd == 0) 16 | return ExprDouble.ZERO; 17 | if ((val < 0 && rnd > 0) || (val > 0 && rnd < 0)) 18 | return ExprError.NUM; 19 | double m = val % rnd; 20 | if (rnd < 0) 21 | rnd = 0; 22 | return new ExprDouble(val - m + rnd); 23 | } 24 | 25 | public boolean equalish(double d1, double d2) { 26 | return Math.abs(d1 - d2) < 0.0000000001; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/CELL.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class CELL extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/CHAR.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprError; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.ExprString; 7 | import org.boris.expr.function.AbstractFunction; 8 | 9 | public class CHAR extends AbstractFunction 10 | { 11 | public Expr evaluate(Expr[] args) throws ExprException { 12 | assertArgCount(args, 1); 13 | int c = asInteger(args[0], true); 14 | if (c < 1 || c > 255) 15 | return ExprError.VALUE; 16 | else 17 | return new ExprString("" + (char) c); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/CHITEST.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class CHITEST extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/CLEAN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.ExprString; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class CLEAN extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 1); 12 | String str = asString(args[0], true); 13 | StringBuilder sb = new StringBuilder(); 14 | int len = str.length(); 15 | for (int i = 0; i < len; i++) { 16 | char c = str.charAt(i); 17 | if (c != 7) { 18 | sb.append(c); 19 | } 20 | } 21 | return new ExprString(sb.toString()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/CODE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprError; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.ExprInteger; 7 | import org.boris.expr.ExprNumber; 8 | import org.boris.expr.ExprString; 9 | import org.boris.expr.function.AbstractFunction; 10 | 11 | public class CODE extends AbstractFunction 12 | { 13 | public Expr evaluate(Expr[] args) throws ExprException { 14 | assertArgCount(args, 1); 15 | 16 | Expr a = evalArg(args[0]); 17 | String s = null; 18 | 19 | if (a instanceof ExprString) { 20 | s = ((ExprString) a).str; 21 | } else if (a instanceof ExprNumber) { 22 | s = a.toString(); 23 | } 24 | 25 | if (s != null && s.length() > 0) 26 | return new ExprInteger(s.charAt(0)); 27 | 28 | return ExprError.VALUE; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/CONCATENATE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.ExprNumber; 6 | import org.boris.expr.ExprString; 7 | import org.boris.expr.function.AbstractFunction; 8 | 9 | public class CONCATENATE extends AbstractFunction 10 | { 11 | public Expr evaluate(Expr[] args) throws ExprException { 12 | assertMinArgCount(args, 1); 13 | StringBuilder sb = new StringBuilder(); 14 | for (Expr a : args) { 15 | a = evalArg(a); 16 | if (a instanceof ExprString) { 17 | sb.append(((ExprString) a).str); 18 | } else if (a instanceof ExprNumber) { 19 | sb.append(a.toString()); 20 | } 21 | } 22 | return new ExprString(sb.toString()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/CORREL.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class CORREL extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/COS.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class COS extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return Math.cos(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/COSH.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class COSH extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return Math.cosh(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/COUNTA.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.ExprInteger; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class COUNTA extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertMinArgCount(args, 1); 12 | int count = 0; 13 | for (Expr a : args) { 14 | count += COUNT.count(a, true); 15 | } 16 | return new ExprInteger(count); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DATEVALUE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class DATEVALUE extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DAVERAGE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.SimpleDatabaseFunction; 6 | 7 | public class DAVERAGE extends SimpleDatabaseFunction 8 | { 9 | protected Expr evaluateMatches(Expr[] matches) throws ExprException { 10 | return AVERAGE.average(matches); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DAY.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | import org.boris.expr.util.ExcelDate; 6 | 7 | public class DAY extends DoubleInOutFunction 8 | { 9 | protected double evaluate(double value) throws ExprException { 10 | return ExcelDate.getDayOfMonth(value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DAYS360.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class DAYS360 extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DCOUNT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.ExprNumber; 7 | import org.boris.expr.function.SimpleDatabaseFunction; 8 | 9 | public class DCOUNT extends SimpleDatabaseFunction 10 | { 11 | protected Expr evaluateMatches(Expr[] matches) throws ExprException { 12 | int count = 0; 13 | for (Expr m : matches) { 14 | if (m instanceof ExprNumber) 15 | count++; 16 | } 17 | return new ExprDouble(count); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DCOUNTA.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.SimpleDatabaseFunction; 7 | 8 | public class DCOUNTA extends SimpleDatabaseFunction 9 | { 10 | protected Expr evaluateMatches(Expr[] matches) throws ExprException { 11 | return new ExprDouble(matches.length); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DEGREES.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class DEGREES extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return value * 180 / Math.PI; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DGET.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprError; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.SimpleDatabaseFunction; 7 | 8 | public class DGET extends SimpleDatabaseFunction 9 | { 10 | protected Expr evaluateMatches(Expr[] matches) throws ExprException { 11 | if (matches.length != 1) 12 | return ExprError.NUM; 13 | return matches[0]; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DMAX.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.SimpleDatabaseFunction; 6 | 7 | public class DMAX extends SimpleDatabaseFunction 8 | { 9 | protected Expr evaluateMatches(Expr[] matches) throws ExprException { 10 | return MAX.max(matches); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DMIN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.SimpleDatabaseFunction; 6 | 7 | public class DMIN extends SimpleDatabaseFunction 8 | { 9 | protected Expr evaluateMatches(Expr[] matches) throws ExprException { 10 | return MIN.min(matches); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DOLLAR.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class DOLLAR extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DPRODUCT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.SimpleDatabaseFunction; 6 | 7 | public class DPRODUCT extends SimpleDatabaseFunction 8 | { 9 | protected Expr evaluateMatches(Expr[] matches) throws ExprException { 10 | return PRODUCT.product(matches); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DSTDEV.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.SimpleDatabaseFunction; 6 | 7 | public class DSTDEV extends SimpleDatabaseFunction 8 | { 9 | protected Expr evaluateMatches(Expr[] matches) throws ExprException { 10 | return STDEV.stdev(matches); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DSTDEVP.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.SimpleDatabaseFunction; 6 | 7 | public class DSTDEVP extends SimpleDatabaseFunction 8 | { 9 | protected Expr evaluateMatches(Expr[] matches) throws ExprException { 10 | return STDEVP.stdevp(matches); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DSUM.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.SimpleDatabaseFunction; 6 | 7 | public class DSUM extends SimpleDatabaseFunction 8 | { 9 | protected Expr evaluateMatches(Expr[] matches) throws ExprException { 10 | return SUM.sum(matches); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DVAR.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.SimpleDatabaseFunction; 6 | 7 | public class DVAR extends SimpleDatabaseFunction 8 | { 9 | protected Expr evaluateMatches(Expr[] matches) throws ExprException { 10 | return STDEV.variance(matches, false); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/DVARP.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.SimpleDatabaseFunction; 6 | 7 | public class DVARP extends SimpleDatabaseFunction 8 | { 9 | protected Expr evaluateMatches(Expr[] matches) throws ExprException { 10 | return STDEV.variance(matches, true); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/EVEN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class EVEN extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | double res = value % 2; 10 | if (res < 0) { 11 | return value - 2 - res; 12 | } else if (res == 0) { 13 | return value; 14 | } else { 15 | return value + 2 - res; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/EXACT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprBoolean; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class EXACT extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 2); 12 | 13 | String str1 = asString(args[0], false); 14 | String str2 = asString(args[1], false); 15 | 16 | return str1.equals(str2) ? ExprBoolean.TRUE : ExprBoolean.FALSE; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/EXP.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class EXP extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return Math.exp(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/EXPONDIST.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | import org.boris.expr.util.Statistics; 8 | 9 | public class EXPONDIST extends AbstractFunction 10 | { 11 | public Expr evaluate(Expr[] args) throws ExprException { 12 | assertArgCount(args, 3); 13 | double x = asDouble(args[0], true); 14 | double l = asDouble(args[1], true); 15 | boolean c = asBoolean(args[2], true); 16 | 17 | return new ExprDouble(Statistics.exponDist(x, l, c)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/FACT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprError; 6 | import org.boris.expr.ExprException; 7 | import org.boris.expr.function.AbstractFunction; 8 | import org.boris.expr.util.Statistics; 9 | 10 | public class FACT extends AbstractFunction 11 | { 12 | public Expr evaluate(Expr[] args) throws ExprException { 13 | assertArgCount(args, 1); 14 | double value = asDouble(args[0], true); 15 | if (value < 0) 16 | return ExprError.NUM; 17 | 18 | return new ExprDouble(Statistics.factorial((int) value).doubleValue()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/FALSE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprBoolean; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class FALSE extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 0); 12 | return ExprBoolean.FALSE; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/FDIST.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class FDIST extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/FIND.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprError; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.ExprInteger; 7 | import org.boris.expr.function.AbstractFunction; 8 | 9 | public class FIND extends AbstractFunction 10 | { 11 | public Expr evaluate(Expr[] args) throws ExprException { 12 | assertMinArgCount(args, 2); 13 | assertMaxArgCount(args, 3); 14 | 15 | String f = asString(args[0], true); 16 | String s = asString(args[1], true); 17 | int pos = 0; 18 | if (args.length == 3) 19 | pos = asInteger(args[2], true); 20 | 21 | int i = s.indexOf(f, pos); 22 | if (i == -1) 23 | return ExprError.VALUE; 24 | 25 | return new ExprInteger(i + 1); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/FINV.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class FINV extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/FISHER.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class FISHER extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/FISHERNV.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class FISHERNV extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/FIXED.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class FIXED extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/FTEST.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class FTEST extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/FV.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class FV extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/GAMMADIST.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class GAMMADIST extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/GAMMAINV.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class GAMMAINV extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/GAMMALN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class GAMMALN extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/GEOMEAN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.ForEachNumberFunction; 7 | import org.boris.expr.util.Counter; 8 | 9 | public class GEOMEAN extends ForEachNumberFunction 10 | { 11 | protected void initialize(Counter counter) throws ExprException { 12 | counter.value = 1; 13 | } 14 | 15 | protected void value(Counter counter, double value) { 16 | counter.count++; 17 | counter.value *= value; 18 | } 19 | 20 | protected Expr evaluate(Counter counter) throws ExprException { 21 | return new ExprDouble(Math.pow(counter.value, 1. / counter.count)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/GETPIVOTDATA.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class GETPIVOTDATA extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/GROWTH.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class GROWTH extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/HARMEAN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprError; 6 | import org.boris.expr.ExprException; 7 | import org.boris.expr.function.ForEachNumberFunction; 8 | import org.boris.expr.util.Counter; 9 | 10 | public class HARMEAN extends ForEachNumberFunction 11 | { 12 | protected void value(Counter counter, double value) { 13 | if (value <= 0) { 14 | counter.doit = false; 15 | counter.result = ExprError.NUM; 16 | return; 17 | } 18 | counter.count++; 19 | counter.value += 1 / value; 20 | } 21 | 22 | protected Expr evaluate(Counter counter) throws ExprException { 23 | if (counter.result != null) 24 | return counter.result; 25 | return new ExprDouble(1. / (counter.value / counter.count)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/HLOOKUP.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class HLOOKUP extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/HOUR.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | import org.boris.expr.util.ExcelDate; 6 | 7 | public class HOUR extends DoubleInOutFunction 8 | { 9 | protected double evaluate(double value) throws ExprException { 10 | return ExcelDate.getHour(value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/HYPERLINK.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class HYPERLINK extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/HYPGEOMDIST.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class HYPGEOMDIST extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/INDEX.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class INDEX extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/INDIRECT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class INDIRECT extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | assertMinArgCount(args, 1); 11 | assertMaxArgCount(args, 2); 12 | Expr ref = evalArg(args[0]); 13 | 14 | return null; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/INTERCEPT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class INTERCEPT extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/IPMT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class IPMT extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/IRR.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class IRR extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ISBLANK.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.ExprMissing; 6 | import org.boris.expr.ExprString; 7 | import org.boris.expr.function.AbstractFunction; 8 | 9 | public class ISBLANK extends AbstractFunction 10 | { 11 | public Expr evaluate(Expr[] args) throws ExprException { 12 | assertArgCount(args, 1); 13 | Expr e = evalArg(args[0]); 14 | return bool(e instanceof ExprMissing || 15 | (e instanceof ExprString && "".equals(((ExprString) e).str))); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ISERR.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprError; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class ISERR extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 1); 12 | Expr e = evalArg(args[0]); 13 | return bool(e instanceof ExprError); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ISLOGICAL.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprBoolean; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class ISLOGICAL extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 1); 12 | Expr e = evalArg(args[0]); 13 | return bool(e instanceof ExprBoolean); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ISNA.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprError; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class ISNA extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 1); 12 | Expr e = evalArg(args[0]); 13 | return bool(ExprError.NA.equals(e)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ISNONTEXT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.ExprString; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class ISNONTEXT extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 1); 12 | Expr e = evalArg(args[0]); 13 | return bool(!(e instanceof ExprString) || 14 | "".equals(((ExprString) e).str)); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ISNUMBER.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.ExprInteger; 7 | import org.boris.expr.function.AbstractFunction; 8 | 9 | public class ISNUMBER extends AbstractFunction 10 | { 11 | public Expr evaluate(Expr[] args) throws ExprException { 12 | assertArgCount(args, 1); 13 | Expr e = evalArg(args[0]); 14 | return bool(e instanceof ExprInteger || e instanceof ExprDouble); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ISPMT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class ISPMT extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ISREF.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.ExprVariable; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class ISREF extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 1); 12 | return bool(args[0] instanceof ExprVariable); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ISTEXT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.ExprString; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class ISTEXT extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 1); 12 | Expr e = evalArg(args[0]); 13 | return bool(e instanceof ExprString); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/LARGE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class LARGE extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/LEFT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.ExprString; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class LEFT extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertMinArgCount(args, 1); 12 | assertMaxArgCount(args, 2); 13 | String str = asString(args[0], false); 14 | int r = 1; 15 | if (args.length == 2) { 16 | r = asInteger(args[1], true); 17 | } 18 | if (r > str.length()) 19 | r = str.length(); 20 | return new ExprString(str.substring(0, r)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/LEN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprArray; 5 | import org.boris.expr.ExprDouble; 6 | import org.boris.expr.ExprError; 7 | import org.boris.expr.ExprException; 8 | import org.boris.expr.ExprString; 9 | import org.boris.expr.function.AbstractFunction; 10 | 11 | public class LEN extends AbstractFunction 12 | { 13 | public Expr evaluate(Expr[] args) throws ExprException { 14 | assertArgCount(args, 1); 15 | Expr a = evalArg(args[0]); 16 | if (a instanceof ExprArray) 17 | return ExprError.VALUE; 18 | String str = null; 19 | if (a instanceof ExprString) 20 | str = ((ExprString) a).str; 21 | else 22 | str = a.toString(); 23 | return new ExprDouble(str.length()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/LINEST.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class LINEST extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/LN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class LN extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return Math.log(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/LOG.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprError; 6 | import org.boris.expr.ExprException; 7 | import org.boris.expr.function.AbstractFunction; 8 | import org.boris.expr.util.Maths; 9 | 10 | public class LOG extends AbstractFunction 11 | { 12 | public Expr evaluate(Expr[] args) throws ExprException { 13 | assertMinArgCount(args, 1); 14 | assertMaxArgCount(args, 2); 15 | double num = asDouble(args[0], true); 16 | if (num < 0) 17 | return ExprError.NUM; 18 | 19 | int base = 10; 20 | if (args.length == 2) 21 | base = asInteger(args[1], true); 22 | if (base < 1) 23 | return ExprError.NUM; 24 | if (base == 1) 25 | return ExprError.DIV0; 26 | 27 | return new ExprDouble(Maths.log(num, base)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/LOG10.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class LOG10 extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return Math.log10(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/LOGEST.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class LOGEST extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/LOGINV.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class LOGINV extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/LOGNORMDIST.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class LOGNORMDIST extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/LOOKUP.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class LOOKUP extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | assertMinArgCount(args, 2); 11 | assertMaxArgCount(args, 3); 12 | if (args.length == 2) { 13 | return arrayLookup(args); 14 | } else { 15 | return vectorLookup(args); 16 | } 17 | } 18 | 19 | public static Expr vectorLookup(Expr[] args) throws ExprException { 20 | Expr ev = evalArg(args[0]); 21 | Expr el = evalArg(args[1]); 22 | Expr er = evalArg(args[2]); 23 | return null; 24 | } 25 | 26 | public static Expr arrayLookup(Expr[] args) { 27 | return null; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/LOWER.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprArray; 5 | import org.boris.expr.ExprError; 6 | import org.boris.expr.ExprException; 7 | import org.boris.expr.ExprString; 8 | import org.boris.expr.function.AbstractFunction; 9 | 10 | public class LOWER extends AbstractFunction 11 | { 12 | public Expr evaluate(Expr[] args) throws ExprException { 13 | assertArgCount(args, 1); 14 | Expr a = evalArg(args[0]); 15 | if (a instanceof ExprArray) 16 | return ExprError.VALUE; 17 | if (a instanceof ExprString) 18 | return new ExprString(((ExprString) a).str.toLowerCase()); 19 | return new ExprString(a.toString().toLowerCase()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/MATCH.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class MATCH extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/MAXA.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.ForEachNumberAFunction; 7 | import org.boris.expr.util.Counter; 8 | 9 | public class MAXA extends ForEachNumberAFunction 10 | { 11 | protected void initialize(Counter counter) throws ExprException { 12 | counter.value = -Double.MAX_VALUE; 13 | } 14 | 15 | protected void value(Counter counter, double value) { 16 | if (value > counter.value) 17 | counter.value = value; 18 | } 19 | 20 | protected Expr evaluate(Counter counter) throws ExprException { 21 | return new ExprDouble(counter.value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/MDETERM.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class MDETERM extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/MEDIAN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class MEDIAN extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/MINA.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.ForEachNumberAFunction; 7 | import org.boris.expr.util.Counter; 8 | 9 | public class MINA extends ForEachNumberAFunction 10 | { 11 | protected void initialize(Counter counter) throws ExprException { 12 | counter.value = Double.MAX_VALUE; 13 | } 14 | 15 | protected void value(Counter counter, double value) { 16 | if (value < counter.value) 17 | counter.value = value; 18 | } 19 | 20 | protected Expr evaluate(Counter counter) throws ExprException { 21 | return new ExprDouble(counter.value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/MINUTE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | import org.boris.expr.util.ExcelDate; 6 | 7 | public class MINUTE extends DoubleInOutFunction 8 | { 9 | protected double evaluate(double value) throws ExprException { 10 | return ExcelDate.getMinute(value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/MINVERSE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class MINVERSE extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/MIRR.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class MIRR extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/MMULT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class MMULT extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/MODE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class MODE extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/MONTH.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | import org.boris.expr.util.ExcelDate; 6 | 7 | public class MONTH extends DoubleInOutFunction 8 | { 9 | protected double evaluate(double value) throws ExprException { 10 | return ExcelDate.getMonth(value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/N.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprArray; 5 | import org.boris.expr.ExprDouble; 6 | import org.boris.expr.ExprException; 7 | import org.boris.expr.ExprNumber; 8 | import org.boris.expr.function.AbstractFunction; 9 | 10 | public class N extends AbstractFunction 11 | { 12 | public Expr evaluate(Expr[] args) throws ExprException { 13 | assertArgCount(args, 1); 14 | Expr a = evalArg(args[0]); 15 | if (a instanceof ExprArray) { 16 | ExprArray ar = (ExprArray) a; 17 | a = ar.get(0); 18 | } 19 | if (a instanceof ExprNumber) { 20 | return new ExprDouble(((ExprNumber) a).doubleValue()); 21 | } 22 | return ExprDouble.ZERO; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/NA.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprError; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class NA extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 0); 12 | return ExprError.NA; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/NEGBINOMDIST.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class NEGBINOMDIST extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/NORMDIST.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class NORMDIST extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/NORMINV.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class NORMINV extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/NORMSDIST.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunctionErr; 5 | import org.boris.expr.util.Statistics; 6 | 7 | public class NORMSDIST extends DoubleInOutFunctionErr 8 | { 9 | protected double evaluate(double value) throws ExprException { 10 | return Statistics.normsDist(value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/NORMSINV.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class NORMSINV extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/NOT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprError; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.ExprNumber; 7 | import org.boris.expr.function.AbstractFunction; 8 | 9 | public class NOT extends AbstractFunction 10 | { 11 | public Expr evaluate(Expr[] args) throws ExprException { 12 | assertArgCount(args, 1); 13 | Expr a = evalArg(args[0]); 14 | if (a instanceof ExprNumber) { 15 | return bool(!((ExprNumber) a).booleanValue()); 16 | } 17 | return ExprError.VALUE; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/NOW.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | public class NOW extends TODAY 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/NPER.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class NPER extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/NPV.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class NPV extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ODD.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class ODD extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | double res = (value + 1) % 2; 10 | if (res < 0) { 11 | return value - 2 - res; 12 | } else if (res == 0) { 13 | return value; 14 | } else { 15 | return value + 2 - res; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/PEARSON.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class PEARSON extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/PERCENTILE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class PERCENTILE extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/PERCENTRANK.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class PERCENTRANK extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/PI.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class PI extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 0); 12 | return ExprDouble.PI; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/PMT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class PMT extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/POISSON.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class POISSON extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/POWER.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class POWER extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 2); 12 | double num = asDouble(args[0], true); 13 | double pow = asDouble(args[1], true); 14 | return new ExprDouble(Math.pow(num, pow)); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/PPMT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class PPMT extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/PROB.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class PROB extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/PV.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class PV extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/QUARTILE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class QUARTILE extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/RADIANS.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class RADIANS extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return value * Math.PI / 180; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/RAND.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class RAND extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 0); 12 | return new ExprDouble(Math.random()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/RANK.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class RANK extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/RATE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class RATE extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/RIGHT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.ExprString; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class RIGHT extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertMinArgCount(args, 1); 12 | assertMaxArgCount(args, 2); 13 | String str = asString(args[0], false); 14 | int r = 1; 15 | if (args.length == 2) { 16 | r = asInteger(args[1], true); 17 | } 18 | int len = str.length() - r; 19 | if (len < 0) 20 | len = 0; 21 | return new ExprString(str.substring(len)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ROMAN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class ROMAN extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ROUND.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | import org.boris.expr.util.Maths; 8 | 9 | public class ROUND extends AbstractFunction 10 | { 11 | public Expr evaluate(Expr[] args) throws ExprException { 12 | assertArgCount(args, 2); 13 | double num = asDouble(args[0], true); 14 | int dps = asInteger(args[1], true); 15 | return new ExprDouble(Maths.round(num, dps)); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ROUNDDOWN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | import org.boris.expr.util.Maths; 8 | 9 | public class ROUNDDOWN extends AbstractFunction 10 | { 11 | public Expr evaluate(Expr[] args) throws ExprException { 12 | assertArgCount(args, 2); 13 | double num = asDouble(args[0], true); 14 | int dps = asInteger(args[1], true); 15 | return new ExprDouble(Maths.roundDown(num, dps)); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ROUNDUP.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | import org.boris.expr.util.Maths; 8 | 9 | public class ROUNDUP extends AbstractFunction 10 | { 11 | public Expr evaluate(Expr[] args) throws ExprException { 12 | assertArgCount(args, 2); 13 | double num = asDouble(args[0], true); 14 | int dps = asInteger(args[1], true); 15 | return new ExprDouble(Maths.roundUp(num, dps)); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ROWS.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class ROWS extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | assertArgCount(args, 1); 11 | return COLUMNS.columnsOrRows(args, false); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/RSQ.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class RSQ extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/RTD.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class RTD extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/SEARCH.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprError; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.ExprInteger; 7 | import org.boris.expr.function.AbstractFunction; 8 | 9 | public class SEARCH extends AbstractFunction 10 | { 11 | public Expr evaluate(Expr[] args) throws ExprException { 12 | assertMinArgCount(args, 2); 13 | assertMaxArgCount(args, 3); 14 | 15 | String f = asString(args[0], true).toLowerCase(); 16 | String s = asString(args[1], true).toLowerCase(); 17 | int pos = 0; 18 | if (args.length == 3) 19 | pos = asInteger(args[2], true); 20 | 21 | int i = s.indexOf(f, pos); 22 | if (i == -1) 23 | return ExprError.VALUE; 24 | 25 | return new ExprInteger(i + 1); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/SECOND.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | import org.boris.expr.util.ExcelDate; 6 | 7 | public class SECOND extends DoubleInOutFunction 8 | { 9 | protected double evaluate(double value) throws ExprException { 10 | return ExcelDate.getSecond(value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/SIGN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class SIGN extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | if (value < 0) 10 | return -1; 11 | else if (value > 0) 12 | return 1; 13 | else 14 | return 0; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/SIN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class SIN extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return Math.sin(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/SINH.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class SINH extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return Math.sinh(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/SKEW.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class SKEW extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/SLN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class SLN extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/SLOPE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class SLOPE extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/SMALL.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class SMALL extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/SQRT.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class SQRT extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return Math.sqrt(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/STANDARDIZE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class STANDARDIZE extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/STDEVA.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class STDEVA extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/STDEVP.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | 6 | public class STDEVP extends STDEV 7 | { 8 | public Expr evaluate(Expr[] args) throws ExprException { 9 | return stdevp(args); 10 | } 11 | 12 | public static Expr stdevp(Expr[] args) throws ExprException { 13 | return stdev(args, true); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/STDEVPA.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class STDEVPA extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/STEYX.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class STEYX extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/SUBTOTAL.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class SUBTOTAL extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/SUMX2PY2.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | 4 | public class SUMX2PY2 extends SUMX2MY2 5 | { 6 | protected double eval(double x, double y) { 7 | return Math.pow(x, 2) + Math.pow(y, 2); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/SUMXMY2.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | 4 | public class SUMXMY2 extends SUMX2MY2 5 | { 6 | protected double eval(double x, double y) { 7 | return Math.pow(x - y, 2); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/SYD.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class SYD extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 4); 12 | double cost = asDouble(args[0], true); 13 | double salvage = asDouble(args[1], true); 14 | double life = asDouble(args[2], true); 15 | double per = asDouble(args[3], true); 16 | double syd = ((cost - salvage) * (life - per + 1) * 2) / 17 | (life * (life + 1)); 18 | 19 | return new ExprDouble(syd); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/T.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.ExprString; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class T extends AbstractFunction 9 | { 10 | private static final ExprString EMPTY = new ExprString(""); 11 | 12 | public Expr evaluate(Expr[] args) throws ExprException { 13 | assertArgCount(args, 1); 14 | Expr a = evalArg(args[0]); 15 | 16 | if (a instanceof ExprString) { 17 | return a; 18 | } else { 19 | return EMPTY; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/TAN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class TAN extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return Math.tan(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/TANH.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | 6 | public class TANH extends DoubleInOutFunction 7 | { 8 | protected double evaluate(double value) throws ExprException { 9 | return Math.tanh(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/TDIST.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class TDIST extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/TIMEVALUE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class TIMEVALUE extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/TINV.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class TINV extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/TODAY.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import java.util.Date; 4 | 5 | import org.boris.expr.Expr; 6 | import org.boris.expr.ExprDouble; 7 | import org.boris.expr.ExprException; 8 | import org.boris.expr.function.AbstractFunction; 9 | import org.boris.expr.util.ExcelDate; 10 | 11 | public class TODAY extends AbstractFunction 12 | { 13 | public Expr evaluate(Expr[] args) throws ExprException { 14 | assertArgCount(args, 0); 15 | return new ExprDouble(ExcelDate.toExcelDate(new Date().getTime())); 16 | } 17 | 18 | public boolean isVolatile() { 19 | return true; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/TREND.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class TREND extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/TRIM.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprArray; 5 | import org.boris.expr.ExprError; 6 | import org.boris.expr.ExprException; 7 | import org.boris.expr.ExprString; 8 | import org.boris.expr.function.AbstractFunction; 9 | 10 | public class TRIM extends AbstractFunction 11 | { 12 | public Expr evaluate(Expr[] args) throws ExprException { 13 | assertArgCount(args, 1); 14 | Expr a = evalArg(args[0]); 15 | if (a instanceof ExprArray) 16 | return ExprError.VALUE; 17 | String str = null; 18 | if (a instanceof ExprString) 19 | str = ((ExprString) a).str; 20 | else 21 | str = a.toString(); 22 | return new ExprString(str.trim()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/TRIMMEAN.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class TRIMMEAN extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/TRUE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprBoolean; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class TRUE extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertArgCount(args, 0); 12 | return ExprBoolean.TRUE; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/TRUNC.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprDouble; 5 | import org.boris.expr.ExprException; 6 | import org.boris.expr.function.AbstractFunction; 7 | 8 | public class TRUNC extends AbstractFunction 9 | { 10 | public Expr evaluate(Expr[] args) throws ExprException { 11 | assertMinArgCount(args, 1); 12 | assertMaxArgCount(args, 2); 13 | double num = asDouble(args[0], true); 14 | int dig = 1; 15 | if (args.length == 2) 16 | dig = asInteger(args[1], true); 17 | if (dig == 1) { 18 | return new ExprDouble((int) num); 19 | } else { 20 | int div = (int) Math.pow(10, dig); 21 | int v = (int) (num * div); 22 | double d = (double) v / div; 23 | return new ExprDouble(d); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/TTEST.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class TTEST extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/UPPER.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprArray; 5 | import org.boris.expr.ExprError; 6 | import org.boris.expr.ExprException; 7 | import org.boris.expr.ExprString; 8 | import org.boris.expr.function.AbstractFunction; 9 | 10 | public class UPPER extends AbstractFunction 11 | { 12 | public Expr evaluate(Expr[] args) throws ExprException { 13 | assertArgCount(args, 1); 14 | Expr a = evalArg(args[0]); 15 | if (a instanceof ExprArray) 16 | return ExprError.VALUE; 17 | if (a instanceof ExprString) 18 | return new ExprString(((ExprString) a).str.toUpperCase()); 19 | return new ExprString(a.toString().toUpperCase()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/VALUE.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprArray; 5 | import org.boris.expr.ExprDouble; 6 | import org.boris.expr.ExprError; 7 | import org.boris.expr.ExprException; 8 | import org.boris.expr.function.AbstractFunction; 9 | import org.boris.expr.util.ValueParser; 10 | 11 | public class VALUE extends AbstractFunction 12 | { 13 | public Expr evaluate(Expr[] args) throws ExprException { 14 | assertArgCount(args, 1); 15 | Expr e = evalArg(args[0]); 16 | if (e instanceof ExprError) 17 | return e; 18 | if (e instanceof ExprArray) 19 | return ExprError.VALUE; 20 | 21 | String s = asString(e, false); 22 | Double d = ValueParser.parse(s); 23 | 24 | if (d != null) 25 | return new ExprDouble(d.doubleValue()); 26 | else 27 | return ExprError.VALUE; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/VAR.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.function.AbstractVarianceFunction; 4 | 5 | public class VAR extends AbstractVarianceFunction 6 | { 7 | public VAR() { 8 | super(false, false); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/VARA.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.function.AbstractVarianceFunction; 4 | 5 | public class VARA extends AbstractVarianceFunction 6 | { 7 | public VARA() { 8 | super(true, false); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/VARP.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.function.AbstractVarianceFunction; 4 | 5 | public class VARP extends AbstractVarianceFunction 6 | { 7 | public VARP() { 8 | super(false, true); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/VARPA.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.function.AbstractVarianceFunction; 4 | 5 | public class VARPA extends AbstractVarianceFunction 6 | { 7 | public VARPA() { 8 | super(true, true); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/VLOOKUP.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class VLOOKUP extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/WEEKDAY.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | import org.boris.expr.util.ExcelDate; 6 | 7 | public class WEEKDAY extends DoubleInOutFunction 8 | { 9 | protected double evaluate(double value) throws ExprException { 10 | return ExcelDate.getWeekday(value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/WEIBULL.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class WEIBULL extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/YEAR.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.ExprException; 4 | import org.boris.expr.function.DoubleInOutFunction; 5 | import org.boris.expr.util.ExcelDate; 6 | 7 | public class YEAR extends DoubleInOutFunction 8 | { 9 | protected double evaluate(double value) throws ExprException { 10 | return ExcelDate.getYear(value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/function/excel/ZTEST.java: -------------------------------------------------------------------------------- 1 | package org.boris.expr.function.excel; 2 | 3 | import org.boris.expr.Expr; 4 | import org.boris.expr.ExprException; 5 | import org.boris.expr.function.AbstractFunction; 6 | 7 | public class ZTEST extends AbstractFunction 8 | { 9 | public Expr evaluate(Expr[] args) throws ExprException { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/graph/GraphCycleException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr.graph; 11 | 12 | public class GraphCycleException extends Exception 13 | { 14 | public GraphCycleException() { 15 | } 16 | 17 | public GraphCycleException(String message) { 18 | super(message); 19 | } 20 | 21 | public GraphCycleException(Throwable cause) { 22 | super(cause); 23 | } 24 | 25 | public GraphCycleException(String message, Throwable cause) { 26 | super(message, cause); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/graph/GraphTraversalListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr.graph; 11 | 12 | public interface GraphTraversalListener 13 | { 14 | void traverse(N node); 15 | } 16 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/parser/IParserVisitor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr.parser; 11 | 12 | import org.boris.expr.ExprException; 13 | import org.boris.expr.ExprFunction; 14 | import org.boris.expr.ExprVariable; 15 | 16 | public interface IParserVisitor 17 | { 18 | void annotateVariable(ExprVariable variable) throws ExprException; 19 | 20 | void annotateFunction(ExprFunction function) throws ExprException; 21 | } 22 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/util/Counter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr.util; 11 | 12 | import org.boris.expr.Expr; 13 | 14 | public class Counter 15 | { 16 | public int count; 17 | public double value; 18 | public double value2; 19 | public double value3; 20 | public boolean doit = true; 21 | public Expr result; 22 | public int iteration; 23 | public boolean flag; 24 | public Object any; 25 | } 26 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/util/ValueFormatter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr.util; 11 | 12 | public class ValueFormatter 13 | { 14 | public static String format(double value, String format) { 15 | return null; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /org.boris.expr/java/src/org/boris/expr/util/ValueParser.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr.util; 11 | 12 | public class ValueParser 13 | { 14 | public static Double parse(String text) { 15 | return null; 16 | } 17 | 18 | public static Double parseDate(String text) { 19 | return null; 20 | } 21 | 22 | public static Double parseNumber(String text) { 23 | return null; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /org.boris.expr/java/test/org/boris/expr/DebugEngineListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | import org.boris.expr.engine.IEngineListener; 13 | 14 | public class DebugEngineListener implements IEngineListener 15 | { 16 | public void beforeCalculation(String name) { 17 | //System.out.printf("beforeCalculation: %s\n", name); 18 | } 19 | 20 | public void afterCalculation(String name, Expr value) { 21 | System.out.printf("afterCalculation: %s = %s\n", name, value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /org.boris.expr/java/test/org/boris/expr/ExcelTextFunctionsTest.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.expr/java/test/org/boris/expr/ExcelTextFunctionsTest.java -------------------------------------------------------------------------------- /org.boris.expr/java/test/org/boris/expr/GraphTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | import org.boris.expr.graph.Edge; 13 | import org.boris.expr.graph.Graph; 14 | 15 | public class GraphTest extends TH 16 | { 17 | public void testCheckCycle() throws Exception { 18 | Graph g = new Graph(); 19 | g.add(new Edge("a", "b")); 20 | g.add(new Edge("a", "c")); 21 | g.add(new Edge("b", "d")); 22 | g.add(new Edge("c", "d")); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /org.boris.expr/java/test/org/boris/expr/OptimizeTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | public class OptimizeTest extends TH 13 | { 14 | public void testOptimize1() throws Exception { 15 | Expr e,eo; 16 | e = parse("34+56/100"); 17 | eo = e.optimize(); 18 | assertTrue(e instanceof ExprEvaluatable); 19 | assertTrue(eo instanceof ExprDouble); 20 | e = parse("-1^2"); 21 | eo = e.optimize(); 22 | assertTrue(eo instanceof ExprDouble); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /org.boris.expr/java/test/org/boris/expr/ValueParserTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.expr; 11 | 12 | import org.boris.expr.util.ValueParser; 13 | 14 | public class ValueParserTest extends TH 15 | { 16 | public void testDates() throws Exception { 17 | assertEquals(ValueParser.parseDate("3/4/5"), 38415.); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /org.boris.expr/java/test/org/boris/expr/countif1.txt: -------------------------------------------------------------------------------- 1 | Data,Data 2 | apples,32 3 | oranges,54 4 | peaches,75 5 | apples,86 6 | -------------------------------------------------------------------------------- /org.boris.expr/java/test/org/boris/expr/db1-c.txt: -------------------------------------------------------------------------------- 1 | Tree,Height,Age,Yield,Profit,Height 2 | Apple,>10,,,,<16 3 | Pear,,,,, 4 | -------------------------------------------------------------------------------- /org.boris.expr/java/test/org/boris/expr/db1-d.txt: -------------------------------------------------------------------------------- 1 | Tree,Height,Age,Yield,Profit 2 | Apple,18,20,14,105 3 | Pear,12,12,10,96 4 | Cherry,13,14,9,105 5 | Apple,14,15,10,75 6 | Pear,9,8,8,76.8 7 | Apple,8,9,6,45 8 | -------------------------------------------------------------------------------- /org.boris.expr/java/test/org/boris/expr/db1.txt: -------------------------------------------------------------------------------- 1 | Tree,Height,Age,Yield,Profit,Height 2 | Apple,>10,,,,<16 3 | Pear,,,,, 4 | Tree,Height,Age,Yield,Profit, 5 | Apple,18,20,14,105, 6 | Pear,12,12,10,96, 7 | Cherry,13,14,9,105, 8 | Apple,14,15,10,75, 9 | Pear,9,8,8,76.8, 10 | Apple,8,9,6,45, 11 | -------------------------------------------------------------------------------- /org.boris.expr/java/test/org/boris/expr/index1.txt: -------------------------------------------------------------------------------- 1 | Fruit,Price,Count 2 | Apples,0.69,40 3 | Bananas,0.34,38 4 | Lemons,0.55,15 5 | Oranges,0.25,25 6 | Pears,0.59,40 7 | ,, 8 | Almonds,2.8,10 9 | Cashews,3.55,16 10 | Peanuts,1.25,20 11 | Walnuts,1.75,12 12 | -------------------------------------------------------------------------------- /org.boris.expr/java/test/org/boris/expr/lookup1.txt: -------------------------------------------------------------------------------- 1 | Frequency,Color 2 | 4.14,red 3 | 4.19,orange 4 | 5.17,yellow 5 | 5.77,green 6 | 6.39,blue 7 | -------------------------------------------------------------------------------- /org.boris.expr/site/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.expr/site/favicon.ico -------------------------------------------------------------------------------- /org.boris.expr/site/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.expr/site/logo.gif -------------------------------------------------------------------------------- /org.boris.jxll/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /org.boris.jxll/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | -------------------------------------------------------------------------------- /org.boris.jxll/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.boris.jxll 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.jdt.core.javanature 26 | org.eclipse.pde.PluginNature 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.boris.jxll/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Sat Apr 04 17:01:43 CST 2009 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.5 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.source=1.5 13 | -------------------------------------------------------------------------------- /org.boris.jxll/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: JXLL 4 | Bundle-SymbolicName: org.boris.jxll 5 | Bundle-Version: 0.0.2 6 | Export-Package: org.boris.jxll, 7 | org.boris.jxll.util 8 | Bundle-Vendor: Boris Inc. 9 | Bundle-RequiredExecutionEnvironment: J2SE-1.5 10 | Require-Bundle: org.junit 11 | -------------------------------------------------------------------------------- /org.boris.jxll/README: -------------------------------------------------------------------------------- 1 | JXLL - interact with C++ XLL addins via java. 2 | 3 | See http://jxll.sourceforge.net/ 4 | 5 | -------------------------------------------------------------------------------- /org.boris.jxll/build.properties: -------------------------------------------------------------------------------- 1 | source.. = java/src/,\ 2 | java/test/ 3 | bin.includes = META-INF/,\ 4 | . 5 | -------------------------------------------------------------------------------- /org.boris.jxll/java/src/org/boris/jxll/IXLLHost.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.jxll; 11 | 12 | 13 | public interface IXLLHost 14 | { 15 | int xlCallVer(); 16 | 17 | int excel4(int xlfn, XLOperHolder operRes, XLOper[] opers); 18 | } 19 | -------------------------------------------------------------------------------- /org.boris.jxll/java/src/org/boris/jxll/XLErrType.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.jxll; 11 | 12 | public class XLErrType 13 | { 14 | public static final int xlerrNull = 0; 15 | public static final int xlerrDiv0 = 7; 16 | public static final int xlerrValue = 15; 17 | public static final int xlerrRef = 23; 18 | public static final int xlerrName = 29; 19 | public static final int xlerrNum = 36; 20 | public static final int xlerrNA = 42; 21 | } 22 | -------------------------------------------------------------------------------- /org.boris.jxll/java/src/org/boris/jxll/XLLException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.jxll; 11 | 12 | public class XLLException extends Exception 13 | { 14 | public XLLException() { 15 | } 16 | 17 | public XLLException(String message, Throwable cause) { 18 | super(message, cause); 19 | } 20 | 21 | public XLLException(String message) { 22 | super(message); 23 | } 24 | 25 | public XLLException(Throwable cause) { 26 | super(cause); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /org.boris.jxll/java/src/org/boris/jxll/XLOperHolder.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.jxll; 11 | 12 | public class XLOperHolder 13 | { 14 | public XLOper value; 15 | } 16 | -------------------------------------------------------------------------------- /org.boris.jxll/java/src/org/boris/jxll/XLRef.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.jxll; 11 | 12 | public class XLRef 13 | { 14 | public int rwFirst; 15 | public int rwLast; 16 | public int colFirst; 17 | public int colLast; 18 | } 19 | -------------------------------------------------------------------------------- /org.boris.jxll/jni/.cvsignore: -------------------------------------------------------------------------------- 1 | *.ncb 2 | jxll.suo 3 | -------------------------------------------------------------------------------- /org.boris.jxll/jni/.gitignore: -------------------------------------------------------------------------------- 1 | /jxll.ncb 2 | /jxll.suo 3 | build/*.user 4 | -------------------------------------------------------------------------------- /org.boris.jxll/jni/build/.cvsignore: -------------------------------------------------------------------------------- 1 | *-Debug 2 | *-Release 3 | *.user 4 | -------------------------------------------------------------------------------- /org.boris.jxll/jni/lib/xlcall32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.jxll/jni/lib/xlcall32.lib -------------------------------------------------------------------------------- /org.boris.jxll/jni/src/JXLL.def: -------------------------------------------------------------------------------- 1 | LIBRARY "JXLL" 2 | 3 | EXPORTS 4 | Java_org_boris_jxll_JNI_loadLibrary 5 | Java_org_boris_jxll_JNI_dispose 6 | Java_org_boris_jxll_JNI_xlAutoOpen 7 | Java_org_boris_jxll_JNI_xlAddInManagerInfo 8 | Java_org_boris_jxll_JNI_invoke -------------------------------------------------------------------------------- /org.boris.jxll/jni/src/JXLL.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | 11 | #define WIN32_LEAN_MEAN 12 | #include 13 | 14 | 15 | -------------------------------------------------------------------------------- /org.boris.jxll/jni/src/TestXLL.def: -------------------------------------------------------------------------------- 1 | LIBRARY "TestXLL" 2 | 3 | EXPORTS 4 | xlAutoOpen 5 | xlAutoClose 6 | xlAutoRegister 7 | xlAutoAdd 8 | xlAutoRemove 9 | xlAutoFree 10 | xlAddInManagerInfo 11 | TestSum 12 | TestArgs 13 | TestChar 14 | -------------------------------------------------------------------------------- /org.boris.jxll/jni/src/TestXLL.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | 11 | #define WIN32_LEAN_MEAN 12 | #include 13 | #include "xlcall.h" 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /org.boris.jxll/jni/src/XLLstub.def: -------------------------------------------------------------------------------- 1 | LIBRARY "xlcall32" 2 | 3 | EXPORTS 4 | XLCallVer @1 5 | Excel4 @2 6 | Excel4v @3 7 | LPenHelper @4 8 | SetFunctionPointers @5 9 | -------------------------------------------------------------------------------- /org.boris.jxll/site/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.jxll/site/favicon.ico -------------------------------------------------------------------------------- /org.boris.jxll/site/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.jxll/site/logo.gif -------------------------------------------------------------------------------- /org.boris.jxll/site/others/expr4j.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.jxll/site/others/expr4j.gif -------------------------------------------------------------------------------- /org.boris.jxll/site/others/jvst.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.jxll/site/others/jvst.gif -------------------------------------------------------------------------------- /org.boris.jxll/site/others/jxll.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.jxll/site/others/jxll.gif -------------------------------------------------------------------------------- /org.boris.jxll/site/others/variantcodec.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.jxll/site/others/variantcodec.gif -------------------------------------------------------------------------------- /org.boris.jxll/site/others/winrun4j.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.jxll/site/others/winrun4j.gif -------------------------------------------------------------------------------- /org.boris.jxll/site/others/xlloop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.jxll/site/others/xlloop.gif -------------------------------------------------------------------------------- /org.boris.jxll/todo.txt: -------------------------------------------------------------------------------- 1 | 2 | - add more jni code to handle all xloper types in and out 3 | - clean up xloper resources 4 | - much more testing on xlls (need to search around for test targets) -------------------------------------------------------------------------------- /org.boris.xlloop/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | -------------------------------------------------------------------------------- /org.boris.xlloop/.pydevproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | python 2.6 6 | Default 7 | 8 | -------------------------------------------------------------------------------- /org.boris.xlloop/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Mon Feb 08 20:50:16 GMT 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.5 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.source=1.5 13 | -------------------------------------------------------------------------------- /org.boris.xlloop/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: XLLoop 4 | Bundle-SymbolicName: org.boris.xlloop 5 | Bundle-Version: 0.2.0 6 | Export-Package: org.boris.xlloop, 7 | org.boris.xlloop.codec, 8 | org.boris.xlloop.handler, 9 | org.boris.xlloop.reflect, 10 | org.boris.xlloop.util, 11 | org.boris.xlloop.xloper 12 | Bundle-Vendor: Boris Inc. 13 | Bundle-RequiredExecutionEnvironment: J2SE-1.5 14 | Import-Package: org.boris.jxll 15 | -------------------------------------------------------------------------------- /org.boris.xlloop/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | java/src/,\ 3 | java/test/,\ 4 | . 5 | source.. = java/src/,\ 6 | java/test/ 7 | src.includes = java/src/,\ 8 | java/test/ 9 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/IFunction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop; 11 | 12 | import org.boris.xlloop.xloper.XLoper; 13 | 14 | public interface IFunction 15 | { 16 | XLoper execute(IFunctionContext context, XLoper[] args) throws RequestException; 17 | } 18 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/IFunctionContext.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop; 11 | 12 | import org.boris.xlloop.xloper.XLSRef; 13 | import org.boris.xlloop.xloper.XLoper; 14 | 15 | public interface IFunctionContext 16 | { 17 | String getUser(); 18 | 19 | String getHost(); 20 | 21 | String getUserKey(); 22 | 23 | XLSRef getCaller(); 24 | 25 | String getSheetName(); 26 | 27 | XLoper execute(String name, XLoper[] args) throws RequestException; 28 | } 29 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/IFunctionHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop; 11 | 12 | import org.boris.xlloop.xloper.XLoper; 13 | 14 | public interface IFunctionHandler 15 | { 16 | XLoper execute(IFunctionContext context, String name, XLoper[] args) throws RequestException; 17 | 18 | boolean hasFunction(String name); 19 | } 20 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/IFunctionServerListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop; 11 | 12 | import org.boris.xlloop.FunctionServer.HandlerThread; 13 | 14 | public interface IFunctionServerListener 15 | { 16 | void connectionCreated(HandlerThread ht); 17 | } 18 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/IRequestProtocol.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop; 11 | 12 | import java.io.IOException; 13 | import java.net.Socket; 14 | 15 | import org.boris.xlloop.xloper.XLoper; 16 | 17 | public interface IRequestProtocol 18 | { 19 | public void initialise(Socket socket) throws IOException; 20 | 21 | public void send(Socket socket, XLoper data) throws IOException; 22 | 23 | public XLoper receive(Socket socket) throws IOException; 24 | } -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/command/CommandResult.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop.command; 11 | 12 | import org.boris.xlloop.xloper.XLString; 13 | import org.boris.xlloop.xloper.XLoper; 14 | 15 | public class CommandResult 16 | { 17 | public XLoper toXLoper() { 18 | return new XLString("command result testing"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/handler/FunctionProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop.handler; 11 | 12 | public interface FunctionProvider 13 | { 14 | FunctionInformation[] getFunctions(); 15 | } 16 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/menu/IMenuProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop.menu; 11 | 12 | import org.boris.xlloop.command.CommandResult; 13 | 14 | public interface IMenuProvider 15 | { 16 | Menu getMenu(); 17 | 18 | CommandResult execute(String item, String submenu); 19 | } 20 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/menu/MenuItem.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop.menu; 11 | 12 | public class MenuItem 13 | { 14 | public static final MenuItem SEPARATOR = new MenuItem("-"); 15 | 16 | private String name; 17 | 18 | public MenuItem(String name) { 19 | this.name = name; 20 | } 21 | 22 | public String getName() { 23 | return name; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/script/ScriptFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop.script; 11 | 12 | import java.io.IOException; 13 | import java.io.Reader; 14 | 15 | import org.boris.xlloop.IFunction; 16 | 17 | public interface ScriptFactory 18 | { 19 | public IFunction create(Reader r) throws IOException; 20 | } 21 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/util/math.csv: -------------------------------------------------------------------------------- 1 | name,help,category,shortcut,topic,isVolatile,arg1,argHelp1,arg2,argHelp2... 2 | Math.sin,Returns the trigonometric sine of an angle,Math & Trig,,,FALSE,a,"an angle, in radians",, 3 | Math.cos,Returns the trigonometric cosine of an angle,Math & Trig,,,FALSE,a,"an angle, in radians",, 4 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/xloper/XLBool.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop.xloper; 11 | 12 | public class XLBool extends XLoper 13 | { 14 | public static final XLBool TRUE = new XLBool(true); 15 | public static final XLBool FALSE = new XLBool(false); 16 | 17 | public final boolean bool; 18 | 19 | public XLBool(boolean bool) { 20 | super(xlTypeBool); 21 | this.bool = bool; 22 | } 23 | 24 | public String toString() { 25 | return Boolean.toString(bool); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/xloper/XLInt.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop.xloper; 11 | 12 | public class XLInt extends XLoper 13 | { 14 | public final int w; 15 | 16 | public XLInt(int w) { 17 | super(xlTypeInt); 18 | this.w = w; 19 | } 20 | 21 | public String toString() { 22 | return Integer.toString(w); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/xloper/XLMissing.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop.xloper; 11 | 12 | public class XLMissing extends XLoper 13 | { 14 | public static final XLMissing MISSING = new XLMissing(); 15 | 16 | XLMissing() { 17 | super(xlTypeMissing); 18 | } 19 | 20 | public String toString() { 21 | return ""; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/xloper/XLNil.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop.xloper; 11 | 12 | public class XLNil extends XLoper 13 | { 14 | public static XLNil NIL = new XLNil(); 15 | 16 | private XLNil() { 17 | super(xlTypeNil); 18 | } 19 | 20 | public String toString() { 21 | return ""; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/src/org/boris/xlloop/xloper/XLNum.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop.xloper; 11 | 12 | public final class XLNum extends XLoper 13 | { 14 | public final double num; 15 | 16 | public XLNum(double num) { 17 | super(xlTypeNum); 18 | this.num = num; 19 | } 20 | 21 | public String toString() { 22 | return Double.toString(num); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/test/org/boris/xlloop/AnnotationsTest.java: -------------------------------------------------------------------------------- 1 | package org.boris.xlloop; 2 | 3 | import java.io.File; 4 | 5 | import org.boris.xlloop.reflect.XLFunction; 6 | 7 | public class AnnotationsTest 8 | { 9 | @XLFunction(name = "ListFiles", 10 | help = "List the files contained within a directory", 11 | args = { "dir" }, 12 | argHelp = { "The directory" }, 13 | category = "Files") 14 | public static String[] listFiles(String dir) { 15 | return new File(dir).list(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/test/org/boris/xlloop/EchoHandler.java: -------------------------------------------------------------------------------- 1 | package org.boris.xlloop; 2 | 3 | import org.boris.xlloop.util.XLList; 4 | import org.boris.xlloop.xloper.XLoper; 5 | 6 | public class EchoHandler implements IFunctionHandler 7 | { 8 | private int count; 9 | 10 | public XLoper execute(IFunctionContext context, String name, XLoper[] args) throws RequestException { 11 | XLList l = new XLList(args); 12 | l.add(++count); 13 | return l.toXLoper(); 14 | } 15 | 16 | public boolean hasFunction(String name) { 17 | return true; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/test/org/boris/xlloop/ExecuteHandler.java: -------------------------------------------------------------------------------- 1 | package org.boris.xlloop; 2 | 3 | import org.boris.xlloop.util.XLMap; 4 | import org.boris.xlloop.xloper.XLoper; 5 | 6 | public class ExecuteHandler implements IFunctionHandler 7 | { 8 | public XLoper execute(IFunctionContext context, String name, XLoper[] args) throws RequestException { 9 | System.out.println(name + args); 10 | 11 | if (args.length > 0) { 12 | return args[0]; 13 | } 14 | 15 | XLMap s = new XLMap(); 16 | s.add("hello there", 123213); 17 | s.add("asdf", "woeiruewoir"); 18 | return s.toXloper(); 19 | } 20 | 21 | public boolean hasFunction(String name) { 22 | return true; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/test/org/boris/xlloop/FunctionInformationTest.java: -------------------------------------------------------------------------------- 1 | package org.boris.xlloop; 2 | 3 | import org.boris.xlloop.handler.FunctionInformation; 4 | 5 | public class FunctionInformationTest 6 | { 7 | public static void main(String[] args) { 8 | FunctionInformation fi = new FunctionInformation("Math.pow"); 9 | fi.setFunctionHelp("Raises the first value to the power of the second"); 10 | fi.setCategory("Maths"); 11 | fi.addArgument("value", "The first value"); 12 | fi.addArgument("power", "The power value"); 13 | System.out.println(fi.encode()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/test/org/boris/xlloop/MakeList.java: -------------------------------------------------------------------------------- 1 | package org.boris.xlloop; 2 | 3 | public class MakeList 4 | { 5 | public static void main(String[] args) throws Exception { 6 | for (int i = 0; i < 512; i++) { 7 | System.out.println("\tFS" + i + " @" + (10 + i)); 8 | // System.out.println("DECLARE_EXCEL_FUNCTION(" + i + ")"); 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/test/org/boris/xlloop/ParameterNameExtractorTest.java: -------------------------------------------------------------------------------- 1 | package org.boris.xlloop; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | import org.boris.xlloop.reflect.ParameterNameExtractor; 6 | import org.boris.xlloop.util.CSV; 7 | 8 | public class ParameterNameExtractorTest 9 | { 10 | public static void main(String[] args) throws Exception { 11 | Class clazz = CSV.class; 12 | ParameterNameExtractor pne = new ParameterNameExtractor(clazz); 13 | Method[] m = clazz.getMethods(); 14 | for(int i = 0; i < m.length; i++) { 15 | if(m[i].getDeclaringClass().equals(clazz)) 16 | System.out.println(m[i].getName() + "(" + CSV.toCSV(pne.getParameterNames(m[i])) + ")"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/test/org/boris/xlloop/ScriptRepTest1.java: -------------------------------------------------------------------------------- 1 | package org.boris.xlloop; 2 | 3 | import java.io.File; 4 | 5 | import org.boris.xlloop.script.ScriptRepository; 6 | import org.boris.xlloop.util.XLList; 7 | import org.boris.xlloop.xloper.XLoper; 8 | 9 | public class ScriptRepTest1 10 | { 11 | public static void main(String[] args) throws Exception { 12 | ScriptRepository rep = new ScriptRepository(new File( 13 | "F:\\eclipse\\workspace\\org.boris.functionserver\\functions"), "Script."); 14 | 15 | Thread.sleep(1000); 16 | 17 | XLList a = new XLList(); 18 | a.add(4); 19 | a.add(4.5); 20 | XLoper res = rep.execute(null, "Script.sum", a.toArray()); 21 | System.out.println(res); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/test/org/boris/xlloop/ScriptTest1.java: -------------------------------------------------------------------------------- 1 | package org.boris.xlloop; 2 | 3 | import java.io.FileReader; 4 | 5 | import org.mozilla.javascript.Context; 6 | import org.mozilla.javascript.Script; 7 | import org.mozilla.javascript.Scriptable; 8 | import org.mozilla.javascript.ScriptableObject; 9 | 10 | public class ScriptTest1 { 11 | public static void main(String[] args) throws Exception { 12 | //VTCollection input = new VTCollection(); 13 | Object[] input = {new Integer(4), new Integer(5)}; 14 | Context cx = Context.enter(); 15 | Scriptable scope = cx.initStandardObjects(); 16 | Script sc = cx.compileReader(new FileReader("functions/sum.js"), "sum", 17 | 1, null); 18 | ScriptableObject.putProperty(scope, "args", Context.javaToJS(input, scope)); 19 | Object o = sc.exec(cx, scope); 20 | System.out.println(o); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/test/org/boris/xlloop/Threads.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop; 11 | 12 | public class Threads 13 | { 14 | public static void sleep(long ms) { 15 | try { 16 | Thread.sleep(ms); 17 | } catch (InterruptedException e) { 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/test/org/boris/xlloop/function_info1.csv: -------------------------------------------------------------------------------- 1 | name,help,category,shortcut,topic,isVolatile,arg1,argHelp1,arg2,argHelp2... 2 | Math.sin,Returns the trigonometric sine of an angle,Math & Trig,,,FALSE,a,"an angle, in radians",, 3 | Math.cos,Returns the trigonometric cosine of an angle,Math & Trig,,,FALSE,a,"an angle, in radians",, 4 | -------------------------------------------------------------------------------- /org.boris.xlloop/java/test/org/boris/xlloop/http/ServletHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | package org.boris.xlloop.http; 11 | 12 | public class ServletHandler 13 | { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /org.boris.xlloop/lib/bsf-src.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/lib/bsf-src.zip -------------------------------------------------------------------------------- /org.boris.xlloop/lib/bsf.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/lib/bsf.jar -------------------------------------------------------------------------------- /org.boris.xlloop/lib/commons-logging-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/lib/commons-logging-1.1.1.jar -------------------------------------------------------------------------------- /org.boris.xlloop/lib/jatha-2.8-src.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/lib/jatha-2.8-src.jar -------------------------------------------------------------------------------- /org.boris.xlloop/lib/jatha-2.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/lib/jatha-2.8.jar -------------------------------------------------------------------------------- /org.boris.xlloop/lib/js-src.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/lib/js-src.zip -------------------------------------------------------------------------------- /org.boris.xlloop/lib/js.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/lib/js.jar -------------------------------------------------------------------------------- /org.boris.xlloop/lib/json-src.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/lib/json-src.jar -------------------------------------------------------------------------------- /org.boris.xlloop/lib/json.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/lib/json.jar -------------------------------------------------------------------------------- /org.boris.xlloop/lib/rupy-0.3.3-src.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/lib/rupy-0.3.3-src.zip -------------------------------------------------------------------------------- /org.boris.xlloop/lib/rupy-0.3.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/lib/rupy-0.3.3.jar -------------------------------------------------------------------------------- /org.boris.xlloop/lib/servlet-api-2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/lib/servlet-api-2.5.jar -------------------------------------------------------------------------------- /org.boris.xlloop/servers/bsf/linint.js: -------------------------------------------------------------------------------- 1 | var x = Number(args[2]); 2 | var res = 0; 3 | var xl = args[0].length; 4 | 5 | if(xl == 0) { 6 | res = "#Invalid args"; 7 | } else if(xl == 1) { 8 | res = args[1][0]; 9 | } else if(x < args[0][0]) { 10 | var dy = args[1][1] - args[1][0]; 11 | var dx = args[0][1] - args[0][0]; 12 | res = args[1][0] - (args[0][0] - x) * (dy/dx); 13 | } else if(x > Number(args[0][xl - 1])) { 14 | var dy = args[1][xl - 1] - args[1][xl - 2]; 15 | var dx = args[0][xl - 1] - args[0][xl - 2]; 16 | res = (x - args[0][xl - 1]) * (dy/dx) + Number(args[1][xl - 1]); 17 | } else { 18 | for(var i = 0; i < xl; i++) { 19 | if(i > 0 && args[0][i] >= x) { 20 | var dy = args[1][i] - args[1][i - 1]; 21 | var dx = args[0][i] - args[0][i - 1]; 22 | res = (x - args[0][i - 1]) * (dy/dx) + Number(args[1][i - 1]); 23 | break; 24 | } 25 | } 26 | } 27 | 28 | res; -------------------------------------------------------------------------------- /org.boris.xlloop/servers/bsf/linint.vc: -------------------------------------------------------------------------------- 1 | { 2 | functionHelp="Performs a linear interpolation"; 3 | category="Maths"; 4 | arguments=[ 5 | { 6 | name="x-series"; 7 | help="The X axis series"; 8 | }, 9 | { 10 | name="y-series"; 11 | help="The Y axis series"; 12 | }, 13 | { 14 | name="x-value"; 15 | help="The X value"; 16 | } 17 | ]; 18 | } -------------------------------------------------------------------------------- /org.boris.xlloop/servers/bsf/mult.js: -------------------------------------------------------------------------------- 1 | args[0] * args[1]; -------------------------------------------------------------------------------- /org.boris.xlloop/servers/bsf/mult.vc: -------------------------------------------------------------------------------- 1 | { 2 | functionHelp="Multiples two numbers"; 3 | category="Maths"; 4 | arguments=[ 5 | { 6 | name="value1"; 7 | help="The first value"; 8 | }, 9 | { 10 | name="value2"; 11 | help="The second value"; 12 | } 13 | ]; 14 | } -------------------------------------------------------------------------------- /org.boris.xlloop/servers/bsf/sum-list.lisp: -------------------------------------------------------------------------------- 1 | (defun sum-list (list) 2 | (if list 3 | (+ (car list) (sum-list (cdr list))) 4 | 0)) 5 | -------------------------------------------------------------------------------- /org.boris.xlloop/servers/bsf/sum.js: -------------------------------------------------------------------------------- 1 | Number(args[0]) + Number(args[1]) -------------------------------------------------------------------------------- /org.boris.xlloop/servers/bsf/sum.vc: -------------------------------------------------------------------------------- 1 | { 2 | functionHelp="Sums two numbers"; 3 | category="Maths"; 4 | arguments=[ 5 | { 6 | name="value1"; 7 | help="The first value"; 8 | }, 9 | { 10 | name="value2"; 11 | help="The second value"; 12 | } 13 | ]; 14 | } -------------------------------------------------------------------------------- /org.boris.xlloop/servers/c++/XLLServer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/servers/c++/XLLServer.exe -------------------------------------------------------------------------------- /org.boris.xlloop/servers/c++/XLLServer.ini: -------------------------------------------------------------------------------- 1 | # WinRun4J args 2 | main.class=org.boris.xlloop.util.XLLServer 3 | classpath.1=*.jar 4 | log.level=none 5 | -------------------------------------------------------------------------------- /org.boris.xlloop/servers/c++/jxll-0.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/servers/c++/jxll-0.0.2.jar -------------------------------------------------------------------------------- /org.boris.xlloop/servers/csharp/ReflectFunctionHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace XLLoop 6 | { 7 | class ReflectFunctionHandler : FunctionHandler 8 | { 9 | public XLoper Execute(String name, XLoper[] args) 10 | { 11 | XLoper x = new XLoper(); 12 | x.Type = XLoper.xlTypeNil; 13 | 14 | return x; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /org.boris.xlloop/servers/erlang/.cvsignore: -------------------------------------------------------------------------------- 1 | *.beam 2 | -------------------------------------------------------------------------------- /org.boris.xlloop/servers/erlang/erlang.txt: -------------------------------------------------------------------------------- 1 | info on how to run/test the server 2 | 3 | - Fire up Erlang emulator 4 | 5 | 11> cd ("F:/eclipse/workspace/org.boris.xlloop/servers/erlang"). 6 | 7 | -------------------------------------------------------------------------------- /org.boris.xlloop/servers/erlang/server_example.erl: -------------------------------------------------------------------------------- 1 | -module(server_example). 2 | -export([start/0, stop/0, function/3]). 3 | -behaviour(xlloop_server). 4 | -define(PORT, 5454). 5 | 6 | start() -> 7 | Pid = xlloop_server:start(?PORT, ?MODULE), 8 | register(server_example_pid, Pid). 9 | 10 | stop() -> 11 | server_example_pid ! stop. 12 | 13 | function(_Context, _Name, _Args) -> 14 | {str, "Hello World!"}. 15 | 16 | -------------------------------------------------------------------------------- /org.boris.xlloop/servers/java/ServerExample.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/servers/java/ServerExample.exe -------------------------------------------------------------------------------- /org.boris.xlloop/servers/java/ServerExample.ini: -------------------------------------------------------------------------------- 1 | # WinRun4J args 2 | main.class=org.boris.xlloop.util.ServerExample 3 | classpath.1=*.jar 4 | log.level=none 5 | -------------------------------------------------------------------------------- /org.boris.xlloop/servers/lua/.gitignore: -------------------------------------------------------------------------------- 1 | /binarycodec.luac 2 | /test1.luac 3 | -------------------------------------------------------------------------------- /org.boris.xlloop/servers/lua/client_example.lua: -------------------------------------------------------------------------------- 1 | 2 | local socket = require("socket") 3 | local codec = require("binarycodec") 4 | local xlloop = require("xlloop") 5 | require("base") 6 | 7 | local test = function( client, name, args ) 8 | local res = xlloop.invoke( client, name, args ) 9 | print( prettytostring( res ) ) 10 | 11 | end 12 | 13 | local client = socket.connect("127.0.0.1", 5454) 14 | args = { "hello2", { 345, -12, 0.0004, true, false, { 777 } } } 15 | test( client, "ArgsTest", args ) 16 | test( client, "BasicTypes", args ) 17 | for i = 1, 10 do 18 | test( client, "RandTest", {} ) 19 | end 20 | test( client, "Test222", { string.rep( "asdf", 100 ) } ) 21 | client:close() 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /org.boris.xlloop/servers/lua/server_example.lua: -------------------------------------------------------------------------------- 1 | 2 | local xlloop = require( "xlloop" ) 3 | 4 | local fns = {} 5 | 6 | function fns.echo(...) 7 | return {...} 8 | end 9 | 10 | xlloop.server(fns, 5454) 11 | -------------------------------------------------------------------------------- /org.boris.xlloop/servers/php/TestServer.php: -------------------------------------------------------------------------------- 1 | array); 41 | for($j = 0; $j < $c; $j++) { 42 | $result += Sum($arg->array[$j]); 43 | } 44 | } 45 | } 46 | return $result; 47 | } 48 | 49 | XLLoop_Reflection_Handler(); 50 | 51 | ?> 52 | -------------------------------------------------------------------------------- /org.boris.xlloop/servers/python/.cvsignore: -------------------------------------------------------------------------------- 1 | *.class 2 | -------------------------------------------------------------------------------- /org.boris.xlloop/servers/python/reflect-example.py: -------------------------------------------------------------------------------- 1 | 2 | import xlloop 3 | 4 | # All arguments to expose are optional. Could use '@expose()' instead. 5 | @xlloop.expose( 6 | excel_name='py_sum', 7 | arg_descrs=['arr is a range of numbers to sum'] 8 | ) 9 | def test_sum(arr): 10 | 'Returns the summation of arr' 11 | return sum(arr) 12 | 13 | xlloop.run(5460) -------------------------------------------------------------------------------- /org.boris.xlloop/servers/r/r.bat: -------------------------------------------------------------------------------- 1 | "f:\Program Files\R\R-2.9.0\bin\R.exe" %* -------------------------------------------------------------------------------- /org.boris.xlloop/servers/ruby/reflect-server.rb: -------------------------------------------------------------------------------- 1 | require "xlloop" 2 | 3 | class MyFuncs 4 | def sum(*a) 5 | a.flatten.compact.inject(0) { |b,i| b+i } 6 | end 7 | 8 | def product(a,b) 9 | a*b 10 | end 11 | end 12 | 13 | h = ReflectionHandler.new 14 | h.push(MyFuncs.new, "MyFuncs.") 15 | f = XLLoopServer.new(h) 16 | f.start -------------------------------------------------------------------------------- /org.boris.xlloop/site/busy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/site/busy.gif -------------------------------------------------------------------------------- /org.boris.xlloop/site/diag.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/site/diag.gif -------------------------------------------------------------------------------- /org.boris.xlloop/site/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/site/favicon.ico -------------------------------------------------------------------------------- /org.boris.xlloop/site/functioninfo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/site/functioninfo.gif -------------------------------------------------------------------------------- /org.boris.xlloop/site/lisp1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/site/lisp1.jpg -------------------------------------------------------------------------------- /org.boris.xlloop/site/lisp2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/site/lisp2.jpg -------------------------------------------------------------------------------- /org.boris.xlloop/site/lisp3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/site/lisp3.jpg -------------------------------------------------------------------------------- /org.boris.xlloop/site/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/site/logo.gif -------------------------------------------------------------------------------- /org.boris.xlloop/site/others/expr4j.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/site/others/expr4j.gif -------------------------------------------------------------------------------- /org.boris.xlloop/site/others/jvst.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/site/others/jvst.gif -------------------------------------------------------------------------------- /org.boris.xlloop/site/others/jxll.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/site/others/jxll.gif -------------------------------------------------------------------------------- /org.boris.xlloop/site/others/variantcodec.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/site/others/variantcodec.gif -------------------------------------------------------------------------------- /org.boris.xlloop/site/others/winrun4j.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/site/others/winrun4j.gif -------------------------------------------------------------------------------- /org.boris.xlloop/site/others/xlloop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/org.boris.xlloop/site/others/xlloop.gif -------------------------------------------------------------------------------- /org.boris.xlloop/site/relnotes.txt: -------------------------------------------------------------------------------- 1 | 0.0.7 2 | - added help text to scripts 3 | - added CSV functions to example 4 | - added reflection functions to example 5 | - added javascript handler that compiles scripts 6 | 7 | 8 | 9 | TODO 10 | ? add better ruby and python script handling 11 | ? add webservice handler 12 | 13 | * add refresh function list command to xll (can't be done i think) 14 | * could add function to refresh function list? 15 | -------------------------------------------------------------------------------- /org.boris.xlloop/test/embed-ini.cmd: -------------------------------------------------------------------------------- 1 | "F:\eclipse\workspace\WinRun4J\build\ResourceEditor-Debug - Console\ResourceEditor.exe" /N F:\eclipse\workspace\WinRun4J\build\XLLoop-Debug\XLLoop-Debug.xll F:\eclipse\workspace\org.boris.xlloop\test\embed.ini 2 | pause 3 | -------------------------------------------------------------------------------- /org.boris.xlloop/test/embed.ini: -------------------------------------------------------------------------------- 1 | protocol=http 2 | url=https://xlloop.appspot.com/functionserver 3 | addin.name=XLLoop.appspot.com v0.2.0 4 | -------------------------------------------------------------------------------- /org.boris.xlloop/test/make-release-xll.cmd: -------------------------------------------------------------------------------- 1 | set VER=0.1.0 2 | copy F:\eclipse\workspace\WinRun4J\build\XLLoop-Release\XLLoop.xll F:\Development\Releases\xlloop.appspot.com-%VER%.xll 3 | "F:\eclipse\workspace\WinRun4J\build\ResourceEditor-Release - Console\ResourceEditor.exe" /N F:\Development\Releases\xlloop.appspot.com-%VER%.xll F:\eclipse\workspace\org.boris.xlloop\test\embed.ini 4 | pause 5 | 6 | 7 | -------------------------------------------------------------------------------- /xlloop-addin/.cvsignore: -------------------------------------------------------------------------------- 1 | WinRun4J.suo 2 | WinRun4J.ncb 3 | -------------------------------------------------------------------------------- /xlloop-addin/.gitignore: -------------------------------------------------------------------------------- 1 | /XLLoop.ncb 2 | /XLLoop.suo 3 | -------------------------------------------------------------------------------- /xlloop-addin/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | xlloop-addin 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /xlloop-addin/XLLoop.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XLLoop", "build\XLLoop.vcproj", "{930CC50F-F2EF-486E-BDDB-9B6867177A4C}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {930CC50F-F2EF-486E-BDDB-9B6867177A4C}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {930CC50F-F2EF-486E-BDDB-9B6867177A4C}.Debug|Win32.Build.0 = Debug|Win32 14 | {930CC50F-F2EF-486E-BDDB-9B6867177A4C}.Release|Win32.ActiveCfg = Release|Win32 15 | {930CC50F-F2EF-486E-BDDB-9B6867177A4C}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /xlloop-addin/build/.cvsignore: -------------------------------------------------------------------------------- 1 | ResourceEditor-Debug?-?Console 2 | ResourceEditor-Debug?-?Console-x64 3 | ResourceEditor-Release?-?Console 4 | ResourceEditor-Release?-?Console-x64 5 | WinRun4J-Debug 6 | WinRun4J-Debug?-?Console 7 | WinRun4J-Debug?-?Console-x64 8 | WinRun4J-Debug-x64 9 | WinRun4J-Release 10 | WinRun4J-Release?-?Console 11 | WinRun4J-Release?-?Console-x64 12 | WinRun4J-Release-x64 13 | XLLoop-Release 14 | XLLoop-Debug 15 | XLLoop.vcproj.Poida-PC.Poida.user 16 | WinRun4J.vcproj.Poida-PC.Poida.user 17 | ResourceEditor.vcproj.Poida-PC.Poida.user 18 | ResourceEditor.vcproj.BEAST.Poida.user 19 | WinRun4J.vcproj.BEAST.Poida.user 20 | XLLoop.vcproj.BEAST.Poida.user 21 | WinRun4J.aps 22 | -------------------------------------------------------------------------------- /xlloop-addin/build/.gitignore: -------------------------------------------------------------------------------- 1 | /XLLoop-Debug 2 | /XLLoop-Release 3 | /XLLoop.vcproj.BEAST.Poida.user 4 | -------------------------------------------------------------------------------- /xlloop-addin/lib/BufferOverflowU.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/lib/BufferOverflowU.lib -------------------------------------------------------------------------------- /xlloop-addin/lib/msvcrt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/lib/msvcrt.lib -------------------------------------------------------------------------------- /xlloop-addin/lib/xlcall32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/lib/xlcall32.lib -------------------------------------------------------------------------------- /xlloop-addin/lib/yajl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/lib/yajl.lib -------------------------------------------------------------------------------- /xlloop-addin/resources/spinner1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/resources/spinner1.gif -------------------------------------------------------------------------------- /xlloop-addin/resources/spinner10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/resources/spinner10.gif -------------------------------------------------------------------------------- /xlloop-addin/resources/spinner11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/resources/spinner11.gif -------------------------------------------------------------------------------- /xlloop-addin/resources/spinner12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/resources/spinner12.gif -------------------------------------------------------------------------------- /xlloop-addin/resources/spinner2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/resources/spinner2.gif -------------------------------------------------------------------------------- /xlloop-addin/resources/spinner3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/resources/spinner3.gif -------------------------------------------------------------------------------- /xlloop-addin/resources/spinner4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/resources/spinner4.gif -------------------------------------------------------------------------------- /xlloop-addin/resources/spinner5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/resources/spinner5.gif -------------------------------------------------------------------------------- /xlloop-addin/resources/spinner6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/resources/spinner6.gif -------------------------------------------------------------------------------- /xlloop-addin/resources/spinner7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/resources/spinner7.gif -------------------------------------------------------------------------------- /xlloop-addin/resources/spinner8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/resources/spinner8.gif -------------------------------------------------------------------------------- /xlloop-addin/resources/spinner9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/resources/spinner9.gif -------------------------------------------------------------------------------- /xlloop-addin/src/XLLoop.rc: -------------------------------------------------------------------------------- 1 | 2 | #include "afxres.h" 3 | 4 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 5 | 6 | 1 689 "../resources/spinner1.gif" 7 | 2 689 "../resources/spinner2.gif" 8 | 3 689 "../resources/spinner3.gif" 9 | 4 689 "../resources/spinner4.gif" 10 | 5 689 "../resources/spinner5.gif" 11 | 6 689 "../resources/spinner6.gif" 12 | 7 689 "../resources/spinner7.gif" 13 | 8 689 "../resources/spinner8.gif" 14 | 9 689 "../resources/spinner9.gif" 15 | 10 689 "../resources/spinner10.gif" 16 | 11 689 "../resources/spinner11.gif" 17 | 12 689 "../resources/spinner12.gif" 18 | -------------------------------------------------------------------------------- /xlloop-addin/src/xll/SheetGenerator.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * This program and the accompanying materials 3 | * are made available under the terms of the Common Public License v1.0 4 | * which accompanies this distribution, and is available at 5 | * http://www.eclipse.org/legal/cpl-v10.html 6 | * 7 | * Contributors: 8 | * Peter Smith 9 | *******************************************************************************/ 10 | 11 | #ifndef SHEET_GENERATOR_H 12 | #define SHEET_GENERATOR_H 13 | 14 | #include "windows.h" 15 | #include "BinaryProtocol.h" 16 | 17 | class SheetGenerator { 18 | public: 19 | static void Register(LPXLOPER xllName, Protocol* protocol, dictionary* ini); 20 | static void Execute(Protocol* protocol, const char* name); 21 | }; 22 | 23 | #endif // SHEET_GENERATOR_H -------------------------------------------------------------------------------- /xlloop-addin/test/FSTest.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/test/FSTest.xls -------------------------------------------------------------------------------- /xlloop-addin/test/XLLoop-Error.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/test/XLLoop-Error.ico -------------------------------------------------------------------------------- /xlloop-addin/test/XLLoop-Warning.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/test/XLLoop-Warning.ico -------------------------------------------------------------------------------- /xlloop-addin/test/XLLoop.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xlloop-addin/test/XLLoop.ico -------------------------------------------------------------------------------- /xllua/.gitignore: -------------------------------------------------------------------------------- 1 | /XLLua.ncb 2 | /XLLua.suo 3 | -------------------------------------------------------------------------------- /xllua/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | xllua-addin 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /xllua/TODO: -------------------------------------------------------------------------------- 1 | - add a 'set_option' function to allow customization of addin behaviour 2 | - registration details of LF, LFv functions 3 | - debug logging 4 | - automatic conversion to tables (might want to allow enabling per LuaF0) -------------------------------------------------------------------------------- /xllua/XLLua.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XLLua", "build\XLLua.vcproj", "{930CC50F-F2EF-486E-BDDB-9B6867177A4D}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {930CC50F-F2EF-486E-BDDB-9B6867177A4D}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {930CC50F-F2EF-486E-BDDB-9B6867177A4D}.Debug|Win32.Build.0 = Debug|Win32 14 | {930CC50F-F2EF-486E-BDDB-9B6867177A4D}.Release|Win32.ActiveCfg = Release|Win32 15 | {930CC50F-F2EF-486E-BDDB-9B6867177A4D}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /xllua/build/.gitignore: -------------------------------------------------------------------------------- 1 | /XLLua.vcproj.BEAST.Poida.user 2 | /XLLua-Release 3 | -------------------------------------------------------------------------------- /xllua/build/XLLua-Debug/.gitignore: -------------------------------------------------------------------------------- 1 | /BuildLog.htm 2 | /vc80.idb 3 | /vc80.pdb 4 | /XLLua-Debug.exp 5 | /XLLua-Debug.ilk 6 | /XLLua-Debug.lib 7 | /XLLua-Debug.map 8 | /XLLua-Debug.pdb 9 | /XLLua.obj 10 | /XLLua.res 11 | /XLLua-Debug.xll 12 | /redis.lua 13 | /XLLua-Debug.lua 14 | -------------------------------------------------------------------------------- /xllua/build/XLLua-Debug/XLLua-Debug.lua: -------------------------------------------------------------------------------- 1 | --[[ *************************************************************************** 2 | * 3 | * This program and the accompanying materials 4 | * are made available under the terms of the Common Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/cpl-v10.html 7 | * 8 | * Contributors: 9 | * Peter Smith 10 | ******************************************************************************]] 11 | 12 | package.path = "../src/?.lua;" .. package.path 13 | 14 | local f, error = loadfile( "addins.lua" ) 15 | if f ~= nil then 16 | local res, err = pcall( f ) 17 | if not res then 18 | xllua.debug_printf( "error: %s\n", stringit( err ) ) 19 | end 20 | else 21 | xllua.debug_printf( "error: %s\n", error ) 22 | end 23 | -------------------------------------------------------------------------------- /xllua/examples/addins.lua: -------------------------------------------------------------------------------- 1 | --[[ *************************************************************************** 2 | * 3 | * This program and the accompanying materials 4 | * are made available under the terms of the Common Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/cpl-v10.html 7 | * 8 | * Contributors: 9 | * Peter Smith 10 | ******************************************************************************]] 11 | 12 | -- Simple wrapper addin script for loading multiple addin scripts 13 | 14 | -------------------------------------------------------------------------------- /xllua/lib/BufferOverflowU.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xllua/lib/BufferOverflowU.lib -------------------------------------------------------------------------------- /xllua/lib/lua51.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xllua/lib/lua51.lib -------------------------------------------------------------------------------- /xllua/lib/msvcrt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xllua/lib/msvcrt.lib -------------------------------------------------------------------------------- /xllua/lib/xlcall32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xllua/lib/xlcall32.lib -------------------------------------------------------------------------------- /xllua/src/.gitignore: -------------------------------------------------------------------------------- 1 | /XLLua.aps 2 | -------------------------------------------------------------------------------- /xllua/src/XLLua.rc: -------------------------------------------------------------------------------- 1 | 1 687 "xllua.lua" 2 | -------------------------------------------------------------------------------- /xllua/test/test1.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poidasmith/xlloop/959f8b863a0d6a4c0857c5112d046e0a39132282/xllua/test/test1.xls -------------------------------------------------------------------------------- /xllua/test/unittest.lua: -------------------------------------------------------------------------------- 1 | 2 | package.path = "../src/?.lua" .. package.path 3 | 4 | xllua = {} 5 | require 'xllua' 6 | local stringit = xllua.stringit 7 | 8 | function xllua.debug_print( s ) 9 | print( s ) 10 | end 11 | 12 | function xllua.excel4(...) 13 | local t = {...} 14 | print( stringit( t ) ) 15 | return 0 16 | end 17 | 18 | function xllua.file_exists( f ) 19 | return true 20 | end 21 | 22 | function xllua.dump(...) 23 | print( stringit( ... ) ) 24 | end 25 | local dump = xllua.dump 26 | 27 | function test( n, ... ) 28 | dump( xllua.fn( n, {...} ) ) 29 | end 30 | 31 | --dofile( "addin1.lua" ) 32 | 33 | xllua.open( "../examples/redis_client.lua" ) 34 | 35 | 36 | test( "rds.connect", "test" ) 37 | test( "rds.ping", "test" ) 38 | test( "rds.set", "test", "key1", "hello" ) 39 | test( "rds.get", "test", "key1" ) 40 | 41 | 42 | 43 | 44 | --------------------------------------------------------------------------------