Table of Contents

Class ConvertRule<T>

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

Denotes a rule that applies custom conversions

public class ConvertRule<T> : RegexRule

Type Parameters

T
Inheritance
ConvertRule<T>
Derived
Inherited Members

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

Convert(string, ParseContext)

Converts the provided text to an element of type TElement

public virtual T Convert(string text, ParseContext context)

Parameters

text string

the input text

context ParseContext

the parse context

Returns

T

the parsed element

ConvertToString(T, ParseContext)

Converts the provided element to text

public virtual string ConvertToString(T semanticElement, ParseContext context)

Parameters

semanticElement T

the semantic element

context ParseContext

the parse context

Returns

string

the input text

CreateRuleApplication(string, ParsePosition, ParsePositionDelta, ParseContext)

Creates a new rule application

public override RuleApplication CreateRuleApplication(string matched, ParsePosition position, ParsePositionDelta examined, ParseContext context)

Parameters

matched string

the matched string content

position ParsePosition

the position where the rule matched

examined ParsePositionDelta

the examined length of text

context ParseContext

the parse context

Returns

RuleApplication

a rule application

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