Class SiemensRepeatSyntax
- Namespace
- Hi.NcParsers.EvaluationSyntaxs.Siemens
- Assembly
- HiMech.dll
Executes the Siemens REPEAT StartLabel EndLabel [P=n] section
repeat: the host file is re-segmented from the top, the
[StartLabel: … EndLabel:) slice is cut out (start-label line
included — it may carry trailing code; end-label line excluded), and
the slice is prepended into layers[0] once per repetition via
PrependSource(IEnumerable<T>). “Return to the line
after REPEAT” is the natural pipeline tail — the M98-inline pattern —
so no return frame or rewind is needed (Siemens end labels are
passive, unlike Fanuc's END m which actively fires a syntax).
Label scanning reuses LabelScanUtil's predicate overload with a Siemens probe stack (TailCommentSyntax + HeadIndexSyntax + SiemensLabelSyntax) and matches on the block-root SiemensLabel record. Each repetition is its own segmentation pass with a fresh fileIndex — downstream syntaxes mutate block JSON in place, so repetitions must not share piece instances. Every inlined block is stamped with a SiemensRepeat clone carrying its 1-based Iteration.
Fail-soft paths (consume + structured warning + no motion): missing end label in the statement (single-label form — corpus count zero, not simulated), start/end label not found in the file, a slice that contains the REPEAT line itself (would re-fire forever — real Sinumerik programs place REPEAT after the end label), and missing runtime dependencies. The repetition count is known eagerly, so no iteration watchdog is needed.
public class SiemensRepeatSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
SiemensRepeatSyntax
- Implements
- Inherited Members
- Extension Methods
Constructors
SiemensRepeatSyntax()
Parameterless instance (no XML state).
public SiemensRepeatSyntax()
SiemensRepeatSyntax(XElement)
XML ctor (no child elements; reserved for forward compatibility).
public SiemensRepeatSyntax(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.
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