Class FanucIfThen
Fanuc Custom Macro B IF [<cond>] THEN <body>
single-block conditional record. Stamped on the host block by
FanucIfThenSyntax after the gate
decision; produced earlier by
FanucIfThenParsingSyntax as a parsing-stage
sub-section (Parsing.FanucIfThen) carrying the raw captured fields
plus an internal PendingAssignments sub-object harvested from the
body text.
Spec: IF [bool-expr] THEN <stmt> executes <stmt>
only when the condition is truthy. Unlike FanucGoto's
conditional form there is no jump — the body affects the current block
only, no source splice, no label scan, no iteration watchdog. The most
common body shape is a single Custom Macro B assignment
(#nnn = <expr>); multiple assignments in one body are also
accepted and lifted together.
Condition is held as a string at parsing time so
VariableEvaluatorSyntax's pass-2 tree walk can substitute
it to a numeric JsonValue in place;
the FanucIfThenSyntax tail then reads the resolved node polymorphically
via the same ReadCondition shape used by
FanucGotoSyntax.
public class FanucIfThen
- Inheritance
-
FanucIfThen
- Inherited Members
- Extension Methods
Properties
Applied
Whether the body actually fired on this block. False on conditions that evaluated to zero, on conditions the evaluator could not resolve, and on bodies that did not parse as one or more assignments (a G-code-only body for example, currently unsupported and warned). The host block is preserved in either case so diagnostic readers can still see the IF-THEN call site.
public bool Applied { get; set; }
Property Value
BodyText
Raw body text after the THEN keyword, retained verbatim for
diagnostics and round-trip visibility. The structured sub-section
actually lifted on a truthy condition lives at
Parsing.FanucIfThen.PendingAssignments, populated by the
parsing syntax via NcSyntaxUtil's
GrabTagAssignment.
public string BodyText { get; set; }
Property Value
Condition
Raw boolean expression text from inside the IF [...] brackets.
String at parsing time;
VariableEvaluatorSyntax's pass-2 tree
walk substitutes a numeric literal in place when the expression
evaluates successfully. FanucIfThenSyntax reads the resulting
JSON node polymorphically (number → truthy gate; remaining string →
unevaluated warning).
public string Condition { get; set; }