Class SiemensQuotedStatementSyntax
- Namespace
- Hi.NcParsers.ParsingSyntaxs.Siemens
- Assembly
- HiMech.dll
Quote guard: any line text still carrying a double quote after the
literal-form consumers (SiemensMsgSyntax,
SiemensToolCallSyntax, SiemensCycleCallSyntax)
have run is quarantined whole into
Parsing.QuotedStatement = { “Statement”: “<verbatim>” } —
WRITE(ERROR,“CUTTIME”,“T5 X100”), string-concatenation
MSG("..."<<R1), quoted-argument cycles not yet whitelisted.
Every quote-blind syntax below (flags, numbered flags, tag values,
assignments) opens a token boundary at the quote→letter transition,
so without this guard the string contents get minted into REAL parser
state: "G54" inside a WRITE argument silently switches the
active work offset, "T5 X100" mints a ghost tool call plus a
ghost motion. Quarantining keeps the whole statement visible as one
Parsing--Unconsumed entry (QuotedStatement.Statement)
with zero state changes — the same deferred-not-corrupted contract as
SiemensFrameStatementSyntax. Proper consumers (WRITE,
CYCLE800 quoted args) replace this guard per statement family later.
Trade-off, deliberate: on an exotic mixed block the guard also takes the co-resident plain words (a motion word sharing the block with an unconsumed quoted call goes into the quarantine too). Losing them is visible in the warning text; minting false state would be silent — never trade the first for the second. Corpus quoted statements (WRITE, non-literal MSG) are standalone blocks.
public class SiemensQuotedStatementSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
SiemensQuotedStatementSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
WRITE with quoted arguments — quarantined whole; nothing reaches the
tag-value syntaxes:
#BeforeBuild.UnparsedText: WRITE(ERROR,“CUTTIME”,“T5 X100”)
#AfterBuild:
{
"Parsing": { "QuotedStatement": { "Statement": "WRITE(ERROR,\"CUTTIME\",\"T5 X100\")" } }
}
Non-literal MSG (string concatenation) — the literal-form
SiemensMsgSyntax deliberately skipped it, so the guard
takes it:
#BeforeBuild.UnparsedText: MSG(“G54 REACHED”<<R1)
#AfterBuild:
{
"Parsing": { "QuotedStatement": { "Statement": "MSG(\"G54 REACHED\"<<R1)" } }
}
Constructors
SiemensQuotedStatementSyntax()
Initializes a new instance with default settings.
public SiemensQuotedStatementSyntax()
SiemensQuotedStatementSyntax(XElement)
Initializes a new instance by deserializing from the given XML element.
public SiemensQuotedStatementSyntax(XElement src)
Parameters
srcXElementSource XML element.
Fields
SectionKey
Parsing key the quarantined statement is stored under.
public const string SectionKey = "QuotedStatement"
Field Value
StatementKey
Sub-object key holding the verbatim statement text.
public const string StatementKey = "Statement"
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