Class SiemensGotoSyntax
- Namespace
- Hi.NcParsers.EvaluationSyntaxs.Siemens
- Assembly
- HiMech.dll
Resolves Siemens GOTOF/GOTOB control flow — the
FanucGotoSyntax pattern with named-label targets
and explicit direction. Triggered by Parsing.SiemensGoto
(written by SiemensGotoParsingSyntax); decides whether
to fire, and on fire calls
ReplaceSource(IEnumerable<T>) on
layers[0] with the re-segmented file content starting at the
target label line (inclusive — a Siemens label may prefix code).
Direction comes from the mnemonic and drives the anchored
LabelScanUtil overload: GOTOF takes the first
match strictly below the host line, GOTOB the nearest match
strictly above it — never the whole-file first match, which would
silently mis-target duplicate label texts. Targets may be a named
label (LBL1: line, matched Ordinal-exact on the block-root
SiemensLabel record) or an N<num> block
number (matched on Number).
The conditional forms (IF <cond> GOTOF <label>)
lean on VariableEvaluatorSyntax's pass-2 tree walk;
ReadCondition(JsonNode) (a dialect-neutral
numeric-JSON reader despite its home) reads the resolved node.
Truthy fires; zero falls through silently; unresolved warns
SiemensGoto--ConditionNotEvaluated and falls through. Because
the label field is an ordinary Parsing string, a label name that
collides with a set named variable may have been substituted to a
numeric by the evaluator — the original text is then recovered from
the Formula.SiemensGoto.Label mirror.
Pipeline placement: Evaluation bundle, in the control-flow group
after VariableEvaluatorSyntax. The
SiemensGotoIterationDependency watchdog caps fired
jumps per (file, label); a missing watchdog disables the cap
(Fanuc parity).
public class SiemensGotoSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
SiemensGotoSyntax
- Implements
- Inherited Members
- Extension Methods
Constructors
SiemensGotoSyntax()
Parameterless instance with default probe syntaxes.
public SiemensGotoSyntax()
SiemensGotoSyntax(XElement, string, IProgress<IMessage>)
Loads hosted probe syntaxes from XML produced by
MakeXmlSource(string, string, bool). The <LabelProbeSyntaxes>
wrapper contains one child element per probe syntax in source
order; an absent wrapper falls back to the default list.
public SiemensGotoSyntax(XElement src, string baseDirectory, IProgress<IMessage> progress)
Parameters
srcXElementRoot element named XName.
baseDirectorystringProject base directory propagated to child XFactory calls.
progressIProgress<IMessage>Diagnostic sink propagated to child factories.
Properties
LabelProbeSyntaxes
Ordered list of helper syntaxes run on each candidate block during
the label scan before the predicate is checked. Defaults match the
Siemens probe stack established by the P4 REPEAT scan:
TailCommentSyntax (strip ; comments so a
commented-out label never matches), HeadIndexSyntax
with symbol “N” (so N100 block-number targets
resolve and a numbered label line still exposes its label), then
SiemensLabelSyntax (block-root
SiemensLabel record). Order matters: comment
stripper first, label parser last.
public List<ISituNcSyntax> LabelProbeSyntaxes { get; set; }
Property Value
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