Table of Contents

Class HeidenhainGotoSyntax

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

Resolves Heidenhain FN 9–12 conditional jumps — the FanucGotoSyntax pattern with klartext LBL targets and a structural condition. Triggered by Parsing.HeidenhainGoto (written by HeidenhainGotoParsingSyntax); 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 — the definition marker is consumed by HeidenhainSubProgramReturnSyntax downstream).

The condition is compared here, not by the expression grammar: the parsing owner pre-normalised the statement into two value operands plus a shared comparison word (the P2 decision that keeps the Heidenhain dialect free of comparison/logical layers). Each operand is read polymorphically — numeric (typed at capture for literals, or substituted in place by VariableEvaluatorSyntax for resolved Q references) fires the comparison; a still-string operand means unresolved (the FN 18 SYSREAD target staying vacant is the designed source) and the jump warns HeidenhainGoto--ConditionNotEvaluated and falls through — no fabricated values, both endings stay fail-soft.

The label scan is whole-file first-match through the runner's own segmenter (SegmenterDependency) with the P4 call-path probe stack — klartext has no direction mnemonic and a TNC label is unique per program, so the anchored directional overloads would add a distinction the language does not have. Numeric labels canonicalize ("01"1); GOTO LBL 0 targets the end-of-subprogram sentinel and is refused (HeidenhainGoto--Lbl0Target, the HeidenhainSubProgramCallSyntax precedent). Jumps hosted inside a P4 inlined body (CALL LBL/CALL PGM splice or a REP section pass) are recognized but not simulated — the redirect would discard the pending inline tail (HeidenhainGoto--InlinedContextUnsupported, the Siemens P5 guard).

Pipeline placement: tail of the Heidenhain Evaluation bundle, after VariableEvaluatorSyntax (operand substitution) and the Q reader. The HeidenhainGotoIterationDependency watchdog caps fired jumps per (file, label); a missing watchdog disables the cap (Fanuc parity).

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

Constructors

HeidenhainGotoSyntax()

Parameterless instance with default probe syntaxes.

public HeidenhainGotoSyntax()

HeidenhainGotoSyntax(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 HeidenhainGotoSyntax(XElement src, string baseDirectory, IProgress<IMessage> progress)

Parameters

src XElement

Root element named XName.

baseDirectory string

Project base directory propagated to child XFactory calls.

progress IProgress<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 P4 call-path probe stack of HeidenhainSubProgramCallSyntax: HeidenhainTildeTrimSyntax (strip ~ continuation heads), TailCommentSyntax with ";" (a commented-out label never matches), HeadIndexSyntax with the bare klartext block-number symbol, then HeidenhainLblSyntax (whose definition regex excludes the CALL LBL and GOTO LBL spellings — a jump line is never a candidate). Order matters: strippers first, label parser last.

public List<ISituNcSyntax> LabelProbeSyntaxes { get; set; }

Property Value

List<ISituNcSyntax>

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