Class SubProgramReturnSyntax
- Namespace
- Hi.NcParsers.EvaluationSyntaxs
- Assembly
- HiMech.dll
Consumes Fanuc-style M99 subprogram-return blocks.
In the inline model used by SubProgramCallSyntax, a
plain M99 at the end of a subprogram is implicit: the
inlined blocks are followed in layers[0] by the caller's
next block, so the natural pipeline traversal already does the
"return". This syntax therefore only consumes the M99 flag (so
UnconsumedCheckSyntax doesn't warn)
and records a SubProgramReturn section for cache-dump
visibility.
M99 P{seq} (return to caller's N{seq} sequence
number) is captured in P but not yet
honoured — the subprogram tail still proceeds straight into the
caller's next block. Implementing the jump requires a forward scan
of the post-host caller blocks for a matching N{seq} head
index, then dropping the intervening blocks; deferred until the
caller-side walk semantics are designed.
Pipeline placement: anywhere after Parsing has populated
Parsing.M99. Conventionally placed alongside
SubProgramCallSyntax at the head of the Evaluation
bundle so call/return live next to each other.
Detection is on the Parsing.M99 sub-object written by
M99Syntax
(a ParameterizedFlagSyntax) — the keyword
"M99" never reaches Parsing.Flags because the
parameterized match has already consumed the text by the time
NumberedFlagSyntax runs.
public class SubProgramReturnSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
SubProgramReturnSyntax
- Implements
- Inherited Members
- Extension Methods
Constructors
SubProgramReturnSyntax()
Parameterless instance for bundle composition (no XML state).
public SubProgramReturnSyntax()
SubProgramReturnSyntax(XElement)
XML ctor (no child elements; reserved for forward compatibility).
public SubProgramReturnSyntax(XElement src)
Parameters
Properties
Name
Syntax kind name (typically the concrete type name).
public string Name { get; }
Property Value
XName
XML element name used to register this syntax with XFactory.
public static string XName { get; }
Property Value
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
syntaxPieceNodeLazyLinkedListNode<SyntaxPiece>ncDependencyListList<INcDependency>ncDiagnosticProgressNcDiagnosticProgress
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
baseDirectorystringThe base directory for resolving relative paths
relFilestringThe relative file path for the XML source
exhibitionOnlyboolif 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.