Class EnumRule<TEnum>
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
objectthe semantic element
context
ParseContextthe context in which the rule is synthesized
synthesisPlan
SynthesisPlanthe 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
RuleApplicationthe matched candidate
examined
ParsePositionDeltathe 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
objectposition
ParsePositionthe parse position at which the element should be synthesized
context
ParseContextthe parse context
Returns
- RuleApplication
a rule application