Class EnumRule<TEnum>
Denotes an enumeration rule
public class EnumRule<TEnum> : ChoiceRule
Type Parameters
TEnumthe 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
semanticElementobjectthe semantic element
contextParseContextthe context in which the rule is synthesized
synthesisPlanSynthesisPlanthe 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
matchRuleApplicationthe matched candidate
examinedParsePositionDeltathe 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
semanticElementobjectpositionParsePositionthe parse position at which the element should be synthesized
contextParseContextthe parse context
Returns
- RuleApplication
a rule application