ExcelCompiler 1.0.5
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package ExcelCompiler --version 1.0.5
NuGet\Install-Package ExcelCompiler -Version 1.0.5
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.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ExcelCompiler --version 1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ExcelCompiler, 1.0.5"
#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.0.5 // Install ExcelCompiler as a Cake Tool #tool nuget:?package=ExcelCompiler&version=1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ExcelCompiler
是解析或序列化Excel公式的工具。
公式字符串分解为原子词素。所谓原子词素是不可再分最小语法单位。
ExcelFormulaString.tokenize: string -> seq<ExcelToken>
示例:
let x = "=(A1+A2)/2"
let y = ExcelFormulaString.tokenize x |> List.ofSeq
let z = [EQ;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 = [EQ;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 = [EQ;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 | 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
- FSharp.Core (>= 6.0.0)
- FSharp.Idioms (>= 1.1.14)
- FSharp.Literals (>= 2.2.5)
- FSharpCompiler.Analyzing (>= 1.1.0)
- FSharpCompiler.Parsing (>= 1.1.3)
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 | 261 | 11/20/2023 |
1.1.13 | 163 | 9/9/2023 |
1.1.12 | 227 | 3/22/2023 |
1.1.11 | 423 | 10/16/2022 |
1.1.10 | 421 | 9/8/2022 |
1.1.9 | 408 | 9/7/2022 |
1.1.8 | 433 | 6/27/2022 |
1.1.7 | 450 | 5/8/2022 |
1.1.6 | 459 | 4/19/2022 |
1.1.5 | 448 | 1/24/2022 |
1.1.4 | 256 | 12/31/2021 |
1.1.3 | 317 | 12/19/2021 |
1.1.2 | 309 | 12/7/2021 |
1.1.1 | 303 | 12/5/2021 |
1.1.0 | 916 | 11/29/2021 |
1.0.5 | 321 | 10/28/2021 |
1.0.4 | 316 | 8/22/2021 |
1.0.3 | 344 | 7/23/2021 |
1.0.2 | 352 | 6/22/2021 |
1.0.1 | 342 | 6/21/2021 |
1.0.0 | 354 | 4/13/2021 |
update translation