FSharpCompiler.Yacc
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.Yacc --version 1.1.3
NuGet\Install-Package FSharpCompiler.Yacc -Version 1.1.3
<PackageReference Include="FSharpCompiler.Yacc" Version="1.1.3" />
paket add FSharpCompiler.Yacc --version 1.1.3
#r "nuget: FSharpCompiler.Yacc, 1.1.3"
// Install FSharpCompiler.Yacc as a Cake Addin #addin nuget:?package=FSharpCompiler.Yacc&version=1.1.3 // Install FSharpCompiler.Yacc as a Cake Tool #tool nuget:?package=FSharpCompiler.Yacc&version=1.1.3
Yacc is a tool which given a context-free grammar, constructs a parsing table used for parser which will parse input tokens according to the grammar rules.
Unlike traditional Yacc tools, FSharpCompiler.Yacc
does not require action in rules. Instead of explicitly actions, the parse tree is implicitly constructed during the parse. As the parser executes, it builds an internal representation of the the structure of the program. The internal representation is based on the right hand side of the production rules. When a right hand side is recognized, it is reduced to the corresponding left hand side. Parsing is complete when the entire program has been reduced to the start symbol of the grammar. The specification of context-free grammar input see [The Yacc Input File](Yacc Input File.md)
Build a parsing table
From the input file yaccFile
, the method for generating the ExprParsingTable
module is follow:
open FSharpCompiler.Yacc
let yacc = YaccFile.parse yaccFile
let parseTbl =
ParseTable.create(yacc.mainRules, yacc.precedences)
// ... the print ExprParsingTable code with parseTbl
The result module like this:
module ArithmeticExpressions.ExprParsingTable
let rules = set [ ... ]
let kernelSymbols = Map [ ... ]
let parsingTable = set [ ... ]
With the parsing table, plus the parser runtime libraries, FSharpCompiler.Parsing
, you can build parsers. How to build a parser using Yacc is detailed in the resolution:xp44mm/ArithmeticExpressions
The Grammar Type
The Grammar
type gives you some properties that represent important Sets of symbols. Grammar is obtained by this method:
let grammar =
let yacc = YaccFile.parse yaccFile
Grammar.from yacc.mainRules
yaccFile
is the yacc input file content. The main collection properties are included:
grammar.symbols: Set<string> // set of terminals and nonterminals
grammar.nonterminals: Set<string> // set of nonterminals
grammar.nullables: Set<string> // set of nonterminals, which is able to empty
grammar.firsts:Map<string,Set<string>> // A dictionary that queries the nonterminal's FIRST collection
grammar.lasts:Map<string,Set<string>> // A dictionary that queries the nonterminal's LAST collection
grammar.follows:Map<string,Set<string>> // A dictionary that queries the nonterminal's FOLLOW collection
These properties are commonly used to help you write regular expressions in Lex input file.
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.8 | 1,175 | 11/4/2021 | |
1.1.7 | 1,091 | 10/20/2021 | |
1.1.6 | 1,044 | 10/19/2021 | |
1.1.5 | 1,031 | 10/19/2021 | |
1.1.4 | 1,077 | 8/21/2021 | |
1.1.3 | 1,099 | 8/15/2021 | |
1.1.2 | 1,107 | 7/18/2021 | |
1.1.1 | 1,083 | 7/18/2021 | |
1.1.0 | 1,094 | 7/7/2021 | |
1.0.4 | 1,155 | 3/13/2021 | |
1.0.3 | 1,070 | 2/20/2021 | |
1.0.2 | 1,066 | 2/1/2021 | |
1.0.1 | 1,128 | 1/22/2021 | |
1.0.0 | 1,106 | 1/21/2021 |
trans generator