Skip to content

iExpr/iExpr.Core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iExpr.Core

  • Author: Stardust D.L.
  • Version: 0.5.3

The core types and functions of iExpr.

iExpr is an extensible expression parser and evaluator.

Functions

  • 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

Install

PM> Install-Package iExpr.Core -Version 0.5.3

Brief Usage

  1. Install the package from nuget
  2. Define your operations and functions
  3. implement your own ParseEnvironment based on iExpr.Parsers.ParseEnvironment
  4. implement your own EvalEnvironment based on iExpr.Evaluators.EvalEnvironment
  5. 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

Note

Links

This is the app on Windows that I designed: iExpr

License

LGPLv3

About

The core types and functions of iExpr.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages