Namespace Hi.NcParsers.ParsingSyntaxs
Classes
- BlockSkipSyntax
Parses the ISO 6983 / Fanuc Block Delete (a.k.a. Block Skip) prefix
/or/N(N = 1..9) at the head of an NC block.Behaviour:
- No leading
/→ no-op, no BlockSkip section is written. /with IBlockSkipConfig layer OFF (or the dependency absent) → prefix is consumed, BlockSkip Symbol/Layer recorded for audit, Body stays null; the rest of the block stays inUnparsedTextand parses normally./with layer ON → the remaining block text is moved fromUnparsedTextinto Body andUnparsedTextis cleared. Downstream parsing syntaxes see no NC text so they emit nothing; semantics therefore produce no act. Must run after comment / CsScript syntaxes so that comments (and CsScript embedded in comments) continue to take effect regardless of the skip switch.
- No leading
- CsScriptSyntax
Extracts C# script markers from the oral content of a comment. PreMarker marks a script that runs before the NC block; PostMarker marks a script that runs after. The symbols are configurable and serialized to XML.
- FlagSyntax
Syntax of fully Match flag.
- FloatTagValueSyntax
TagValueSyntax that parses numeric literal values to double. Variable text (e.g. Q2, #1, [#1+#2]) remains as string.
- HeadIndexSyntax
Parses a leading block index (e.g. Heidenhain line numbers) after an optional HeadSymbol prefix.
- IntegerTagValueSyntax
TagValueSyntax that parses numeric literal values to int. Variable text (e.g. Q2, #1, [#1+#2]) remains as string.
- NamedVarAssignmentSyntax
Assignment syntax for named (identifier-style) variables with = sign. Handles variables that are multi-character identifiers rather than {prefix}{digits}.
- NumberedFlagSyntax
Syntax for numbered flags (prefix + number) with optional decimal support. NumberedFlagSyntax often should place after something like ParameterizedFlagSyntax. Since NumberedFlagSyntax is easy to eat those kind of flags.
Single-digit integer codes are zero-padded to canonical 2-digit form (e.g.
M6→M06,G0→G00,M3→M03) so that downstream logic syntaxes comparing against IsoKeywords constants (which are always 2-digit form like M06) can match Fanuc-style omitted-leading-zero codes. Two-digit and decimal codes are kept as-is.
- ParameterizedFlagSyntax
Syntax for flags with attached parameters (e.g., G54.1P1, G10L2P1). This is essentially a combination of main flag matching (like NumberedFlagSyntax) plus scoped TagValueSyntax for the parameters after the main flag. Note that the ParameterizedFlagSyntax often should be applied before NumberedFlagSyntax since NumberedFlagSyntax may eat the text that ParameterizedFlagSyntax should handle.
- ProgramBoundarySyntax
Detects program boundary markers: leading
%tape header orOprogram number after a prior boundary, and records them under ProgramBoundary on the block JSON.
- ShrinkIfNoDecimalPointSyntax
Applies the “conventional type” decimal-point interpretation to coordinate values in UnparsedText. When a tag value has no decimal point (e.g.
Y20), it is shrunk by the implied decimal places:Y20→Y0.020(3 decimal places). Values that already contain a decimal point are left unchanged.Place inside BundleSyntax before FloatTagValueSyntax so the modified text is parsed correctly by subsequent syntaxes.
- TagAssignmentSyntax
Assignment syntax with = sign. Unlike TagValueSyntax which handles concatenated tag-value pairs (no = sign), this class handles explicit assignment statements.
- TagValueSyntax
Concatenated tag-value syntax (no = sign). ex. Heidenhain: L X Q2 Y33.4 FQ1 ISO: X100.3Y3.3