Class Rule
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
NamestringDeclarationOrderintIsFragmentboolContentAlternationOptionsRuleOptionsParametersIReadOnlyList<RuleParameter>ReturnsIReadOnlyList<RuleReturn>InitActionEmbeddedActionAfterActionEmbeddedActionKindRuleKindLocalsIReadOnlyList<RuleLocal>ExceptionMetadataRuleExceptionMetadata
Properties
AfterAction
public EmbeddedAction? AfterAction { get; init; }
Property Value
Content
public Alternation Content { get; init; }
Property Value
DeclarationOrder
public int DeclarationOrder { get; init; }
Property Value
ExceptionMetadata
public RuleExceptionMetadata? ExceptionMetadata { get; init; }
Property Value
InitAction
public EmbeddedAction? InitAction { get; init; }
Property Value
IsFragment
public bool IsFragment { get; init; }
Property Value
Kind
public RuleKind Kind { get; init; }
Property Value
Locals
Gets the immutable snapshot of locals, or null when absent.
public IReadOnlyList<RuleLocal>? Locals { get; init; }
Property Value
Name
public string Name { get; init; }
Property Value
Options
public RuleOptions? Options { get; init; }
Property Value
Parameters
Gets the immutable snapshot of parameters, or null when absent.
public IReadOnlyList<RuleParameter>? Parameters { get; init; }
Property Value
Returns
Gets the immutable snapshot of returns, or null when absent.
public IReadOnlyList<RuleReturn>? Returns { get; init; }