FSharpCompiler.Yacc 1.1.7

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

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

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 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 translation