Class HeidenhainSegmenter
- Namespace
- Hi.NcParsers.Segmenters
- Assembly
- HiMech.dll
Heidenhain NC block builder. Also support single line NC block.
Two grouping rules produce multi-line Sentences:
- Trailing
~continuation (modern TNC cycle definitions): a line whose last visible character is~continues on the next physical line; the chain ends at the first line without a trailing~. Both corpus spellings are accepted —"… ;STRATEGIE ~"(space before, after a trailing comment) and"DATUM SETTING~"(glued). Continuation lines carry no klartext block number. Configurable via JoinTildeContinuations (default on — files using~are simply mis-simulated without it, so legacy XML without the attribute also gets the join). - Repeated command head (Hi.NcParsers.Segmenters.HeidenhainSegmenter.BlockKeywordList,
default
CYCL DEF): consecutive lines sharing the sameCYCL DEF nhead group into one sentence (7.0/7.1/…style).
~ characters stay in the raw BlockText
(write-back authority); the Parsing bundle strips them from
UnparsedText via
HeidenhainTildeTrimSyntax.
public class HeidenhainSegmenter : ISegmenter, IToXElement
- Inheritance
-
HeidenhainSegmenter
- Implements
- Inherited Members
- Extension Methods
Constructors
HeidenhainSegmenter()
Creates a HeidenhainSegmenter with the default block-keyword list.
public HeidenhainSegmenter()
Properties
JoinTildeContinuations
Joins lines ending with the TNC ~ continuation character into
one sentence. On by default; an XML source without the attribute also
defaults to on — the join is a capability fix (house.H-style cycle
definitions are unparsable without it), not a behavioral contract a
legacy project could depend on.
public bool JoinTildeContinuations { get; set; }
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()