Class InlineDelimiterSegmenter
- Namespace
- Hi.NcParsers.Segmenters
- Assembly
- HiMech.dll
Segments NC lines by an inline delimiter (e.g. ';'). A line containing the delimiter produces multiple Sentences, each with a precise FileLineCharIndexSegment. Lines without the delimiter produce a single Sentence.
public class InlineDelimiterSegmenter : ISegmenter, IToXElement
- Inheritance
-
InlineDelimiterSegmenter
- Implements
- Inherited Members
- Extension Methods
Constructors
InlineDelimiterSegmenter()
Creates an InlineDelimiterSegmenter using DefaultDelimiter.
public InlineDelimiterSegmenter()
InlineDelimiterSegmenter(char)
Creates an InlineDelimiterSegmenter with a custom delimiter character.
public InlineDelimiterSegmenter(char delimiter)
Parameters
delimiterchar
Fields
DefaultDelimiter
Default delimiter: ';'.
public static readonly char DefaultDelimiter
Field Value
Properties
Delimiter
The inline delimiter character.
public char Delimiter { get; }
Property Value
Name
Display name of this segmenter.
public string Name { get; }
Property Value
XName
XML element name used to register and serialize this segmenter.
public static string XName { get; }
Property Value
Methods
GetSentences(LazyLinkedList<IndexedFileLine>, List<INcDependency>, NcDiagnosticProgress)
Segments the indexed file lines into Sentences.
public IEnumerable<Sentence> GetSentences(LazyLinkedList<IndexedFileLine> indexedFileLines, List<INcDependency> ncDependencyList, NcDiagnosticProgress ncDiagnosticProgress)
Parameters
indexedFileLinesLazyLinkedList<IndexedFileLine>The lazy linked list of indexed file lines.
ncDependencyListList<INcDependency>Dependency list of the owning runner; segmenters that consume header rows (e.g. CsvSegmenter) read host-wired dependencies from here. May be null in lightweight test fixtures — implementations that need a dependency must null-check.
ncDiagnosticProgressNcDiagnosticProgressDiagnostic progress reporter.
Returns
- IEnumerable<Sentence>
A sequence of Sentences.
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
ToXElement()
Get the XElement to represent the object.
public XElement ToXElement()