ExcelCompiler 1.1.14

dotnet add package ExcelCompiler --version 1.1.14
NuGet\Install-Package ExcelCompiler -Version 1.1.14
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="ExcelCompiler" Version="1.1.14" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ExcelCompiler --version 1.1.14
#r "nuget: ExcelCompiler, 1.1.14"
#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 ExcelCompiler as a Cake Addin
#addin nuget:?package=ExcelCompiler&version=1.1.14

// Install ExcelCompiler as a Cake Tool
#tool nuget:?package=ExcelCompiler&version=1.1.14

ExcelCompiler

ExcelCompiler是解析或序列化Excel公式的工具。

公式字符串分解为原子词素。所谓原子词素是不可再分最小语法单位。

ExcelFormulaString.tokenize: string -> seq<ExcelToken>

示例:

let x = "(A1+A2)/2"
let y = ExcelFormulaString.tokenize x |> List.ofSeq
let z = [LPAREN;ID "A1";ADD;ID "A2";RPAREN;DIV;INTEGER "2"]
Should.equal y z

公式字符串分解为词素。词素相对于原子词素进行了初步分组合并。

ExcelFormulaString.normToken: string -> seq<ExcelToken>

示例:

let x = "sheet1!A2"
let y = ExcelFormulaString.normToken x |> List.ofSeq
let z = [REFERENCE(["sheet1"],["A2"])]
Should.equal y z

公式字符串解析为表达式。

ExcelFormulaString.parseToExpr: string -> ExcelExpr

示例:

let x = "(A1+A2)/2"
let y = ExcelFormulaString.parseToExpr x
let z = Div(Add(Reference([],["A1"]),Reference([],["A2"])),Number "2")
Should.equal y z

将名称的名称属性分解为工作表名和名称。如果是工作簿名称,则工作表名称为空。

ExcelFormulaString.splitName: string -> string * string

示例:

let x = "sheet1!x"
let y = ExcelFormulaString.splitName x
let z = "sheet1","x"
Should.equal y z

找出解析器不支持的情况。

ExcelFormulaString.varifyMessage: tokens:ExcelToken list -> string

示例:

let tokens = [LBRACKET;ID "工作簿1.xlsx";RBRACKET;ID "Sheet1";EXCLAM;DOLLAR "$A$1"]
let y = ExcelFormulaString.varifyMessage tokens
Should.equal y "中括号"

将Excel公式打印成F#表达式。

ExcelFormulaString.fsharpExpr: expr:ExcelExpr -> string

示例:

let expr = Mul(Func("pi",[]),Number "3")
let y = ExcelFormulaString.fsharpString expr
Should.equal y "Math.PI*3.0"

词素:

type ExcelToken =
    | NUMBER of string
    | INTEGER of string
    | QUOTE of string
    | APOSTROPHE of string
    | DOLLAR of string
    | ID of string
    | FUNCTION of string
    | ERROR of string
    | FALSE
    | TRUE
    | EXCLAM
    | COLON
    | COMMA
    | LPAREN
    | RPAREN
    | EQ
    | NE
    | LT
    | LE
    | GT
    | GE
    | AMPERSAND
    | ADD
    | SUB
    | MUL
    | DIV
    | CARET
    | PERCENT
    | POSITIVE
    | NEGATIVE
    | LBRACE
    | RBRACE
    | LBRACKET
    | RBRACKET
    | REFERENCE of string list * string list

表达式树:

type ExcelExpr =
    | Func     of string * ExcelExpr list
    | Reference of string list * string list
    | Number   of string
    | False | True
    | Quote    of string
    | Eq       of ExcelExpr * ExcelExpr
    | Gt       of ExcelExpr * ExcelExpr
    | Ge       of ExcelExpr * ExcelExpr
    | Lt       of ExcelExpr * ExcelExpr
    | Le       of ExcelExpr * ExcelExpr
    | Ne       of ExcelExpr * ExcelExpr
    | Concat   of ExcelExpr * ExcelExpr
    | Add      of ExcelExpr * ExcelExpr
    | Sub      of ExcelExpr * ExcelExpr
    | Mul      of ExcelExpr * ExcelExpr
    | Div      of ExcelExpr * ExcelExpr
    | Pow      of ExcelExpr * ExcelExpr
    | Percent  of ExcelExpr
    | Positive of ExcelExpr
    | Negative of ExcelExpr
Product 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.

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.1.14 216 11/20/2023
1.1.13 133 9/9/2023
1.1.12 199 3/22/2023
1.1.11 377 10/16/2022
1.1.10 389 9/8/2022
1.1.9 378 9/7/2022
1.1.8 401 6/27/2022
1.1.7 419 5/8/2022
1.1.6 427 4/19/2022
1.1.5 416 1/24/2022
1.1.4 233 12/31/2021
1.1.3 286 12/19/2021
1.1.2 273 12/7/2021
1.1.1 274 12/5/2021
1.1.0 893 11/29/2021
1.0.5 294 10/28/2021
1.0.4 289 8/22/2021
1.0.3 316 7/23/2021
1.0.2 321 6/22/2021
1.0.1 311 6/21/2021
1.0.0 311 4/13/2021

update nuget