Table of Contents

Class SiemensIfSyntax

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

Resolves the Siemens IF ... [ELSE ...] ENDIF block conditional. Three phrases dispatched by Term, none of which needs a frame stack:

  • IF — reads the resolved condition via FanucConditionReader (dialect-neutral numeric-JSON reader). True falls through into the then-branch; false forward-jumps to just after the matching ELSE (else-branch executes) or after the matching ENDIF when no else exists; unresolved warns SiemensIf--ConditionNotEvaluated and falls through (no redirect on unresolved input — the then-branch executes, and the ELSE rule below then skips the else-branch, which keeps the two branches mutually exclusive even on the fail-soft path).
  • ELSE — reached in the normal stream only when the then-branch just executed (a false IF jumps past the ELSE line directly), so it unconditionally forward-jumps past the matching ENDIF.
  • ENDIF — consumed no-op (stamped for cache dumps).

Both forward scans run on the anchored LabelScanUtil overload from the host line, with a nesting-depth predicate: each nested block-IF increments the depth, each ENDIF at depth > 0 decrements it, and the match fires only at depth 0. The probe stack replays the Parsing statement owners the depth counter depends on — including SiemensGotoParsingSyntax ahead of SiemensIfParsingSyntax, so a nested single-line IF cond GOTOF lbl is claimed by the GOTO owner and never miscounted as a block-IF.

Pipeline placement: Evaluation bundle control-flow group, after VariableEvaluatorSyntax (condition substituted) and before the variable readers.

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

Constructors

SiemensIfSyntax()

Parameterless instance (no XML state).

public SiemensIfSyntax()

SiemensIfSyntax(XElement)

XML ctor (no child elements; reserved for forward compatibility).

public SiemensIfSyntax(XElement src)

Parameters

src XElement

Root element named XName.

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