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”: truestatement marker (deliberately NOT the bareCkey — that is a rotary axis word which McAbcSyntax owns and consumes on rotary machines) gates HeidenhainCircularMotionSyntax, the rotation direction lands inParsing.DR("-"= CW = G02,"+"= CCW = G03) and radius-compensation words are captured like on L statements. The word-boundary head guard rejectsCC/CT/CR/CPstatements, and a value follower rejects a leading rotary-axis word — a DIN/ISO block likeC-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 nestedParsing.CCrecord — 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\bguard keeps aCstatement from matchingCCand 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 theParsingroot: 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/M140words stay in the text for their own captures.
- 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 14error display,FN 16print,FN 18SYSREAD, table/pallet opcodes …): the whole statement is consumed and a singleHeidenhainFn–Unsupportedwarning names the opcode. Two opcode families pass through untouched:FN 0-5belong to HeidenhainFnAssignmentSyntax (which runs earlier), and the jump familyFN 9-12belongs 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 NR11contains aQ94=token that the bare Q-assignment capture (later in the Parsing bundle) would otherwise grab, storing the garbage stringID50into 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 (
EQU→EQ), and the two operands are captured as separate values — a pure numeric literal is typed numeric at capture (the P0GetParsedDouble-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 LBLspellings, 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 theParsing.L = truestatement 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/LBLlines 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 ofLBL(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 richerLM140/LM128statements 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. TheLmarker is consumed by HeidenhainMotionModeSyntax which maps the statement (plus a one-shotFMAXflag) onto the shared G00/G01 motion-mode vocabulary.The radius-compensation words
RL/RR/R0are 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, gluedGOTOLBL) 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
M128word (RTCP on) together with its optional feed-limit argument (M128 F6000.) intoParsing.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 gluedM128F6000, 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 MBtool-axis retract statement intoParsing.M140 { MB, F? }.MB MAXretracts to the traverse limit (recorded as the string“MAX”);MB+nretracts bynmm along the tool axis. Handles the corpus formsM140 MB+50 F6000,L M140 MB MAX(M word carried on an L statement) and the gluedLM140 MB MAX(TongTai post). Must run before HeidenhainLSyntax (it claims the whole retract statement including a leadingL) 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 Xflips the X sign about the current datum,G28 X Yflips both, bareG28resets) — 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 underParsing.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.Ifile could carry — orG28 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]
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'sArgsso no token can leak to the shared tag captures (e.g. aPLANE AXIAL B+45B word must never become a rotary axis move).
MOVE DIST100 F8000is 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) andFUNCTION 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'sArgs— 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 likeF TCPcan never be misread as a feed word.
- HeidenhainTildeTrimSyntax
Strips the TNC
~line-continuation markers from a grouped sentence'sUnparsedText. 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…]