Class AddAssignReferenceRule<TSemanticElement, TReference>
Denotes a rule that adds the value of an inner rule to a collection of the semantic element
public abstract class AddAssignReferenceRule<TSemanticElement, TReference> : ResolveRule<TSemanticElement, TReference>
Type Parameters
TSemanticElementThe type of the context element
TReferenceThe type of the property value
- Inheritance
-
ResolveRule<TSemanticElement, TReference>AddAssignReferenceRule<TSemanticElement, TReference>
- Derived
- Inherited Members
Properties
Feature
Gets the name of the feature that is assigned
protected abstract string Feature { get; }
Property Value
IndexCalculation
Gets or sets the index calculation scheme
public IndexCalculationScheme IndexCalculation { get; protected set; }
Property Value
Methods
Apply(RuleApplication, ParseContext, TSemanticElement, TReference, bool)
Applies the given value to the provided context element
protected override void Apply(RuleApplication ruleApplication, ParseContext context, TSemanticElement contextElement, TReference propertyValue, bool initial)
Parameters
ruleApplicationRuleApplicationthe rule application which should be applied
contextParseContextthe parse context in which this operation is performed
contextElementTSemanticElementthe element to which the value should be applied
propertyValueTReferencethe value to apply
initialboolA flag indicating whether the apply was called due to initial parse
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
GetCollection(TSemanticElement, ParseContext)
Obtains the child collection
public abstract ICollection<TReference> GetCollection(TSemanticElement semanticElement, ParseContext context)
Parameters
semanticElementTSemanticElementthe semantic element
contextParseContextthe parse context in which the collection is obtained
Returns
- ICollection<TReference>
a collection of values
Replace(RuleApplication, ParseContext, TSemanticElement, TReference, TReference)
Replaces the provided old element with the provided new element
protected override void Replace(RuleApplication ruleApplication, ParseContext context, TSemanticElement contextElement, TReference oldValue, TReference newValue)
Parameters
ruleApplicationRuleApplicationthe rule application which should be applied
contextParseContextthe parse context in which this operation is performed
contextElementTSemanticElementthe element to which the value should be applied
oldValueTReferencethe old value
newValueTReferencethe value to apply
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
Unapply(RuleApplication, ParseContext, TSemanticElement, TReference)
Unapplies the given value to the provided context element
protected override void Unapply(RuleApplication ruleApplication, ParseContext context, TSemanticElement contextElement, TReference propertyValue)
Parameters
ruleApplicationRuleApplicationthe rule application which should be applied
contextParseContextthe parse context in which this operation is performed
contextElementTSemanticElementthe element to which the value should be unapplied
propertyValueTReferencethe value to unapply