- Author: Stardust D.L.
- Version: 0.5.3
The core types and functions of iExpr.
iExpr is an extensible expression parser and evaluator.
-
You can use iExpr.Core to define your own expression types by creating different operations.
-
Also you can use it to "create" a simple programming language.
PS: Please see ExprSharp
PM> Install-Package iExpr.Core -Version 0.5.3
- Install the package from nuget
- Define your operations and functions
- implement your own ParseEnvironment based on
iExpr.Parsers.ParseEnvironment
- implement your own EvalEnvironment based on
iExpr.Evaluators.EvalEnvironment
- Use the code below to evaluate your expression:
ParseEnvironment ep = new YourParseEnvironment(); EvalEnvironment ep = new YourEvalEnvironment(); ExprBuilder eb = new ExprBuilder(ep); var buildedExpr = eb.GetExpr(exprString); var context = ev.CreateContext().GetChild(); var evaluatedExpr=context.Evaluate(buildedExpr);
-
You can go to Wiki for more information.
-
You can go to
iExpr.Exprs
to see how to implement your own environment and operations. Link- The logic project is a simple example
- For a complex one, you can see ExprSharp
This is the app on Windows that I designed: iExpr