FSharpCompiler.Lex
1.1.3
Replace this package with the FslexFsyacc package, which implements all the features of this package and is more friendly.
See the version list below for details.
dotnet add package FSharpCompiler.Lex --version 1.1.3
NuGet\Install-Package FSharpCompiler.Lex -Version 1.1.3
<PackageReference Include="FSharpCompiler.Lex" Version="1.1.3" />
paket add FSharpCompiler.Lex --version 1.1.3
#r "nuget: FSharpCompiler.Lex, 1.1.3"
// Install FSharpCompiler.Lex as a Cake Addin #addin nuget:?package=FSharpCompiler.Lex&version=1.1.3 // Install FSharpCompiler.Lex as a Cake Tool #tool nuget:?package=FSharpCompiler.Lex&version=1.1.3
FSharpCompiler.Lex
are a tool for generating the DFA for lexical analyzer.
The lexical analyzer reads a sequence of tokens as its input, and groups the tokens using the regular expression rules. If the input is valid, the end result is that the entire token sequence groups to a sequence of groupings, each grouping, which is represents a matching pattern, consists of a index and a list of tokens.
Unlike traditional Lex tools, FSharpCompiler.Lex
does not require action in rules. Instead of explicitly actions a stream of groups is implicitly constructed during the analyzing. The specification of The Lex input file see: [The Lex Input File](Lex input file.md).
A function to generate DFA have following type:
Lex.generateDFA: input:string -> DFA<string>
Lex.generateDFA
takes as input a regular expressions specification and produces a structural data that represent DFA of the regular expressions specification. the produced DFA's type definition is:
type DFA<'tag when 'tag: comparison> =
{
transitions :Set<uint32*'tag*uint32>
finalLexemes :(Set<uint32>*Set<uint32>) list
}
'tag
is token type that is string
type typically.
transitions
is a transition table.
finalLexemes
is acceptable state list, every state pair of which is final state, and trailing state.
how to generate a lexical analyzer using FSharpCompiler.Lex
, see the resolution: xp44mm/PolynomialExpressions
Lex usage Examples
Too many nullable nonterminal symbols can cause the number of BNFs to swell and even trigger reduce/reduce conflicts. The lexical analyzer can skip the extra separators so that the tokens entering the parser conform to the context-free grammar specification. For example, the following regular expression can find negligible line breaks. For example, the following regular expression can find negligible line breaks and process them (remove or merge) Before tokens enter the grammar parser.
BOF "\n"* "%%"? "\n"*
"\n"* EOF
"%%" "\n"+
"\n"+
To supplement the default operator before tokens enter the grammar parser. In this way, when the grammar parser looks forward the supplemented operator, it is enable to determine to reduce the top of the stack. For example, when two adjacent tokens are the end of the statement and the beginning of the statement, we can determine that the semicolon should be added here.
{last_token_of_stmt} / {first_token_of_stmt}
To supplement the holes in the array in JavaScript:
[ "[" "," ] / ","
To refine token, for example, both the two integers that connected by a colon are column addresses in Excel.
INTEGER ":" INTEGER
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. |
-
.NETStandard 2.0
- FSharp.Core (>= 5.0.2)
- FSharp.Idioms (>= 1.1.12)
- FSharp.Literals (>= 2.2.3)
- FSharpCompiler.Analyzing (>= 1.0.4)
- FSharpCompiler.Parsing (>= 1.0.5)
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.7 | 1,213 | 10/20/2021 | |
1.1.6 | 1,104 | 10/19/2021 | |
1.1.4 | 1,160 | 8/21/2021 | |
1.1.3 | 1,179 | 8/15/2021 | |
1.1.2 | 1,167 | 7/18/2021 | |
1.1.1 | 1,125 | 7/18/2021 | |
1.1.0 | 1,128 | 7/7/2021 | |
1.0.6 | 1,265 | 3/13/2021 | |
1.0.5 | 1,142 | 2/21/2021 | |
1.0.4 | 1,137 | 2/20/2021 | |
1.0.3 | 1,157 | 2/2/2021 | |
1.0.2 | 1,169 | 2/1/2021 | |
1.0.1 | 1,157 | 1/24/2021 | |
1.0.0 | 1,187 | 1/21/2021 |
trans generator