FSharpCompiler.Lex 1.1.2

Suggested Alternatives

FslexFsyacc

Additional Details

Replace this package with the FslexFsyacc package, which implements all the features of this package and is more friendly.

There is a newer version of this package available.
See the version list below for details.
dotnet add package FSharpCompiler.Lex --version 1.1.2                
NuGet\Install-Package FSharpCompiler.Lex -Version 1.1.2                
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="FSharpCompiler.Lex" Version="1.1.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FSharpCompiler.Lex --version 1.1.2                
#r "nuget: FSharpCompiler.Lex, 1.1.2"                
#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 FSharpCompiler.Lex as a Cake Addin
#addin nuget:?package=FSharpCompiler.Lex&version=1.1.2

// Install FSharpCompiler.Lex as a Cake Tool
#tool nuget:?package=FSharpCompiler.Lex&version=1.1.2                

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, witch 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 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.

update Dependencies