Skip to content

GrammarRule

Namespace: LLama.Grammars

A single rule in a Grammar

1
public sealed class GrammarRule : System.IEquatable`1[[LLama.Grammars.GrammarRule, LLamaSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]

Inheritance ObjectGrammarRule
Implements IEquatable<GrammarRule>

Properties

Name

Name of this rule

1
public string Name { get; }

Property Value

String

Elements

The elements of this grammar rule

1
public IReadOnlyList<LLamaGrammarElement> Elements { get; }

Property Value

IReadOnlyList<LLamaGrammarElement>

Constructors

GrammarRule(String, IReadOnlyList<LLamaGrammarElement>)

Create a new GrammarRule containing the given elements

1
public GrammarRule(string name, IReadOnlyList<LLamaGrammarElement> elements)

Parameters

name String

elements IReadOnlyList<LLamaGrammarElement>

Exceptions

ArgumentException

Methods

ToString()

1
public string ToString()

Returns

String

GetHashCode()

1
public int GetHashCode()

Returns

Int32

Equals(Object)

1
public bool Equals(object obj)

Parameters

obj Object

Returns

Boolean

Equals(GrammarRule)

1
public bool Equals(GrammarRule other)

Parameters

other GrammarRule

Returns

Boolean

<Clone>$()

1
public GrammarRule <Clone>$()

Returns

GrammarRule