Class SiemensLabelSyntax
- Namespace
- Hi.NcParsers.ParsingSyntaxs.Siemens
- Assembly
- HiMech.dll
Consumes a Siemens label at block start (LBL1: — identifier
followed by a colon, optionally after the N head index) into a
block-root SiemensLabel record. Labels are passive jump
targets: in the normal flow the record is pure bookkeeping (no motion,
no state), while SiemensRepeatSyntax
uses this same syntax as its LabelScanUtil
probe and matches candidates on SiemensLabel.Name. Writing the
record at the block root (not under Parsing) keeps the passive
token out of UnconsumedCheckSyntax's
audit without needing a Logic-layer consumer — mirroring how
SiemensDefStatementSyntax leaves no Parsing.Def
entry behind.
Anchored at the start of the remaining unparsed text, so a label
buried mid-line is not captured (Sinumerik allows one label per block,
at block start). Text after the colon stays in
UnparsedText for the rest of the
pipeline — LBL1: G1 X0 executes its trailing motion normally.
The probe usage requires this syntax to stay self-sufficient: it reads
only UnparsedText and never touches the dependency list.
public class SiemensLabelSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
SiemensLabelSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
Plain label line (trailing whitespace tolerated):
#BeforeBuild.UnparsedText: LBL1:
#AfterBuild:
{
"SiemensLabel": { "Name": "LBL1" }
}
Label with trailing code — the remainder stays for the pipeline:
#BeforeBuild.UnparsedText: MARK_A: G1 X0
#AfterBuild:
{
"UnparsedText": "G1 X0",
"SiemensLabel": { "Name": "MARK_A" }
}
A colon further into the line is not a label — nothing is captured:
#BeforeBuild.UnparsedText: G1 X0 LBL1:
#AfterBuild:
{
"UnparsedText": "G1 X0 LBL1:"
}
Constructors
SiemensLabelSyntax()
Parameterless instance (no XML state).
public SiemensLabelSyntax()
SiemensLabelSyntax(XElement)
XML ctor (no child elements; reserved for forward compatibility).
public SiemensLabelSyntax(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