In This Article

Terminal Class

Represents a terminal symbol within a grammar.

public class Terminal : Symbol, IKeyedObject
Inheritance:
object Symbol object
Implements:
IKeyedObject

Constructors

Terminal(int)

Initializes a new instance of the Terminal class.

public Terminal(int id)
Parameter Type Description
id int

The ID that identifies the terminal.

Terminal(int?, ITokenIdProvider)

Initializes a new instance of the Terminal class.

public Terminal(int? id, ITokenIdProvider tokenIdProvider)
Parameter Type Description
id int?

The ID that identifies the terminal.

tokenIdProvider ITokenIdProvider

An ITokenIdProvider that can provide a key for the specified token ID.

Terminal(int?, string)

Initializes a new instance of the Terminal class.

public Terminal(int? id, string key)
Parameter Type Description
id int?

The ID that identifies the terminal.

key string

A string that identifies the symbol.

Properties

Id

Gets or sets the ID that identifies the terminal.

public int? Id { get; set; }

Property Value

int?:

The ID that identifies the terminal.

Remarks

Once the grammar has been compiled, the setter of this property will throw an exception if called.

Methods

ToTerm(string)

Wraps this symbol with a labeled EbnfSymbol.

public override EbnfSymbol ToTerm(string label)
Parameter Type Description
label string

The string label to use.

Returns

EbnfSymbol:

The EbnfSymbol that was created.

Inherited Members