LLamaSharp/docs/xmldocs/llama.grammars.grammarrule.md

2.5 KiB

GrammarRule

Namespace: LLama.Grammars

A single rule in a Grammar

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

Inheritance ObjectGrammarRule
Implements IEquatable<GrammarRule>

Properties

Name

Name of this rule

public string Name { get; }

Property Value

String

Elements

The elements of this grammar rule

public IReadOnlyList<LLamaGrammarElement> Elements { get; }

Property Value

IReadOnlyList<LLamaGrammarElement>

Constructors

GrammarRule(String, IReadOnlyList<LLamaGrammarElement>)

Create a new GrammarRule containing the given elements

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

Parameters

name String

elements IReadOnlyList<LLamaGrammarElement>

Exceptions

ArgumentException

Methods

ToString()

public string ToString()

Returns

String

GetHashCode()

public int GetHashCode()

Returns

Int32

Equals(Object)

public bool Equals(object obj)

Parameters

obj Object

Returns

Boolean

Equals(GrammarRule)

public bool Equals(GrammarRule other)

Parameters

other GrammarRule

Returns

Boolean

<Clone>$()

public GrammarRule <Clone>$()

Returns

GrammarRule