Class FloatTagValueSyntax
- Namespace
- Hi.NcParsers.ParsingSyntaxs
- Assembly
- HiMech.dll
TagValueSyntax that parses numeric literal values to double. Variable text (e.g. Q2, #1, [#1+#2]) remains as string.
public class FloatTagValueSyntax : TagValueSyntax, ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
FloatTagValueSyntax
- Implements
- Inherited Members
- Extension Methods
Constructors
FloatTagValueSyntax(IEnumerable<string>, IEnumerable<string>, string)
Initializes a new instance with the given category path, tag list, and variable-tag pattern.
public FloatTagValueSyntax(IEnumerable<string> categoryPath, IEnumerable<string> tags, string variableTag)
Parameters
categoryPathIEnumerable<string>JSON path under
Parsingwhere matches are written.tagsIEnumerable<string>Single-letter tag names whose values are grabbed.
variableTagstringRegex/literal recognizing a variable reference as a value.
FloatTagValueSyntax(XElement)
Initializes a new instance by deserializing from the given XML element.
public FloatTagValueSyntax(XElement src)
Parameters
srcXElementSource XML element.
Properties
XName
XML element name used to register this syntax with XFactory.
public static string XName { get; }
Property Value
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
factoryXFactory
ToFloat(string)
Parses a numeric literal to double; returns the original string for variable text.
public static JsonNode ToFloat(string setup)
Parameters
setupstring
Returns
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
setupstring