Table of Contents

Namespace Hi.NcParsers.ParsingSyntaxs.Heidenhain

Classes

HeidenhainBlkFormSyntax

Syntax for Heidenhain BLK FORM command (workpiece blank definition).

HeidenhainCSyntax

Heidenhain circular-motion statement (C X+5.361 Y+23.064 DR-). Mirrors HeidenhainLSyntax: endpoint axis words promote to the Parsing root (shared Logic consumers), a “CArc”: true statement marker (deliberately NOT the bare C key — that is a rotary axis word which McAbcSyntax owns and consumes on rotary machines) gates HeidenhainCircularMotionSyntax, the rotation direction lands in Parsing.DR ("-" = CW = G02, "+" = CCW = G03) and radius-compensation words are captured like on L statements. The word-boundary head guard rejects CC/CT/CR/CP statements, and a value follower rejects a leading rotary-axis word — a DIN/ISO block like C-90. (modal C-axis positioning, the same mixed-dialect list) is an axis coordinate for the root tag capture, never a klartext arc statement head (klartext always separates the C head from its X/Y/DR words, so a sign/digit/dot follower cannot be an arc statement).

HeidenhainCallSyntax

Syntax for Heidenhain CALL commands (CALL PGM and CALL LBL).

HeidenhainCcSyntax

Heidenhain circle-center statement (CC X+12.7 Y+12.7). The coordinates land in the nested Parsing.CC record — deliberately not on the Parsing root, where ProgramXyzSyntax would mistake the center for a motion endpoint. The Logic-stage HeidenhainCircleCenterSyntax turns the record into the modal circle-center section consumed by the arc syntax. Must run before HeidenhainCSyntax in the bundle (the \b guard keeps a C statement from matching CC and vice versa, but CC-first is the safe order).

HeidenhainCyclCallSyntax

Captures the klartext cycle-call statement into a Parsing[“CYCL CALL”] record:

  • CYCL CALL{ Bare: true }; any trailing M words stay in the text for the shared flag captures.
  • CYCL CALL POS X±n Y±n Z±n …{ Pos: true } plus the axis words grabbed into the record (never onto the Parsing root: the POS coordinates are the call position — the X/Y feed the ISO cycle section, while the pre-position Z must not be mistaken for the hole-bottom Z slot). FMAX/F/M140 words stay in the text for their own captures.
The call is consumed by HeidenhainCannedCycleSyntax, which converts the stored cycle definition into a direct ISO cycle sub-section on this block.
HeidenhainCyclDefSyntax

Initialization Syntax of Heidenhain fixed head block for

CYCL DEF
.
HeidenhainFnAssignmentSyntax

Heidenhain FN variable assignment syntax. Extends TagAssignmentSyntax with FN opcode prefix.

HeidenhainFnFeatureSyntax

Structured skip for the Heidenhain FN opcodes the simulation does not implement (FN 14 error display, FN 16 print, FN 18 SYSREAD, table/pallet opcodes …): the whole statement is consumed and a single HeidenhainFn–Unsupported warning names the opcode. Two opcode families pass through untouched: FN 0-5 belong to HeidenhainFnAssignmentSyntax (which runs earlier), and the jump family FN 9-12 belongs to HeidenhainGotoParsingSyntax (also earlier) — the pass-through here is the malformed-jump safety net: a jump line the owner's grammar rejects surfaces as visible residue instead of a fabricated skip.

Claiming the statement here is load-bearing, not cosmetic: an FN 18 line like FN18: SYSREAD Q94= ID50 NR11 contains a Q94= token that the bare Q-assignment capture (later in the Parsing bundle) would otherwise grab, storing the garbage string ID50 into Q94. The target parameter must instead stay vacant so dependent expressions fail soft (VariableExpression--Unevaluated) — no fabricated values.

HeidenhainGotoParsingSyntax

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).

HeidenhainLSyntax

Heidenhain linear movement (the leading L) syntax. Strips the leading L — spaced (L X+10) or glued directly to an axis/F word (LX+153.933Y+4.196A-77.516, the dominant shape of post-processed turbine files) — writes the Parsing.L = true statement marker, and grabs axis-tag values for any of AxisTagList (X, Y, Z, U, V, W, A, B, C) that appear afterwards as {axis}{signed-value} pairs; values are parsed as floats via ToFloat(string). LN/LP/LBL lines are excluded by the gate's lookahead: a glued axis letter only counts when followed by a sign, digit, dot or Q variable, so the B of LBL (followed by another L) never matches. Glued M words (LM09) are accepted — stripping the L exposes the M word for the numbered-flag syntax; the richer LM140/LM128 statements never reach this gate because their dedicated owners run earlier in the Heidenhain Parsing bundle.

Axis words land on the root of Parsing (not nested under L) so the shared Logic consumers — ProgramXyzSyntax, McAbcSyntax, MachineCoordSelectSyntax, IncrementalResolveSyntax — read them without per-brand path configuration. The L marker is consumed by HeidenhainMotionModeSyntax which maps the statement (plus a one-shot FMAX flag) onto the shared G00/G01 motion-mode vocabulary.

The radius-compensation words RL/RR/R0 are captured as boolean records on the Parsing root; the Logic-stage HeidenhainRadiusCompSyntax maps them onto the shared G41/G42/G40 vocabulary consumed by the radius compensation pass.

HeidenhainLblSyntax

Syntax for Heidenhain LBL command (label definition). Label can be a number (1-65535) or a text name (e.g., “MyLabel”). LBL 0 is reserved for end of subprogram.

Only a DEFINITION is captured: CALL LBL (any spacing) and the FN 9–12 jump spellings (GOTO LBL n, glued GOTOLBL) are excluded — this syntax doubles as the label-scan probe of the P4 call machinery, where mistaking a jump line (or the call line itself) for a definition splices the wrong program section.

HeidenhainM128Syntax

Captures the klartext M128 word (RTCP on) together with its optional feed-limit argument (M128 F6000.) into Parsing.M128 { F? }. Must run before the shared F tag-value syntax — the F belongs to M128 (feed limit for compensating movements), and letting it reach the Parsing root would pollute the modal feedrate (HardNc has exactly this defect). Accepted spellings: the leading/glued L statement (LM128, mirroring the M140 sibling), the fully glued M128F6000, and a Q-parameter feed limit (M128 FQ8, 1.H corpus) captured as the string token for the evaluator pass to resolve. M129 (RTCP off) carries no argument and stays on the shared numbered-flag path.

HeidenhainM140Syntax

Captures the klartext M140 MB tool-axis retract statement into Parsing.M140 { MB, F? }. MB MAX retracts to the traverse limit (recorded as the string “MAX”); MB+n retracts by n mm along the tool axis. Handles the corpus forms M140 MB+50 F6000, L M140 MB MAX (M word carried on an L statement) and the glued LM140 MB MAX (TongTai post). Must run before HeidenhainLSyntax (it claims the whole retract statement including a leading L) and before the shared F tag-value syntax (the F is the retract feed).

HeidenhainMirrorImageSyntax

Heidenhain DIN/ISO G28 = MIRROR IMAGE (the CYCL DEF 8 twin; basic course 62192: G28 X flips the X sign about the current datum, G28 X Y flips both, bare G28 resets) — the exact opposite of the Fanuc reference-point return the shared G28Syntax would read it as. Claims the whole statement (code plus trailing axis words) ahead of the generic kit and records each statement under Parsing.MirrorImageKey for the Logic-stage HeidenhainMirrorTransformSyntax, which simulates the mirror as a ProgramToMcTransform entry.

Axis words are the manual's bare letters; a glued numeric or Q-variable follower (G28 X0 Y0 — the Fanuc idiom a mislabeled .I file could carry — or G28 XQ1) is claimed too so the value can never fall through to the root tag captures as a ghost coordinate, and the statement is stamped ValuedKey so the Logic stage keeps it recognized-but-not-simulated (mirroring on the Fanuc-shaped form would wreck a mislabeled reference-return file). A bare axis letter glued to another word (G28 CC…) stops the claim run — the leftover surfaces through the residue sentinels instead of being guessed at.

HeidenhainPlaneSyntax

Syntax for the Heidenhain PLANE statement family. Fully structured (simulated by the Logic-stage tilt consumer):

  • PLANE RESET [STAY|MOVE|TURN]
  • PLANE SPATIAL SPA SPB SPC [SEQ±] [COORD ROT|TABLE ROT] [MOVE [DIST..] [F..]|TURN|STAY]
Recognized (captured with the same option set, simulated as recognized-but-not-simulated by the Logic consumer):
  • PLANE PROJECTED PROPR PROMIN ROT ...
  • PLANE VECTOR BX BY BZ NX NY NZ ... (corpus: 1.H)
  • PLANE EULER/POINTS/RELATIV/AXIAL ... — the mode word is captured and the unmodeled argument text is swept verbatim into the record's Args so no token can leak to the shared tag captures (e.g. a PLANE AXIAL B+45 B word must never become a rotary axis move).
Must run before the shared F tag-value syntax: the F of MOVE DIST100 F8000 is the repositioning feed and would otherwise pollute the modal feedrate (house.H corpus form; HardNc has exactly this defect).
HeidenhainProgramSyntax

Syntax for Heidenhain BEGIN PGM and END PGM commands.

HeidenhainTcpmSyntax

Captures the modern-TNC RTCP statement pair into Parsing.TCPM: FUNCTION TCPM [args] (RTCP on — the M128 successor) and FUNCTION RESET TCPM (RTCP off). The behavior-tuning argument words (F TCP / F CONT / AXIS POS / AXIS SPAT / PATHCTRL AXIS / PATHCTRL VECTOR) are corpus-zero and swept verbatim into the record's Args — recognized-but-not-simulated (the Logic RTCP consumer warns); activation/deactivation itself is simulated. Must run before the shared F tag-value syntax so an argument like F TCP can never be misread as a feed word.

HeidenhainTildeTrimSyntax

Strips the TNC ~ line-continuation markers from a grouped sentence's UnparsedText. The raw BlockText keeps them (write-back authority); parsing only needs the joined lines. Both corpus spellings are removed — "… ;STRATEGIE ~" (space before, line tail) and "DATUM SETTING~" (glued). Placed at the head of the Parsing bundle, before the comment strippers, so a trailing ~ after a ; comment never lands in the recorded comment text.

HeidenhainToolCallSyntax

Syntax for Heidenhain TOOL CALL command. Handles: TOOL CALL [ToolId|“ToolName”] [X|Y|Z] [S…] [DL…] [DR…]