Table of Contents

Class EnumRule<TEnum>

Namespace
NMF.AnyText.Model
Assembly
NMF.AnyText.Core.dll

Denotes an enumeration rule

public class EnumRule<TEnum> : ChoiceRule

Type Parameters

TEnum

the type of the enumeration

Inheritance
EnumRule<TEnum>
Derived
Inherited Members

Properties

Values

Gets the enum values assigned to the alternatives

public TEnum[] Values { get; set; }

Property Value

TEnum[]

Methods

CanSynthesize(object, ParseContext, SynthesisPlan)

Determines whether the current rule can synthesize rule applications for the given semantic element

public override bool CanSynthesize(object semanticElement, ParseContext context, SynthesisPlan synthesisPlan)

Parameters

semanticElement object

the semantic element

context ParseContext

the context in which the rule is synthesized

synthesisPlan SynthesisPlan

the plan of the synthesis

Returns

bool

true, if a rule application can be synthesized, otherwise false

CreateRuleApplication(RuleApplication, ParsePositionDelta)

Creates a rule application for a success

protected override RuleApplication CreateRuleApplication(RuleApplication match, ParsePositionDelta examined)

Parameters

match RuleApplication

the matched candidate

examined ParsePositionDelta

the amount of text examined

Returns

RuleApplication

a new rule application

CreateSynthesisRequirements()

Creates a collection of requirements for synthesis

public override IEnumerable<SynthesisRequirement> CreateSynthesisRequirements()

Returns

IEnumerable<SynthesisRequirement>

A collection of synthesis requirements

Synthesize(object, ParsePosition, ParseContext)

Synthesizes a rule application for the given semantic element

public override RuleApplication Synthesize(object semanticElement, ParsePosition position, ParseContext context)

Parameters

semanticElement object
position ParsePosition

the parse position at which the element should be synthesized

context ParseContext

the parse context

Returns

RuleApplication

a rule application