Table of Contents

Namespace Hi.NcParsers

Classes

ControllerPresetWriter

Writes the built-in brand controller presets out as standalone SoftNcRunner resource files.

A controller resource file is one serialized SoftNcRunner — the whole pipeline (dependencies, segmenter, initializers, syntaxes, semantics) that decides how a brand's NC code is interpreted. The shipped copies live under Resource/Controller/ so the Object Management Load browser starts populated; they are regenerable snapshots, not the source of truth — the brand properties on SoftNcRunner are.

Writing needs no XFactory registration. Reading a file back does: call Reg(XFactory) first, otherwise XFactory.GenListSkippingUnloadable drops every unregistered pipeline entry and hands back a silently hollow runner.

NcCompositionGate

License gate for the NC composition layer — the capability of registering external (non-built-in) processing units into a SoftNcRunner pipeline, and of executing NC-embedded C# scripts (ActLineCsScript).

The boundary: the script layer (calling the public API from your own application code, e.g. session scripts) needs no extra license; the composition layer (registering or replacing processing units inside the interpretation pipeline — NcSyntaxList, PipelineNcDependencyList, NcSemanticList, NcInitializationList, Segmenter — or injecting per-line scripts into it) requires NcComposition.

A unit is built-in when its concrete type lives in this library's own assembly; anything else is external. Order, count, duplication and constructor configuration of built-in units are unrestricted — the gate never inspects the shape of the pipeline, only the identity of each unit.

Degradation is silent and functional: without the license the built-in dialects run unchanged; external units are skipped for the session and a single Composition--NotLicensed diagnostic lists them. The decision and its rejection record live in the native license module.

NcDiagnostic

A structured diagnostic from the SoftNcRunner pipeline, designed for IProgress<T> consumption. Implements IMessage so it shares the common message channel with SimpleMessage, step diagnostics, and progress fractions, while additionally carrying an NC-source SentenceCarrier anchor that non-NC messages do not have.

Also an ISentenceCarrier itself — GetSentence() and SentenceIndex delegate to SentenceCarrier so a diagnostic can be used directly anywhere a carrier is expected, without the consumer unwrapping the inner anchor.

Id is composed as {Primary}-{Secondary}--{Abbrev} (e.g., Cycle-Peck--BadPeckQ, Syntax-Build--Exception). For irregular cases that don't fit the pattern, use a custom string.

NcDiagnosticProgress

Helper that emits NcDiagnostic records — retaining them in Diagnostics (their canonical home) and forwarding each to an IProgress<T> of IMessage sink for live consumption. Provides one method per (Category, Severity) pair, each with an optional Sentence overload locating the issue in the NC source. Each method has a *Fmt sibling taking a FormattableString that keeps the interpolated template and values (Format / Args) for client-side localization; the sibling must be opted into by name — an interpolated string literal passed to the string method binds to string and is not captured. A caller that runs a bounded operation (an NC play, a writeback run) can wrap it in BeginRepeatFold() so identical repeated diagnostics fold into a first occurrence plus one counted summary instead of flooding the sink.

NcRunnerSuit

A switchable “runner suit”: bundles the per-machine NC pipeline (SoftNcRunner plus its optional side-file path SoftNcRunnerFile) with the per-workpiece PerCaseNcDependencyList the runner's INcDependencyProxy placeholders resolve against. The suit is the proxies' INcDependencyListHost, so the runner and its case data switch together as one unit — load a different suit to switch the active parser (NC or CSV) within a session.

Read/Write only (pure IO, no own XxxFile identity pointer): the owning project serializes the suit's two members flat in the project XML, keeping the per-workpiece PerCaseNcDependencyList project-local rather than a shared side file.

Sentence

A small NC block for one or several lines.

SoftNcRunner

Configurable NC Runner.

SoftNcUtil

JSON helpers for soft-NC blocks: vectors under Parsing, motion-term queries, flag grab/remove on raw text, and unparsed-line trimming.

Interfaces

IGetSentence

Abstraction for a source that carries a Sentence.

ISentenceCarrier

Carries a reference to a source Sentence together with its execution-order SentenceIndex. Used as the cross-process alignment carrier for diagnostics, messages, ClStripPos, MachiningStep, etc. — both the source content (via GetSentence()) and the execution-order position (via SentenceIndex) are available without needing two separate references.

ISentenceIndexed

Abstraction for an object that carries a SentenceIndex — a 0-based ordinal of its source Sentence in NC execution order. Use as a cross-process alignment key (messages, ClStripPos, MachiningStep, etc.) when the (FileIndex, LineIndex) source order is not enough because SubProgram inline reorders blocks relative to source order.

ISessionResettable

Marker for objects that hold session-scoped runtime state which must be cleared when RunNcLines(string, IEnumerable<string>, MachiningSession, StepDiagnosticProgress, NcDiagnosticProgress, CancellationToken) initializes a new session pipeline (the state.IsInitialized == false edge).

Implementers may live on either chain: INcDependency or INcSyntax. SoftNcRunner scans PipelineNcDependencyList and NcSyntaxList on the session-init edge and calls OnSessionReset() on every match.

Distinct from IPowerResettable: power-reset clears retained-but-volatile state on a controller power cycle (e.g., Fanuc #100-#499), an edge that survives ordinary session boundaries. Session-reset clears state whose lifetime is one pipeline pass (iteration counters, file-index allocators, etc.).