Farkle


LALRBuild Module

Functions to generate LALR state tables from a grammar.

Functions and values

Function or value Description

buildProductionsToLALRStates resolver startSymbol terminals nonterminals productions

Full Usage: buildProductionsToLALRStates resolver startSymbol terminals nonterminals productions

Parameters:
Returns: Result<ImmutableArray<LALRState>, BuildError list> An immutable array of the LALR states or a list of the errors that were encountered.

Builds an LALR parsing table.

resolver : LALRConflictResolver

Used to resolve LALR conflicts.

startSymbol : Nonterminal

The grammar's starting symbol.

terminals : ImmutableArray<Terminal>

The grammar's terminals.

nonterminals : ImmutableArray<Nonterminal>

The grammar's nonterminals.

productions : ImmutableArray<Production>

The grammar's productions.

Returns: Result<ImmutableArray<LALRState>, BuildError list>

An immutable array of the LALR states or a list of the errors that were encountered.

buildProductionsToLALRStatesEx ct options resolver startSymbol terminals nonterminals productions

Full Usage: buildProductionsToLALRStatesEx ct options resolver startSymbol terminals nonterminals productions

Parameters:
Returns: Result<ImmutableArray<LALRState>, BuildError list> An immutable array of the LALR states or a list of the errors that were encountered.

Builds an LALR parsing table.

ct : CancellationToken

Used to cancel the operation.

options : BuildOptions

Used to further configure the operation.

resolver : LALRConflictResolver

Used to resolve LALR conflicts.

startSymbol : Nonterminal

The grammar's starting symbol.

terminals : ImmutableArray<Terminal>

The grammar's terminals.

nonterminals : ImmutableArray<Nonterminal>

The grammar's nonterminals.

productions : ImmutableArray<Production>

The grammar's productions.

Returns: Result<ImmutableArray<LALRState>, BuildError list>

An immutable array of the LALR states or a list of the errors that were encountered.

OperationCanceledException ct was triggered.