Table of Contents

Class SyntaxPieceLayerDependency

Namespace
Hi.NcParsers.Dependencys.SystemWired
Assembly
HiMech.dll

Exposes the per-session SyntaxPiece layer chain (one LazyLinkedList<T> per pipeline stage, owned by NcRunnerSessionState) to syntaxes that need to inject additional source pieces mid-pipeline — most notably SubProgramCallSyntax, which inlines a subprogram file's blocks back into layers[0] immediately after the M98 host node so the entire syntax pipeline naturally re-processes them.

The actual layer list is resolved at runtime via Hi.NcParsers.Dependencys.SystemWired.SyntaxPieceLayerDependency.LayersProvider; RunControlLines(string, IEnumerable<string>, MachiningSession, SessionProgress, CancellationToken) wires the provider to the active session's SyntaxPieceLayers at the start of each call. Index 0 is the source layer (init seed + sentence-derived pieces); indices 1..N are post-NcSyntax layers — same convention as NcRunnerSessionState.

public class SyntaxPieceLayerDependency : INcDependency, IMakeXmlSource
Inheritance
SyntaxPieceLayerDependency
Implements
Inherited Members
Extension Methods

Constructors

SyntaxPieceLayerDependency()

Initializes a new instance with no Hi.NcParsers.Dependencys.SystemWired.SyntaxPieceLayerDependency.LayersProvider; the host runner assigns one before queries.

public SyntaxPieceLayerDependency()

SyntaxPieceLayerDependency(Func<List<LazyLinkedList<SyntaxPiece>>>)

Initializes a new instance with the given Hi.NcParsers.Dependencys.SystemWired.SyntaxPieceLayerDependency.LayersProvider.

public SyntaxPieceLayerDependency(Func<List<LazyLinkedList<SyntaxPiece>>> provider)

Parameters

provider Func<List<LazyLinkedList<SyntaxPiece>>>

Delegate that resolves the live layer chain at lookup time.

Properties

Layers

The live layer chain, or null when Hi.NcParsers.Dependencys.SystemWired.SyntaxPieceLayerDependency.LayersProvider is unset or returns null. Layer 0 is the source layer; layers 1..N are post-NcSyntax layers.

public List<LazyLinkedList<SyntaxPiece>> Layers { get; }

Property Value

List<LazyLinkedList<SyntaxPiece>>

XName

XML element name used to register this dependency with XFactory.

public static string XName { get; }

Property Value

string

Methods

MakeXmlSource(string, string, bool)

Runtime-only dependency — the Hi.NcParsers.Dependencys.SystemWired.SyntaxPieceLayerDependency.LayersProvider is wired per session and is not meaningful to persist; serialization writes only the empty element so the dependency survives an XML round-trip.

public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)

Parameters

baseDirectory string
relFile string
exhibitionOnly bool

Returns

XElement

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