Table of Contents

Class SubProgramCallSyntax

Namespace
Hi.NcParsers.EvaluationSyntaxs
Assembly
HiMech.dll

Inlines a Fanuc-style subprogram into the source layer when an M98 or M198 host block is reached. M98 P_ L_ reads the matching O<P> file from InternalFolder; M198 P_ reads from ExternalFolder (Fanuc external-storage call — same mechanism as M98, different lookup root). The file is segmented through the host runner's segmenter (SegmenterDependency) and the resulting SyntaxPieces are prepended into layers[0] via PrependSource(IEnumerable<T>); the rest of the pipeline picks them up through ordinary walkNode.Next traversal as if they had always been part of the host file.

Pipeline placement: first child of the Fanuc Evaluation BundleSyntax. By the time this runs, M98Syntax / M198Syntax (each a ParameterizedFlagSyntax) have written a Parsing.M98 / Parsing.M198 sub-object carrying the captured P / L parameters. Note: those sub-objects are this syntax's only trigger — "M98" / "M198" never reach Parsing.Flags, because the parameterized match has already consumed the text by the time NumberedFlagSyntax runs.

Filename lookup uses a fallback chain: O{P:D4}.NC, O{P}.NC, O{P:D4}, O{P}, {P:D4}.NC, {P}.NC — first match wins. Case-insensitive match is delegated to the host filesystem (Windows is, Linux is not).

L > 1 inlines the same subprogram L times in series. Each repetition is a fresh segmentation pass so each block gets its own SyntaxPiece with an independent JSON object — the downstream pipeline mutates JSON in place and would clobber sibling repetitions if instances were shared.

Not yet supported: M99 P{seq} early return inside a subprogram and partial-program calls (M98 P{seq}{prog} split encoding). Custom Macro B argument-binding calls (G65 / G66 / G67) live in FanucMacroCallSyntax and FanucModalMacroSyntax — those handle the argument-letter-to-#1..#26 binding and the macro-call frame isolation that M98 deliberately does not provide.

public class SubProgramCallSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
Inheritance
SubProgramCallSyntax
Implements
Inherited Members
Extension Methods

Constructors

SubProgramCallSyntax()

Parameterless instance for bundle composition (no XML state).

public SubProgramCallSyntax()

SubProgramCallSyntax(XElement)

XML ctor (no child elements; reserved for forward compatibility).

public SubProgramCallSyntax(XElement src)

Parameters

src XElement

Root element named XName.

Properties

Name

Syntax kind name (typically the concrete type name).

public string Name { get; }

Property Value

string

XName

XML element name used to register this syntax with XFactory.

public static string XName { get; }

Property Value

string

Methods

Build(LazyLinkedListNode<SyntaxPiece>, List<INcDependency>, NcDiagnosticProgress)

Build syntax arrangement into the syntaxPieceNode in-place.

public void Build(LazyLinkedListNode<SyntaxPiece> syntaxPieceNode, List<INcDependency> ncDependencyList, NcDiagnosticProgress ncDiagnosticProgress)

Parameters

syntaxPieceNode LazyLinkedListNode<SyntaxPiece>
ncDependencyList List<INcDependency>
ncDiagnosticProgress NcDiagnosticProgress

MakeXmlSource(string, string, bool)

Creates an XML representation of the object. This method may also generate additional resources such as related files.

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

Parameters

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

exhibitionOnly bool

if true, the extended file creation is suppressed.

Returns

XElement

An XML element representing the object's state

Remarks

For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied. The baseDirectory is typically the folder at the nearest configuration file folder. Since the folder can be moving with the configuration file.

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