Table of Contents

Class ModelParseContext

Namespace
NMF.AnyText
Assembly
NMF.AnyText.dll

Denotes a parse context using model

public class ModelParseContext : ParseContext, IDisposable
Inheritance
ModelParseContext
Implements
Inherited Members

Constructors

ModelParseContext(Grammar, Matcher, StringComparison)

Creates a new instance

public ModelParseContext(Grammar grammar, Matcher matcher, StringComparison stringComparison = StringComparison.OrdinalIgnoreCase)

Parameters

grammar Grammar

the grammar for this context

matcher Matcher

the matcher for the context

stringComparison StringComparison

the string comparison mode

ModelParseContext(Grammar, StringComparison)

Creates a new instance

public ModelParseContext(Grammar grammar, StringComparison stringComparison = StringComparison.OrdinalIgnoreCase)

Parameters

grammar Grammar

the grammar for this context

stringComparison StringComparison

the string comparison mode

Methods

CreateRoot(RuleApplication)

Creates the root element for the given root rule application

protected override object CreateRoot(RuleApplication rootRuleApplication)

Parameters

rootRuleApplication RuleApplication

the root rule application

Returns

object

the created root object

GetPotentialReferences<T>(object, string)

Retrieves all potential references for a given context element.

public override IEnumerable<T> GetPotentialReferences<T>(object contextElement, string input)

Parameters

contextElement object

The context element.

input string

The input from the user

Returns

IEnumerable<T>

A collection of references.

Type Parameters

T

The type of references to retrieve.

TryResolveReference<T>(object, string, out T)

Resolves the given input

public override bool TryResolveReference<T>(object contextElement, string input, out T resolved)

Parameters

contextElement object

the element in the context of which the string is resolved

input string

the textual reference

resolved T

the resolved reference or the default

Returns

bool

true, if the reference could be resolved, otherwise false

Type Parameters

T