Table of Contents

Class AddAssignRule<TSemanticElement, TProperty>

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

Denotes a rule that adds the value of an inner rule to a collection of the semantic element

public abstract class AddAssignRule<TSemanticElement, TProperty> : QuoteRule

Type Parameters

TSemanticElement

The type of the context element

TProperty

The type of the property value

Inheritance
AddAssignRule<TSemanticElement, TProperty>
Derived
Inherited Members

Properties

Feature

Gets the name of the feature that is assigned

protected abstract string Feature { get; }

Property Value

string

IndexCalculation

Gets or sets the index calculation scheme

public IndexCalculationScheme IndexCalculation { get; protected set; }

Property Value

IndexCalculationScheme

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, ParseContext, object)

Creates the rule application for this rule

protected override RuleApplication CreateRuleApplication(RuleApplication app, ParseContext context, object semanticElement = null)

Parameters

app RuleApplication

the inner rule application

context ParseContext

the parse context

semanticElement object

the semantic element for which the rule application is created or null, if not yet known

Returns

RuleApplication

the new rule application

CreateSynthesisRequirements()

Creates a collection of requirements for synthesis

public override IEnumerable<SynthesisRequirement> CreateSynthesisRequirements()

Returns

IEnumerable<SynthesisRequirement>

A collection of synthesis requirements

GetCollection(TSemanticElement, ParseContext)

Obtains the child collection

public abstract ICollection<TProperty> GetCollection(TSemanticElement semanticElement, ParseContext context)

Parameters

semanticElement TSemanticElement

the semantic element

context ParseContext

the parse context in which the collection is obtained

Returns

ICollection<TProperty>

a collection of values

OnActivate(RuleApplication, ParseContext, bool)

Gets called when a rule application is activated

protected override void OnActivate(RuleApplication application, ParseContext context, bool initial)

Parameters

application RuleApplication

the rule application that is activated

context ParseContext

the context in which the rule application is activated

initial bool

flag indicating whether the activation happened due to initial parse

OnContextChanged(RuleApplication, object, object, ParseContext)

Gets called when the parent rule application changes while the rule application is active

protected override bool OnContextChanged(RuleApplication ruleApplication, object oldContext, object newContext, ParseContext context)

Parameters

ruleApplication RuleApplication

the rule application whose parent changed

oldContext object
newContext object
context ParseContext

the context in which the parent changed

Returns

bool

true, if the context change is handled, otherwise false and the context change should be propagated further

OnDeactivate(RuleApplication, ParseContext)

Gets called when a rule application is deactivated

protected override void OnDeactivate(RuleApplication application, ParseContext context)

Parameters

application RuleApplication

the rule application that is deactivated

context ParseContext

the context in which the rule application is deactivated

OnValueChange(RuleApplication, ParseContext, RuleApplication)

Gets called when the value of a rule application changes

protected override bool OnValueChange(RuleApplication application, ParseContext context, RuleApplication oldRuleApplication)

Parameters

application RuleApplication

the rule application for which the value changed

context ParseContext

the context in which the value changed

oldRuleApplication RuleApplication

the old rule application

Returns

bool

true, if the rule processed the value change, otherwise false (in which case the value change is propagated)

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

the semantic element that shall be synthesized

position ParsePosition

the parse position at which the element should be synthesized

context ParseContext

the parse context

Returns

RuleApplication

a rule application