Table of Contents

Class Nonterminal

Namespace
Farkle.Builder
Assembly
Farkle.dll

Provides factory methods to define nonterminals.

public static class Nonterminal
Inheritance
Nonterminal

Methods

CreateUntyped(string)

Creates a nonterminal that does not produce a value and whose productions must be assigned at a later time.

public static Nonterminal CreateUntyped(string name)

Parameters

name string

The nonterminal's name.

Returns

Nonterminal
See Also

CreateUntyped(string, params ProductionBuilder[])

Creates a nonterminal that does not produce a value.

public static IGrammarSymbol CreateUntyped(string name, params ProductionBuilder[] productions)

Parameters

name string

The nonterminal's name.

productions ProductionBuilder[]

The nonterminal's productions, represented as ProductionBuilder objects that have not been Extended or Finished.

Returns

IGrammarSymbol

Exceptions

ArgumentException

productions is empty.

CreateUntyped(string, params ImmutableArray<ProductionBuilder>)

Creates a nonterminal that does not produce a value.

public static IGrammarSymbol CreateUntyped(string name, params ImmutableArray<ProductionBuilder> productions)

Parameters

name string

The nonterminal's name.

productions ImmutableArray<ProductionBuilder>

The nonterminal's productions, represented as ProductionBuilder objects that have not been Extended or Finished.

Returns

IGrammarSymbol

Exceptions

ArgumentException

productions is empty.

Create<T>(string)

Creates a nonterminal that produces a value, whose productions must be assigned at a later time.

public static Nonterminal<T> Create<T>(string name)

Parameters

name string

The nonterminal's name.

Returns

Nonterminal<T>

Type Parameters

T

The type of values the nonterminal will produce.

See Also

Create<T>(string, params IProduction<T>[])

Creates a nonterminal that produces a value.

public static IGrammarSymbol<T> Create<T>(string name, params IProduction<T>[] productions)

Parameters

name string

The nonterminal's name.

productions IProduction<T>[]

The nonterminal's productions.

Returns

IGrammarSymbol<T>

Type Parameters

T

The type of values the nonterminal will produce.

Exceptions

ArgumentException

productions is empty.

Create<T>(string, params ImmutableArray<IProduction<T>>)

Creates a nonterminal that produces a value.

public static IGrammarSymbol<T> Create<T>(string name, params ImmutableArray<IProduction<T>> productions)

Parameters

name string

The nonterminal's name.

productions ImmutableArray<IProduction<T>>

The nonterminal's productions.

Returns

IGrammarSymbol<T>

Type Parameters

T

The type of values the nonterminal will produce.

Exceptions

ArgumentException

productions is empty.