Skip to content

soul-soft/Soul.Expressions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 

Repository files navigation

Soul.Expressions

这是一款开源免费的词法分析引擎,支持动态编译、执行表达式,生成拉姆达表达式树。

基本使用

var compiler = new SyntaxCompiler();
var labmda = compiler.Lambda("a > 20 && 1+2 < 4", new Parameter("a", typeof(int)));
var result = labmda.Compile().DynamicInvoke(2);

词法分析

var options = new SyntaxOptions();
var expr = "a > 20 && 1+2 < 4";
var compiler = new SyntaxCompiler(options);
var context = new SyntaxContext(expr, new Parameter("a", typeof(int)));
var labmda = compiler.Lambda(context);
Console.WriteLine(context.DebugView);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages