SimpleParser 1.0.0-VER-01.35
This is a prerelease version of SimpleParser.
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package SimpleParser --version 1.0.0-VER-01.35
NuGet\Install-Package SimpleParser -Version 1.0.0-VER-01.35
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SimpleParser" Version="1.0.0-VER-01.35" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SimpleParser --version 1.0.0-VER-01.35
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SimpleParser, 1.0.0-VER-01.35"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SimpleParser as a Cake Addin #addin nuget:?package=SimpleParser&version=1.0.0-VER-01.35&prerelease // Install SimpleParser as a Cake Tool #tool nuget:?package=SimpleParser&version=1.0.0-VER-01.35&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SimpleParser
This project solves serveral problems
- Parse expression to ast tree and the possibilty of calculating the result
- Parse conditions 5+3 = 8 & 2*3 = 6, support
- support =, !=, >, <, >=, ⇐, &, |
- Use external variables in an expression
- Use external functions in an expression
- Parse view template $"string length = {2+2}", result is "string length = 4"
- Serialize ast tree to json
How to use (Example)
internal static class InternalFuncs
{
[FuncName("len")]
public static int Len(IFuncExecuteContext context, string str)
{
return str?.Length ?? default;
}
}
var identifier = new Dictionary<string, object>
{
[x] = 5,
[str] = "hello"
};
var funcTable = FuncTableFactory.Create(typeof(InternalFuncs));
var tree = LineParser.Parse("len(str)+x*2", identifier, funcTable);
var result = AstCalculator.Calculate(tree, identifier, funcTable);
Assert.True(result.IsNumber());
Assert.Equal(15, result.ToNumber());
var treeCondition = LineParser.Parse("len(str) = 5", identifier, funcTable);
var result = AstCalculator.Calculate(treeCondition, identifier, funcTable);
Assert.True(result.IsBoolean());
Assert.True(result.ToBoolean());
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- System.Text.Json (>= 6.0.6)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on SimpleParser:
Package | Downloads |
---|---|
JetPipe
Compile and run pipe async |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0-VER-01.56 | 244 | 12/20/2023 |
1.0.0-VER-01.55 | 179 | 10/25/2023 |
1.0.0-VER-01.54 | 122 | 8/10/2023 |
1.0.0-VER-01.53 | 94 | 7/30/2023 |
1.0.0-VER-01.52 | 102 | 7/13/2023 |
1.0.0-VER-01.51 | 90 | 7/4/2023 |
1.0.0-VER-01.50 | 82 | 6/4/2023 |
1.0.0-VER-01.48 | 83 | 6/1/2023 |
1.0.0-VER-01.47 | 77 | 6/1/2023 |
1.0.0-VER-01.46 | 93 | 2/24/2023 |
1.0.0-VER-01.45 | 95 | 2/9/2023 |
1.0.0-VER-01.44 | 112 | 1/9/2023 |
1.0.0-VER-01.42 | 106 | 12/31/2022 |
1.0.0-VER-01.41 | 112 | 12/22/2022 |
1.0.0-VER-01.40 | 103 | 12/7/2022 |
1.0.0-VER-01.39 | 98 | 12/1/2022 |
1.0.0-VER-01.38 | 110 | 11/22/2022 |
1.0.0-VER-01.37 | 105 | 11/13/2022 |
1.0.0-VER-01.36 | 108 | 11/9/2022 |
1.0.0-VER-01.35 | 112 | 10/27/2022 |
1.0.0-VER-01.34 | 114 | 10/25/2022 |
1.0.0-VER-01.33 | 114 | 10/23/2022 |
1.0.0-VER-01.32 | 119 | 10/21/2022 |
1.0.0-VER-01.31 | 129 | 10/21/2022 |
1.0.0-VER-01.30 | 132 | 10/20/2022 |
1.0.0-VER-01.29 | 131 | 10/19/2022 |
1.0.0-VER-01.28 | 105 | 10/18/2022 |
1.0.0-VER-01.27 | 103 | 10/18/2022 |
1.0.0-VER-01.26 | 116 | 10/13/2022 |
1.0.0-VER-01.25 | 105 | 10/12/2022 |
1.0.0-VER-01.24 | 106 | 10/12/2022 |
1.0.0-VER-01.17 | 105 | 10/12/2022 |
1.0.0-VER-01.9 | 109 | 10/11/2022 |
Parse line to ast tree