Class SiemensMcallSyntax
- Namespace
- Hi.NcParsers.ParsingSyntaxs.Siemens
- Assembly
- HiMech.dll
Captures a Siemens MCALL modal-call statement whole into a
Parsing.MCALL sub-object:
MCALL CYCLE81(500.,327.9137,0.5,324.564,,,0,1,0) →
{ “CycleName”: “CYCLE81”, “Args”: ["500.", …] }; a bare
MCALL (modal cancel) → { “Bare”: true }; a
parenthesis-less callee (MCALL L123) keeps
CycleName without Args. The Logic consumer
(SiemensModalCycleSyntax) maps the
supported CYCLE8x family onto the shared canned-cycle modal
machinery and warns on everything else.
Whole-statement owner: MCALL lines are standalone in the corpus, and
owning the full statement keeps the cycle's positional arguments away
from the assignment / tag-value syntaxes (same shredding hazard as
SiemensCycleCallSyntax, whose argument grammar —
including complete quoted runs — is reused verbatim). Must run
before SiemensCycleCallSyntax: a whitelisted cycle name
after MCALL would otherwise be captured bare-of-context and
strand the MCALLL word. A line mixing MCALL with other tokens
does not match and falls through whole to the visible unparsed
warning.
public class SiemensMcallSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
SiemensMcallSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
Modal drilling-cycle arm (Operate 9-arg extension form):
#BeforeBuild.UnparsedText: MCALL CYCLE81(500.,327.9137,0.5,324.564,,,0,1,0)
#AfterBuild:
{
"Parsing": {
"MCALL": {
"CycleName": "CYCLE81",
"Args": ["500.", "327.9137", "0.5", "324.564", "", "", "0", "1", "0"]
}
}
}
Bare cancel:
#BeforeBuild.UnparsedText: MCALL
#AfterBuild:
{
"Parsing": { "MCALL": { "Bare": true } }
}
Parenthesis-less callee (recorded; the Logic consumer warns):
#BeforeBuild.UnparsedText: MCALL L123
#AfterBuild:
{
"Parsing": { "MCALL": { "CycleName": "L123" } }
}
Constructors
SiemensMcallSyntax()
Parameterless instance (no XML state).
public SiemensMcallSyntax()
SiemensMcallSyntax(XElement)
XML ctor (no child elements; reserved for forward compatibility).
public SiemensMcallSyntax(XElement src)
Parameters
Fields
CycleNameKey
Sub-object key holding the modal callee's name.
public const string CycleNameKey = "CycleName"
Field Value
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