RailroadRule Class

A rule of a railroad diagram: a name and the expression it stands for.

public sealed class RailroadRule

Constructors

NameDescription
RailroadRule(string, RailroadExpression)Initializes a new instance of the RailroadRule class.

RailroadRule(string, RailroadExpression)

RailroadRule.cs

Initializes a new instance of the RailroadRule class.

public RailroadRule(string name, RailroadExpression definition)

Parameters

name string
The name of the rule.
definition RailroadExpression
The expression the rule stands for.

Properties

NameDescription
DefinitionGets or sets the expression the rule stands for.
NameGets or sets the name of the rule, shown before its track.

Definition

RailroadRule.cs

Gets or sets the expression the rule stands for.

public RailroadExpression Definition { get; set; }

Property value

RailroadExpression

Gets or sets the name of the rule, shown before its track.

public string Name { get; set; }

Property value

string

Methods

NameDescription
ToString()Returns the name of the rule.

ToString()

RailroadRule.cs

Returns the name of the rule.

public override string ToString()

Returns

string The name.