Table of Contents

Class Rule

Namespace
Utils.Parser.Model
Assembly
Utils.Parser.dll

A single grammar rule — either a lexer rule (upper-case name by convention) or a parser rule (lower-case name by convention).

public record Rule : IEquatable<Rule>
Inheritance
Rule
Implements
Inherited Members
Extension Methods

Constructors

Rule(string, int, bool, Alternation, RuleOptions?, IReadOnlyList<RuleParameter>?, IReadOnlyList<RuleReturn>?, EmbeddedAction?, EmbeddedAction?, RuleKind, IReadOnlyList<RuleLocal>?, RuleExceptionMetadata?)

A single grammar rule — either a lexer rule (upper-case name by convention) or a parser rule (lower-case name by convention).

public Rule(string Name, int DeclarationOrder, bool IsFragment, Alternation Content, RuleOptions? Options = null, IReadOnlyList<RuleParameter>? Parameters = null, IReadOnlyList<RuleReturn>? Returns = null, EmbeddedAction? InitAction = null, EmbeddedAction? AfterAction = null, RuleKind Kind = RuleKind.Unresolved, IReadOnlyList<RuleLocal>? Locals = null, RuleExceptionMetadata? ExceptionMetadata = null)

Parameters

Name string
DeclarationOrder int
IsFragment bool
Content Alternation
Options RuleOptions
Parameters IReadOnlyList<RuleParameter>
Returns IReadOnlyList<RuleReturn>
InitAction EmbeddedAction
AfterAction EmbeddedAction
Kind RuleKind
Locals IReadOnlyList<RuleLocal>
ExceptionMetadata RuleExceptionMetadata

Properties

AfterAction

public EmbeddedAction? AfterAction { get; init; }

Property Value

EmbeddedAction

Content

public Alternation Content { get; init; }

Property Value

Alternation

DeclarationOrder

public int DeclarationOrder { get; init; }

Property Value

int

ExceptionMetadata

public RuleExceptionMetadata? ExceptionMetadata { get; init; }

Property Value

RuleExceptionMetadata

InitAction

public EmbeddedAction? InitAction { get; init; }

Property Value

EmbeddedAction

IsFragment

public bool IsFragment { get; init; }

Property Value

bool

Kind

public RuleKind Kind { get; init; }

Property Value

RuleKind

Locals

Gets the immutable snapshot of locals, or null when absent.

public IReadOnlyList<RuleLocal>? Locals { get; init; }

Property Value

IReadOnlyList<RuleLocal>

Name

public string Name { get; init; }

Property Value

string

Options

public RuleOptions? Options { get; init; }

Property Value

RuleOptions

Parameters

Gets the immutable snapshot of parameters, or null when absent.

public IReadOnlyList<RuleParameter>? Parameters { get; init; }

Property Value

IReadOnlyList<RuleParameter>

Returns

Gets the immutable snapshot of returns, or null when absent.

public IReadOnlyList<RuleReturn>? Returns { get; init; }

Property Value

IReadOnlyList<RuleReturn>