Table of Contents

Class SiemensMsgSyntax

Namespace
Hi.NcParsers.ParsingSyntaxs.Siemens
Assembly
HiMech.dll

Consumes a Siemens MSG(“text”) operator display call (or the bare MSG() clear form) from the unparsed line text into a block-root Msg section, and surfaces the text as a Msg–Display system message.

Must be placed before every assignment / tag-value / flag syntax in the Parsing bundle (right after TailCommentSyntax / BlockSkipSyntax): the quoted argument routinely contains NC-shaped tokens (MSG("TOOL=5"), MSG("G54 OK"), MSG("T20 R8.000 CR:2.500")) which the quote-blind consumers downstream would otherwise shred into ghost assignments, flags, or axis words. Consuming the whole call here removes that hazard structurally — the planned fix recorded on NcSyntaxUtil's assignment RHS-boundary notes.

Only the two literal forms are consumed: MSG("...") and MSG(). Non-literal arguments (string concatenation MSG("A"<<R1), variable interpolation) are deliberately left whole in UnparsedText for the visible UnparsedText--Remaining warning — half-eating them would silently lose content.

public class SiemensMsgSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
Inheritance
SiemensMsgSyntax
Implements
Inherited Members
Extension Methods

Examples

Plain display message — whole call consumed, text recorded: #BeforeBuild.UnparsedText: MSG(“ROUGHING”) #AfterBuild:

{
  "Msg": { "Text": "ROUGHING" }
}

Bare clear form — section recorded without Text: #BeforeBuild.UnparsedText: MSG() #AfterBuild:

{
  "Msg": {}
}

Mixed line — the surrounding motion words stay parseable; quoted NC-shaped tokens (TOOL=5) never reach the assignment syntaxes: #BeforeBuild.UnparsedText: G01 X10 MSG(“TOOL=5”) #AfterBuild:

{
  "UnparsedText": "G01 X10",
  "Msg": { "Text": "TOOL=5" }
}

Constructors

SiemensMsgSyntax()

Initializes a new instance with default settings.

public SiemensMsgSyntax()

SiemensMsgSyntax(XElement)

Initializes a new instance by deserializing from the given XML element.

public SiemensMsgSyntax(XElement src)

Parameters

src XElement

Source XML element.

Properties

Name

Syntax kind name (typically the concrete type name).

public string Name { get; }

Property Value

string

XName

XML element name used to register this syntax with XFactory.

public static string XName { get; }

Property Value

string

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

syntaxPieceNode LazyLinkedListNode<SyntaxPiece>
ncDependencyList List<INcDependency>
ncDiagnosticProgress NcDiagnosticProgress

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

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

exhibitionOnly bool

if 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

factory XFactory