AnalysisScript 1.0.2-beta.3

This is a prerelease version of AnalysisScript.
There is a newer version of this package available.
See the version list below for details.
dotnet add package AnalysisScript --version 1.0.2-beta.3
                    
NuGet\Install-Package AnalysisScript -Version 1.0.2-beta.3
                    
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="AnalysisScript" Version="1.0.2-beta.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AnalysisScript" Version="1.0.2-beta.3" />
                    
Directory.Packages.props
<PackageReference Include="AnalysisScript" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AnalysisScript --version 1.0.2-beta.3
                    
#r "nuget: AnalysisScript, 1.0.2-beta.3"
                    
#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.
#:package AnalysisScript@1.0.2-beta.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AnalysisScript&version=1.0.2-beta.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=AnalysisScript&version=1.0.2-beta.3&prerelease
                    
Install as a Cake Tool

Analysis Script

A super mini script for log analysis

Examples

Basic usage (with BFL)

using AnalysisScript.Library;

// initialize variables
var variables = new VariableContext()
    .AddInitializeVariable("a", 1)
    .AddInitialzieVariable("b", new List<int>() { 2, 3, 4 });

// register custom methods
var incrSingle = (int x) => ValueTask.FromResult(p + 1);
var incrSequence = (IEnumerable<int> xs)
    => ValueTask.CompleteTask(xs.Select(x => x + 1));

variables.Methods.RegisterInstanceFunction("inc", incrSingle);
variables.Methods.RegisterInstanceFunction("inc", incrSequence);

// run code and get return value
var interpreter = AsInterpreter.Of(variables,
"""
param a
param b

let first = c
| inc

let tail = d
| inc
| join "," 

let res = "${first},${tail}"

return res
""");
var result = await interpreter.RunAndReturn<string>();

// Output: 2,3,4,5
Console.WriteLine(result);

All grammar example

# define variable 'a'
param a

let b = arg1
| fn arg2 arg3
| fn2 arg2
| fn3

call fn4 arg1 arg2 arg3

let d = "string interpolation ${c}"
let e = "string ${c} interpolation"

return d

Grammar

param -> identity

arr -> param

arrs -> '[' arrs arr ',' | empty ']'

argument -> number | string | identity | arrs

arguments -> arguments argument

pipe -> pipe identity argument newline

pipes -> pipes pipe | empty

variable -> identity

let -> let variable = argument [pipes]

ui -> ui newline pipes

cmd -> let | ui | comment | param

return -> return identity

cmds -> cmds cmd | empty

analysis -> cmds return
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4-beta.1 107 5/29/2024
1.0.3 167 3/1/2024
1.0.3-beta.26 79 2/29/2024
1.0.3-beta.25 86 2/28/2024
1.0.3-beta.24 79 2/27/2024
1.0.3-beta.23 90 2/27/2024
1.0.3-beta.22 75 2/27/2024
1.0.3-beta.21 78 2/27/2024
1.0.3-beta.20 77 2/26/2024
1.0.3-beta.19 80 2/26/2024
1.0.3-beta.18 82 2/26/2024
1.0.3-beta.17 79 2/26/2024
1.0.3-beta.16 86 2/23/2024
1.0.3-beta.15 84 2/23/2024
1.0.3-beta.13 83 2/23/2024
1.0.3-beta.12 80 2/23/2024
1.0.3-beta.11 82 2/23/2024
1.0.3-beta.10 80 2/23/2024
1.0.3-beta.9 83 2/23/2024
1.0.3-beta.8 85 2/23/2024
1.0.3-beta.7 83 2/23/2024
1.0.3-beta.6 85 2/23/2024
1.0.3-beta.5 87 2/23/2024
1.0.3-beta.4 85 2/23/2024
1.0.3-beta.3 89 2/21/2024
1.0.3-beta.2 87 2/21/2024
1.0.3-beta.1 97 2/7/2024
1.0.2 128 2/7/2024
1.0.2-beta.10 108 1/19/2024
1.0.2-beta.9 77 1/19/2024
1.0.2-beta.8 77 1/18/2024
1.0.2-beta.7 76 1/18/2024
1.0.2-beta.6 82 1/18/2024
1.0.2-beta.5 76 1/18/2024
1.0.2-beta.4 83 1/16/2024
1.0.2-beta.3 89 1/13/2024
1.0.2-beta.2 85 1/12/2024
1.0.2-beta.1 85 1/12/2024
1.0.2-alpha.2 82 1/12/2024
1.0.2-alpha.1 78 1/12/2024
1.0.1 204 12/18/2023
1.0.0 105 12/18/2023