Table of Contents

Class HeidenhainGotoParsingSyntax

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

Captures the Heidenhain FN 9–12 conditional jump statement whole into Parsing.HeidenhainGoto. All four opcodes share one phrase shape (FN n: IF <value> <comparator> <value> GOTO LBL <label>); both the spaced standard spelling and the compressed post spelling (FN12:IF+Q94 LT+1GOTOLBL"SLOW_FEED" — glued opcode head, glued value/target run, quoted name label) are recognised.

Pre-normalisation happens here, per the P2 expression-grammar decision (the Heidenhain dialect deliberately has no comparison layer): the comparator spelling collapses to the shared comparison words (EQUEQ), and the two operands are captured as separate values — a pure numeric literal is typed numeric at capture (the P0 GetParsedDouble-string-trap discipline), a Q reference stays a string for VariableEvaluatorSyntax's pass-2 substitution. The comparison and the label redirect happen in HeidenhainGotoSyntax.

Placement: whole-statement owner right after HeidenhainCallSyntax — before HeidenhainLblSyntax (whose definition regex already excludes the GOTO LBL spellings, but the jump owner claiming the full line first keeps the exclusion a backstop rather than a load-bearing gate) and before HeidenhainFnFeatureSyntax (whose FN 9–12 pass-through remains the malformed-jump safety net: a line this regex rejects surfaces as visible residue, never a fabricated skip).

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

Examples

Spaced standard spelling — the literal operand is typed numeric at capture, the Q operand stays a string for the evaluator: #BeforeBuild.UnparsedText: FN 12: IF +Q1 LT +5 GOTO LBL 5 #AfterBuild:

{
  "Parsing": {
    "HeidenhainGoto": {
      "Term": "FN12",
      "Op": "LT",
      "Lhs": "+Q1",
      "Rhs": 5,
      "Label": "5"
    }
  }
}

Compressed post spelling (TongTai turbine form) — glued opcode head, glued value/target run, quoted name label (quotes stripped): #BeforeBuild.UnparsedText: FN12:IF+Q94 LT+1GOTOLBL"SLOW_FEED" #AfterBuild:

{
  "Parsing": {
    "HeidenhainGoto": {
      "Term": "FN12",
      "Op": "LT",
      "Lhs": "+Q94",
      "Rhs": 1,
      "Label": "SLOW_FEED"
    }
  }
}

FN 9 — the klartext EQU spelling normalises to the shared EQ comparison word: #BeforeBuild.UnparsedText: FN 9: IF +Q1 EQU +Q3 GOTO LBL “END_MK” #AfterBuild:

{
  "Parsing": {
    "HeidenhainGoto": {
      "Term": "FN9",
      "Op": "EQ",
      "Lhs": "+Q1",
      "Rhs": "+Q3",
      "Label": "END_MK"
    }
  }
}

FN 10 not-equal jump to a numeric label: #BeforeBuild.UnparsedText: FN 10: IF +Q5 NE +0 GOTO LBL 3 #AfterBuild:

{
  "Parsing": {
    "HeidenhainGoto": {
      "Term": "FN10",
      "Op": "NE",
      "Lhs": "+Q5",
      "Rhs": 0,
      "Label": "3"
    }
  }
}

FN 11 greater-than jump: #BeforeBuild.UnparsedText: FN 11: IF +Q2 GT +400 GOTO LBL 99 #AfterBuild:

{
  "Parsing": {
    "HeidenhainGoto": {
      "Term": "FN11",
      "Op": "GT",
      "Lhs": "+Q2",
      "Rhs": 400,
      "Label": "99"
    }
  }
}

Constructors

HeidenhainGotoParsingSyntax()

Parameterless instance (no XML state).

public HeidenhainGotoParsingSyntax()

HeidenhainGotoParsingSyntax(XElement)

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

public HeidenhainGotoParsingSyntax(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