Table of Contents

Class FanucConditionReader

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

Shared polymorphic reader for Fanuc Custom Macro B conditional gate expressions (IF [...] GOTO, IF [...] THEN, WHILE [...] DO m). The condition node is read post-evaluation — VariableEvaluatorSyntax's pass-2 tree walk has already substituted the original expression string with a numeric JsonValue when evaluation succeeded; this helper maps that node to a tri-state truthy outcome plus a display form for diagnostics.

Three states, mapping directly to the ConditionEvaluated: true | false | null stamp shape used by all three consumers (see FanucGotoSyntax, FanucIfThenSyntax, and the WHILE-loop syntax):

  • Truthy = true — node is a finite non-zero numeric; gate fires.
  • Truthy = false — node is a finite numeric equal to zero; gate falls through silently.
  • Truthy = null — node is null, still a string (evaluator failed), or non-finite double (NaN / ±∞); gate falls through and the caller emits its own <Syntax>--ConditionNotEvaluated warning.

The Display form is the human-readable expression text for diagnostic messages. For resolved numerics it is the value formatted via InvariantCulture; for unresolved strings it is the original expression text. Diagnostics build their own message text — the helper just provides the source string so the caller can compose "IF [<Display>] GOTO ..." etc.

Callers typically DeepClone() the original node before passing in here, then again before stamping back, so removing the parsing section and writing the host-level stamp can happen in any order without dangling references.

public static class FanucConditionReader
Inheritance
FanucConditionReader
Inherited Members

Methods

ReadCondition(JsonNode)

Maps a post-evaluation condition JsonNode to a display string + tri-state truthy outcome. See class XmlDoc for the three states' definitions.

public static (string Display, bool? Truthy) ReadCondition(JsonNode node)

Parameters

node JsonNode

Returns

(string Display, bool? Truthy)