Table of Contents

Class IntegerTagValueSyntax

Namespace
Hi.NcParsers.ParsingSyntaxs
Assembly
HiMech.dll

TagValueSyntax that parses numeric literal values to int. Variable text (e.g. Q2, #1, [#1+#2]) remains as string.

public class IntegerTagValueSyntax : TagValueSyntax, ISituNcSyntax, INcSyntax, IMakeXmlSource
Inheritance
IntegerTagValueSyntax
Implements
Inherited Members
Extension Methods

Constructors

IntegerTagValueSyntax(IEnumerable<string>, IEnumerable<string>, string)

Initializes a new instance with the given category path, tag list, and variable-tag pattern.

public IntegerTagValueSyntax(IEnumerable<string> categoryPath, IEnumerable<string> tags, string variableTag)

Parameters

categoryPath IEnumerable<string>

JSON path under Parsing where matches are written.

tags IEnumerable<string>

Single-letter tag names whose values are grabbed.

variableTag string

Regex/literal recognizing a variable reference as a value.

IntegerTagValueSyntax(XElement)

Initializes a new instance by deserializing from the given XML element.

public IntegerTagValueSyntax(XElement src)

Parameters

src XElement

Source XML element.

Properties

XName

XML element name used to register this syntax with XFactory.

public static string XName { get; }

Property Value

string

Methods

Reg(XFactory)

Registers this type's deserializer with the given XFactory (or Default when factory is null). Idempotent.

public static void Reg(XFactory factory = null)

Parameters

factory XFactory

ToInteger(string)

Parses a numeric literal to int; returns the original string for variable text.

public static JsonNode ToInteger(string setup)

Parameters

setup string

Returns

JsonNode

ToValueJsonNode(string)

Converts a tag setup string value to a JsonNode. Override in derived classes for typed parsing (int, double). Variable text (e.g. Q2, #1, [#1+#2]) is kept as string.

protected override JsonNode ToValueJsonNode(string setup)

Parameters

setup string

Returns

JsonNode