Class SiemensFrameStatementSyntax
- Namespace
- Hi.NcParsers.ParsingSyntaxs.Siemens
- Assembly
- HiMech.dll
Captures a whole Siemens frame statement (TRANS/ATRANS/ROT/AROT/
ROTS/AROTS/SCALE/ASCALE/MIRROR/AMIRROR, bare or with arguments)
into a Parsing.<keyword> sub-object. Sinumerik requires
frame instructions in a block of their own, so the whole remaining
line belongs to the statement.
The consumed keywords (TRANS/ATRANS/ROT/AROT — see
SiemensProgrammableFrameSyntax)
are captured structured: each argument token becomes a
sub-key — glued axis words (X0, Y90.) and equals forms
(RPL=45, Z=R5) both supported. Literal values are
stored as JSON numbers; non-literal right-hand sides stay strings so
VariableEvaluatorSyntax resolves them
in the Evaluation stage (AROT Z=R5 →
Parsing.AROT = { "Z": "R5" }). A token outside the modeled
grammar makes the whole statement fall back to the verbatim
StatementKey capture — never a half-consumed line.
The remaining keywords (ROTS/AROTS/SCALE/ASCALE/MIRROR/AMIRROR
— zero corpus occurrences, no simulation) keep the verbatim
{ "Statement": "<args>" } quarantine; the Logic consumer
reports them as recognized-but-not-simulated. Either way the axis
words are kept out of reach of the quote/context-blind tag-value
syntaxes below, which would otherwise mint them into
Parsing.X/Y/Z and let ProgramXyzSyntax
turn a frame statement into a very real ghost rapid.
Deferred-but-unmodeled must mean "no transform yet", never
"extra motion".
Must be placed early in the Parsing bundle — after
BlockSkipSyntax, before every assignment / tag-value
syntax (the ROT RPL=45 shape would otherwise feed
NamedVarAssignmentSyntax).
public class SiemensFrameStatementSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
SiemensFrameStatementSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
Translation with arguments — structured capture, literal axis words
become JSON numbers:
#BeforeBuild.UnparsedText: TRANS X0 Y0 Z0
#AfterBuild:
{
"Parsing": { "TRANS": { "X": 0, "Y": 0, "Z": 0 } }
}
Bare cancel form — marker instead of an empty sub-object (empty
sub-objects would be swept by intermediate CleanupParsing
calls, silently dropping the cancel signal):
#BeforeBuild.UnparsedText: ROT
#AfterBuild:
{
"Parsing": { "ROT": { "Bare": true } }
}
Additive rotation — corpus shape:
#BeforeBuild.UnparsedText: AROT Y90.
#AfterBuild:
{
"Parsing": { "AROT": { "Y": 90 } }
}
In-plane rotation via the equals form:
#BeforeBuild.UnparsedText: ROT RPL=45
#AfterBuild:
{
"Parsing": { "ROT": { "RPL": 45 } }
}
Non-literal right-hand side stays a string for the Evaluation-stage
variable evaluator:
#BeforeBuild.UnparsedText: AROT Z=R5
#AfterBuild:
{
"Parsing": { "AROT": { "Z": "R5" } }
}
Unmodeled keyword keeps the verbatim quarantine (record-only):
#BeforeBuild.UnparsedText: ROTS X30 Y40
#AfterBuild:
{
"Parsing": { "ROTS": { "Statement": "X30 Y40" } }
}
A token outside the modeled grammar (here an unknown key) makes the
whole statement fall back to the verbatim capture — no axis is
half-consumed and the residue stays visible:
#BeforeBuild.UnparsedText: TRANS X10 CFINE=2
#AfterBuild:
{
"Parsing": { "TRANS": { "Statement": "X10 CFINE=2" } }
}
Constructors
SiemensFrameStatementSyntax()
Initializes a new instance with default settings.
public SiemensFrameStatementSyntax()
SiemensFrameStatementSyntax(XElement)
Initializes a new instance by deserializing from the given XML element.
public SiemensFrameStatementSyntax(XElement src)
Parameters
srcXElementSource XML element.
Fields
BareKey
Marker key for the bare (argument-less, i.e. cancel) form — keeps
the sub-object non-empty so intermediate CleanupParsing
sweeps cannot drop the signal.
public const string BareKey = "Bare"
Field Value
StatementKey
Sub-object key holding the verbatim statement arguments (fallback / record-only shape).
public const string StatementKey = "Statement"
Field Value
StructuredKeywords
Keywords whose arguments are captured structured (axis sub-keys) because SiemensProgrammableFrameSyntax consumes them. The remaining Hi.NcParsers.ParsingSyntaxs.Siemens.SiemensFrameStatementSyntax.FrameRegex keywords stay on the verbatim StatementKey capture (record-only).
public static readonly string[] StructuredKeywords
Field Value
- string[]
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