488 lines
30 KiB
HTML
488 lines
30 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Namespace Hi.NcParsers.EvaluationSyntaxs.Fanuc | HiAPI-C# 2025 </title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="title" content="Namespace Hi.NcParsers.EvaluationSyntaxs.Fanuc | HiAPI-C# 2025 ">
|
|
|
|
|
|
<link rel="icon" href="../img/HiAPI.favicon.ico">
|
|
<link rel="stylesheet" href="../public/docfx.min.css">
|
|
<link rel="stylesheet" href="../public/main.css">
|
|
<meta name="docfx:navrel" content="../toc.html">
|
|
<meta name="docfx:tocrel" content="toc.html">
|
|
|
|
<meta name="docfx:rel" content="../">
|
|
|
|
|
|
|
|
<meta name="loc:inThisArticle" content="In this article">
|
|
<meta name="loc:searchResultsCount" content="{count} results for "{query}"">
|
|
<meta name="loc:searchNoResults" content="No results for "{query}"">
|
|
<meta name="loc:tocFilter" content="Filter by title">
|
|
<meta name="loc:nextArticle" content="Next">
|
|
<meta name="loc:prevArticle" content="Previous">
|
|
<meta name="loc:themeLight" content="Light">
|
|
<meta name="loc:themeDark" content="Dark">
|
|
<meta name="loc:themeAuto" content="Auto">
|
|
<meta name="loc:changeTheme" content="Change theme">
|
|
<meta name="loc:copy" content="Copy">
|
|
<meta name="loc:downloadPdf" content="Download PDF">
|
|
|
|
<script type="module" src="./../public/docfx.min.js"></script>
|
|
|
|
<script>
|
|
const theme = localStorage.getItem('theme') || 'auto'
|
|
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
|
|
<header class="bg-body border-bottom">
|
|
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
|
|
<div class="container-xxl flex-nowrap">
|
|
<a class="navbar-brand" href="../index.html">
|
|
<img id="logo" class="svg" src="../img/HiAPI.logo.png" alt="">
|
|
|
|
</a>
|
|
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
|
|
<i class="bi bi-three-dots"></i>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navpanel">
|
|
<div id="navbar">
|
|
<form class="search" role="search" id="search">
|
|
<i class="bi bi-search"></i>
|
|
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<main class="container-xxl">
|
|
<div class="toc-offcanvas">
|
|
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
|
|
<div class="offcanvas-header">
|
|
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
|
|
</div>
|
|
<div class="offcanvas-body">
|
|
<nav class="toc" id="toc"></nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="content">
|
|
<div class="actionbar">
|
|
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
|
|
<i class="bi bi-list"></i>
|
|
</button>
|
|
|
|
<nav id="breadcrumb"></nav>
|
|
</div>
|
|
|
|
<article data-uid="Hi.NcParsers.EvaluationSyntaxs.Fanuc">
|
|
|
|
<h1 id="Hi_NcParsers_EvaluationSyntaxs_Fanuc" data-uid="Hi.NcParsers.EvaluationSyntaxs.Fanuc" class="text-break">Namespace Hi.NcParsers.EvaluationSyntaxs.Fanuc</h1>
|
|
<div class="markdown level0 summary"></div>
|
|
<div class="markdown level0 conceptual"></div>
|
|
<div class="markdown level0 remarks"></div>
|
|
|
|
<h3 id="classes">
|
|
Classes
|
|
</h3>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucConditionReader.html">FanucConditionReader</a></dt>
|
|
<dd><p>Shared polymorphic reader for Fanuc Custom Macro B conditional gate
|
|
expressions (<code>IF [...] GOTO</code>, <code>IF [...] THEN</code>,
|
|
<code>WHILE [...] DO m</code>). The condition node is read post-evaluation —
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html">VariableEvaluatorSyntax</a>'s pass-2 tree walk has already
|
|
substituted the original expression string with a numeric
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.text.json.nodes.jsonvalue">JsonValue</a> when evaluation succeeded; this helper maps
|
|
that node to a tri-state truthy outcome plus a display form for
|
|
diagnostics.</p>
|
|
<p>
|
|
Three states, mapping directly to the
|
|
<code>ConditionEvaluated: true | false | null</code> stamp shape used by
|
|
all three consumers (see <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucGotoSyntax.html">FanucGotoSyntax</a>,
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucIfThenSyntax.html">FanucIfThenSyntax</a>, and the WHILE-loop syntax):
|
|
</p>
|
|
<ul><li><b>Truthy = true</b> — node is a finite non-zero numeric;
|
|
gate fires.</li><li><b>Truthy = false</b> — node is a finite numeric equal to
|
|
zero; gate falls through silently.</li><li><b>Truthy = null</b> — node is null, still a string
|
|
(evaluator failed), or non-finite double (NaN / ±∞); gate falls
|
|
through and the caller emits its own
|
|
<code><Syntax>--ConditionNotEvaluated</code> warning.</li></ul>
|
|
<p>
|
|
The <code>Display</code> form is the human-readable expression text for
|
|
diagnostic messages. For resolved numerics it is the value formatted
|
|
via <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo.invariantculture">InvariantCulture</a>; 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 <code>"IF [<Display>] GOTO ..."</code> etc.
|
|
</p>
|
|
<p>
|
|
Callers typically <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.text.json.nodes.jsonnode.deepclone">DeepClone()</a> 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.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucGotoSyntax.html">FanucGotoSyntax</a></dt>
|
|
<dd><p>Resolves Fanuc Custom Macro B GOTO control flow.
|
|
Triggered by <code>Parsing.FanucGoto</code> (written by
|
|
<a class="xref" href="Hi.NcParsers.ParsingSyntaxs.Fanuc.FanucGotoParsingSyntax.html">FanucGotoParsingSyntax</a>); decides whether
|
|
to fire, and on fire calls
|
|
<a class="xref" href="Hi.Common.Collections.LazyLinkedList-1.html#Hi_Common_Collections_LazyLinkedList_1_ReplaceSource_System_Collections_Generic_IEnumerable__0__">ReplaceSource(IEnumerable<T>)</a> on <code>layers[0]</code> with
|
|
the re-segmented file content starting at the matching <code>N{target}</code>
|
|
label. The host block stays materialised (so cache dumps still see the
|
|
GOTO call site); execution naturally continues from the new source
|
|
once the pipeline pulls the next block.</p>
|
|
<p>
|
|
Both unconditional <code>GOTO <n></code> and conditional
|
|
<code>IF [<expr>] GOTO <n></code> are implemented. The conditional
|
|
form leans on <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html">VariableEvaluatorSyntax</a>'s pass-2 tree walk
|
|
to substitute <code>Parsing.FanucGoto.Condition</code> with a numeric
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.text.json.nodes.jsonvalue">JsonValue</a> when the expression
|
|
evaluates successfully — <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucConditionReader.html#Hi_NcParsers_EvaluationSyntaxs_Fanuc_FanucConditionReader_ReadCondition_System_Text_Json_Nodes_JsonNode_">ReadCondition(JsonNode)</a>
|
|
then reads the node polymorphically. Truthy non-zero fires the
|
|
redirect; zero falls through silently; a still-string (unresolved)
|
|
Condition emits <code>FanucGoto--ConditionNotEvaluated</code> and falls
|
|
through.
|
|
</p>
|
|
<p>
|
|
Pipeline placement: tail of the Fanuc / Mazak / Syntec Evaluation
|
|
bundle. Must run after <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html">VariableEvaluatorSyntax</a> so any
|
|
<code>#<var></code> in the target N (e.g. <code>GOTO #1</code>) has been
|
|
substituted to a literal in <code>Parsing.FanucGoto.N</code>. Reader syntaxes
|
|
(<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VolatileVariableReadingSyntax.html">VolatileVariableReadingSyntax</a> etc.) are independent —
|
|
they touch <code>Parsing.Assignments</code>, not <code>Parsing.FanucGoto</code>.
|
|
</p>
|
|
<p>
|
|
Label scanning uses two hosted helper syntaxes —
|
|
<code>CommentSyntax</code> and <code>IndexSyntax</code> — applied to
|
|
each candidate block in turn so the predicate
|
|
<code>IndexNote.Number == target</code> matches the same way the Parsing
|
|
bundle would. Both are XML-IO-able so API customers can swap them
|
|
(e.g. for a controller variant using <code>;</code>-style comments or a
|
|
different head symbol). Defaults match Fanuc: <a class="xref" href="Hi.NcParsers.ParsingSyntaxs.CommentSyntaxs.QuoteCommentSyntax.html">QuoteCommentSyntax</a>
|
|
and <a class="xref" href="Hi.NcParsers.ParsingSyntaxs.HeadIndexSyntax.html">HeadIndexSyntax</a> with the <code>"N"</code> symbol.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucIfThenSyntax.html">FanucIfThenSyntax</a></dt>
|
|
<dd><p>Resolves Fanuc Custom Macro B <code>IF [<cond>] THEN <body></code>
|
|
single-block conditionals. Triggered by <code>Parsing.FanucIfThen</code>
|
|
(written by <a class="xref" href="Hi.NcParsers.ParsingSyntaxs.Fanuc.FanucIfThenParsingSyntax.html">FanucIfThenParsingSyntax</a>);
|
|
reads the now-resolved <a class="xref" href="Hi.NcParsers.Keywords.FanucIfThen.html#Hi_NcParsers_Keywords_FanucIfThen_Condition">Condition</a> node, decides
|
|
whether to fire, and on fire lifts the parsing-stage
|
|
<code>PendingAssignments</code> sub-object into the canonical
|
|
<code>Parsing.Assignments</code> bucket so the brand-specific reader syntaxes
|
|
downstream route each entry to its store the same way they would handle
|
|
an unconditional <code>#nnn = <literal></code> on a normal block.</p>
|
|
<p>
|
|
Unlike <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucGotoSyntax.html">FanucGotoSyntax</a> there is no source splice, no
|
|
label scan, no iteration watchdog — the spec restricts the body to the
|
|
current block. The host block is preserved either way (the stamped
|
|
<code>FanucIfThen</code> section on the host's top-level JSON keeps the
|
|
IF-THEN call site visible to cache dumps and diagnostics, with
|
|
<a class="xref" href="Hi.NcParsers.Keywords.FanucIfThen.html#Hi_NcParsers_Keywords_FanucIfThen_Applied">Applied</a> flipped true only on a successful
|
|
fire).
|
|
</p>
|
|
<p>
|
|
Pipeline placement: in the Evaluation bundle <b>after</b>
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html">VariableEvaluatorSyntax</a> (so the Condition expression has
|
|
been substituted in place by pass-2 tree walk, and each
|
|
<code>PendingAssignments</code> RHS string has been evaluated to a numeric
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.text.json.nodes.jsonvalue">JsonValue</a>) and <b>before</b> the reader syntaxes
|
|
(<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VolatileVariableReadingSyntax.html">VolatileVariableReadingSyntax</a>,
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.RetainedCommonVariableReadingSyntax.html">RetainedCommonVariableReadingSyntax</a>,
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucLocalVariableReadingSyntax.html">FanucLocalVariableReadingSyntax</a>,
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucSystemControlVariableSyntax.html">FanucSystemControlVariableSyntax</a>) — that ordering lets
|
|
the lifted entries reach the readers as if they had been written by
|
|
<a class="xref" href="Hi.NcParsers.ParsingSyntaxs.TagAssignmentSyntax.html">TagAssignmentSyntax</a> on a normal block.
|
|
</p>
|
|
<p>
|
|
Three condition outcomes mirror the
|
|
<code>FanucGotoSyntax.ReadCondition</code> shape:
|
|
<ul><li>Truthy non-zero → lift assignments, stamp Applied=true.</li><li>Truthy zero → fall through silently, Applied=false.</li><li>Truthy null (evaluator failed, condition still a string or
|
|
non-finite) → warn <code>FanucIfThen--ConditionNotEvaluated</code>, do not
|
|
lift, Applied=false.</li></ul>
|
|
A truthy condition with no PendingAssignments (body did not parse as
|
|
one or more assignments — e.g. a G-code body, currently unsupported)
|
|
warns <code>FanucIfThen--UnsupportedBody</code> and falls through.
|
|
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucLocalVariableReadingSyntax.html">FanucLocalVariableReadingSyntax</a></dt>
|
|
<dd><p>Routes literal-RHS assignments to Fanuc-style local macro variables
|
|
(<code>#1-#33</code>) from <code>Parsing.Assignments</code> into <code>Vars.Local</code>
|
|
on the current block, carrying the previous block's <code>Vars.Local</code>
|
|
dict forward when both blocks share the same
|
|
<a class="xref" href="Hi.NcParsers.Keywords.MacroFrame.html">MacroFrame</a> id. Mirrors
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VolatileVariableReadingSyntax.html">VolatileVariableReadingSyntax</a> for the
|
|
<code>#100-#499</code> range, with two differences:</p>
|
|
<ul><li>Carry is gated by <a class="xref" href="Hi.NcParsers.Keywords.MacroFrame.html">MacroFrame</a> equality, so a
|
|
caller block after a G65 return does not inherit the macro body's
|
|
final locals.</li><li>Writes outside a macro frame (a main-program block doing
|
|
<code>#11 = 5</code>) emit
|
|
<code>LocalVariable--MainFrameWriteUnsupported</code> and consume the
|
|
assignment without persisting — real Fanuc allows main-frame local
|
|
writes but this simulator only tracks locals inside G65/G66 call
|
|
frames; surfacing the gap as a diagnostic is more informative than
|
|
a silent
|
|
<a class="xref" href="Hi.NcParsers.InspectionSyntaxs.UnconsumedCheckSyntax.html">UnconsumedCheckSyntax</a> hit.</li></ul>
|
|
<p>
|
|
Pipeline placement: Evaluation bundle, after
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html">VariableEvaluatorSyntax</a> (so any expression RHS such as
|
|
<code>#11 = #1 + 1</code> has already been normalised to a literal by the
|
|
time this reader runs) and after the other range readers
|
|
(<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.RetainedCommonVariableReadingSyntax.html">RetainedCommonVariableReadingSyntax</a>,
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VolatileVariableReadingSyntax.html">VolatileVariableReadingSyntax</a>) so they all share a
|
|
similar Reader-stage shape.
|
|
</p>
|
|
<p>
|
|
Only literal numeric RHS values are consumed here; non-literal
|
|
entries (which can only persist if
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html">VariableEvaluatorSyntax</a> failed to resolve them) are
|
|
left untouched and surface via the evaluator's own
|
|
<code>VariableExpression--Unevaluated</code> diagnostic plus
|
|
<a class="xref" href="Hi.NcParsers.InspectionSyntaxs.UnconsumedCheckSyntax.html">UnconsumedCheckSyntax</a>.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucMacroArgumentMap.html">FanucMacroArgumentMap</a></dt>
|
|
<dd><p>Fanuc Custom Macro B Type-I argument-letter map: which call-line letter
|
|
binds to which <code>Vars.Local</code> id (<code>#1-#26</code>) inside the macro body.
|
|
Reserved letters (<code>G</code>, <code>L</code>, <code>N</code>, <code>O</code>, <code>P</code>) are
|
|
absent — they are consumed by the call itself, not passed through.</p>
|
|
<p>
|
|
Used by <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucMacroCallSyntax.html">FanucMacroCallSyntax</a> (G65, one-shot) and
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucModalMacroSyntax.html">FanucModalMacroSyntax</a> (G66, modal) to translate the
|
|
argument letters captured by <a class="xref" href="Hi.NcParsers.Syntaxs.FanucSyntaxUtil.html#Hi_NcParsers_Syntaxs_FanucSyntaxUtil_G65Syntax">G65Syntax</a>
|
|
/ <a class="xref" href="Hi.NcParsers.Syntaxs.FanucSyntaxUtil.html#Hi_NcParsers_Syntaxs_FanucSyntaxUtil_G66Syntax">G66Syntax</a> into the
|
|
<code>#nnn</code> bindings the macro body's expression evaluator can read.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucMacroCallSyntax.html">FanucMacroCallSyntax</a></dt>
|
|
<dd><p>Inlines a Fanuc Custom Macro B one-shot call (<code>G65 P_ L_ [letter
|
|
value …]</code>) into the source layer and binds the call-line argument
|
|
letters to <code>Vars.Local</code> <code>#1-#26</code> per the Type-I map (see
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucMacroArgumentMap.html">FanucMacroArgumentMap</a>). Every inlined block carries the
|
|
binding dict, a clone of the <a class="xref" href="Hi.NcParsers.Keywords.FanucMacroCall.html">FanucMacroCall</a> diagnostic
|
|
record, and a <a class="xref" href="Hi.NcParsers.Keywords.MacroFrame.html">MacroFrame</a> id stamp — so
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Evaluation.LocalVariableLookup.html">LocalVariableLookup</a> resolves arg references in a
|
|
single-block lookup, a cache dump landing on any block immediately
|
|
shows which call it belongs to, and downstream
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucLocalVariableReadingSyntax.html">FanucLocalVariableReadingSyntax</a> carries body-internal
|
|
<code>#1-#33</code> writes forward only within the same frame. The host
|
|
block itself records <a class="xref" href="Hi.NcParsers.Keywords.FanucMacroCall.html">FanucMacroCall</a> but stays in the
|
|
caller's frame (no <a class="xref" href="Hi.NcParsers.Keywords.MacroFrame.html">MacroFrame</a> stamp) and emits no
|
|
motion act; after the macro body's last inlined block the pipeline
|
|
continues naturally into the caller's next block (the inlined pieces
|
|
sit ahead of the host block's successor in <code>layers[0]</code>).</p>
|
|
<p>
|
|
Frame isolation works on two layers. Statically, caller blocks
|
|
have no <a class="xref" href="Hi.NcParsers.Keywords.MacroFrame.html">MacroFrame</a> stamp (frame id 0 by
|
|
<a class="xref" href="Hi.NcParsers.Keywords.MacroFrame.html#Hi_NcParsers_Keywords_MacroFrame_Get_System_Text_Json_Nodes_JsonObject_">Get(JsonObject)</a>), so the inlined frame ids (allocated
|
|
fresh per <code>L</code>-repetition) never collide with main. Dynamically,
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Evaluation.LocalVariableLookup.html">LocalVariableLookup</a> and
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucLocalVariableReadingSyntax.html">FanucLocalVariableReadingSyntax</a> compare frame ids
|
|
before carrying any <code>Vars.Local</code> entry across a block boundary
|
|
— a macro body's body-internal writes therefore stay inside the
|
|
macro and never leak back into the caller's frame.
|
|
</p>
|
|
<p>
|
|
Filename lookup mirrors <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.SubProgramCallSyntax.html">SubProgramCallSyntax</a>:
|
|
<code>O{P:D4}.NC</code>, <code>O{P}.NC</code>, <code>O{P:D4}</code>, <code>O{P}</code>,
|
|
<code>{P:D4}.NC</code>, <code>{P}.NC</code> — first match wins. The lookup root
|
|
is <a class="xref" href="Hi.NcParsers.Dependencys.Generic.SubProgramFolderConfig.html#Hi_NcParsers_Dependencys_Generic_SubProgramFolderConfig_InternalFolder">InternalFolder</a> (G65 has no
|
|
"external storage" variant; M198's external root is M98/M198-only).
|
|
</p>
|
|
<p>
|
|
<code>L > 1</code> inlines the same macro <code>L</code> times in series. Each
|
|
repetition is a fresh segmentation pass (so each block gets its own
|
|
<a class="xref" href="Hi.NcParsers.Syntaxs.SyntaxPiece.html">SyntaxPiece</a> JSON object — the downstream pipeline
|
|
mutates JSON in place and would clobber sibling repetitions if
|
|
instances were shared) and gets a fresh <code>FileIndex</code> (so
|
|
<code>(FileIndex, LineIndex)</code> pairs stay unique across the
|
|
<code>L</code>-copies of the same source lines).
|
|
</p>
|
|
<p>
|
|
Pipeline placement: ahead of <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.SubProgramCallSyntax.html">SubProgramCallSyntax</a> inside
|
|
the Fanuc <code>Evaluation</code> <a class="xref" href="Hi.NcParsers.Syntaxs.BundleSyntax.html">BundleSyntax</a>
|
|
so a hypothetical <code>G65 P_</code> + <code>M98 P_</code> on the same block
|
|
expands the G65 macro first (would be an unusual but legal
|
|
composition). Detection is on the <code>Parsing.G65</code> sub-object
|
|
written by <a class="xref" href="Hi.NcParsers.Syntaxs.FanucSyntaxUtil.html#Hi_NcParsers_Syntaxs_FanucSyntaxUtil_G65Syntax">G65Syntax</a>
|
|
(a <a class="xref" href="Hi.NcParsers.ParsingSyntaxs.ParameterizedFlagSyntax.html">ParameterizedFlagSyntax</a>) — the
|
|
keyword <code>"G65"</code> never reaches <code>Parsing.Flags</code> because the
|
|
parameterized match has already consumed the text by the time
|
|
<a class="xref" href="Hi.NcParsers.ParsingSyntaxs.NumberedFlagSyntax.html">NumberedFlagSyntax</a> runs.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucModalMacroSyntax.html">FanucModalMacroSyntax</a></dt>
|
|
<dd><p>Handles Fanuc Custom Macro B modal-call lifecycle (<code>G66</code> setup,
|
|
<code>G67</code> cancel, and per-motion-block implicit macro invocation).
|
|
The same class is registered twice in the pipeline via
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucModalMacroSyntax.html#Hi_NcParsers_EvaluationSyntaxs_Fanuc_FanucModalMacroSyntax_Phase">Phase</a> — once in the Evaluation bundle
|
|
(<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucModalMacroSyntax.SyntaxPhase.html#Hi_NcParsers_EvaluationSyntaxs_Fanuc_FanucModalMacroSyntax_SyntaxPhase_Setup">Setup</a>, captures G66/G67 edges and carries
|
|
the <a class="xref" href="Hi.NcParsers.Keywords.FanucModalMacro.html">FanucModalMacro</a> state block-to-block) and once in
|
|
the PostLogic bundle (<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucModalMacroSyntax.SyntaxPhase.html#Hi_NcParsers_EvaluationSyntaxs_Fanuc_FanucModalMacroSyntax_SyntaxPhase_Expansion">Expansion</a>, on every
|
|
motion block within an active G66 modal, inlines the macro body via
|
|
the same mechanism <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucMacroCallSyntax.html">FanucMacroCallSyntax</a> uses).</p>
|
|
<p>
|
|
Keeping both phases in one class makes the pairing visually explicit:
|
|
readers see "G66 in one file" and the two methods (<code>DoSetup</code>,
|
|
<code>DoExpansion</code>) make the lifecycle obvious. The two factory
|
|
helpers (<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucModalMacroSyntax.html#Hi_NcParsers_EvaluationSyntaxs_Fanuc_FanucModalMacroSyntax_Setup">Setup</a>, <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucModalMacroSyntax.html#Hi_NcParsers_EvaluationSyntaxs_Fanuc_FanucModalMacroSyntax_Expansion">Expansion</a>) mirror the
|
|
<code>ModalCarrySyntax.Logic</code> / <code>.PostLogic</code> pattern already in
|
|
the codebase.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucSystemControlVariableSyntax.html">FanucSystemControlVariableSyntax</a></dt>
|
|
<dd><p>Consumes Fanuc-style system-control variable assignments
|
|
(<code>#3000-#3999</code>) — alarm trigger (<code>#3000</code>), millisecond and
|
|
hour clocks (<code>#3001</code> / <code>#3002</code>), single-block / feed-hold
|
|
bypass flags (<code>#3003</code> / <code>#3004</code>), pause-with-message
|
|
(<code>#3006</code>), mirror-image flags (<code>#3007</code>), date / time
|
|
(<code>#3011</code> / <code>#3012</code>), tool-life data (<code>#3030</code> /
|
|
<code>#3032</code>), etc.</p>
|
|
<p>
|
|
Every id in this range is a controller-side state variable — its
|
|
authoritative value lives on the real hardware (RTC, alarm bus,
|
|
override switches, …) and an NC write at most triggers a side effect
|
|
(clock reset, alarm raise, message-pause prompt). Offline simulation
|
|
has none of that machinery, so this syntax does <b>not</b> emulate the
|
|
effect. Instead it:
|
|
</p>
|
|
<ol><li>records the literal write on the block JSON under
|
|
<code>Vars.SystemControl</code> (round-trip and cache-dump visibility);</li><li>emits a <code>FanucSystemControl--Unsupported</code>
|
|
<a class="xref" href="Hi.NcParsers.NcDiagnosticProgress.html#Hi_NcParsers_NcDiagnosticProgress_UnsupportedMessage_Hi_NcParsers_ISentenceCarrier_System_String_System_String_System_Object_">UnsupportedMessage(ISentenceCarrier, string, string, object)</a>
|
|
so the user knows the assignment was recognised but its controller-side
|
|
effect is not simulated. Message-severity (not Warning) because these
|
|
writes are safe no-ops offline — every consumed assignment would emit
|
|
a Warning per block, which would be noisy without signalling anything
|
|
the user must act on;</li><li>removes the entry from <code>Parsing.Assignments</code> so it does not
|
|
re-surface as a generic <code>Parsing--Unconsumed</code> diagnostic.</li></ol>
|
|
<p>
|
|
The dictionary carries forward block-by-block (same dict-merge pattern
|
|
as <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VolatileVariableReadingSyntax.html">VolatileVariableReadingSyntax</a>) so a downstream consumer
|
|
can read the most recent recorded value via <code>SyntaxPiece</code> linkage.
|
|
</p>
|
|
<p>
|
|
Only literal numeric RHS values are consumed; non-literal RHS
|
|
(e.g. <code>#3002 = #500</code>) is left in <code>Parsing.Assignments</code> for
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html">VariableEvaluatorSyntax</a> to resolve, mirroring the
|
|
retained / volatile reading syntaxes.
|
|
</p>
|
|
<p>
|
|
Fanuc-family only — Siemens uses named system variables
|
|
(<code>$AC_TIME</code>, <code>$A_DAY</code>, …) and Heidenhain uses
|
|
<code>FN18: SYSREAD</code>; neither flows through <code>Parsing.Assignments.#nnn</code>.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucWhileDoSyntax.html">FanucWhileDoSyntax</a></dt>
|
|
<dd><p>Resolves Fanuc Custom Macro B <code>WHILE [..] DO m ... END m</code>
|
|
bounded loops. Two phrases dispatched by
|
|
<a class="xref" href="Hi.NcParsers.Keywords.FanucWhileDo.html#Hi_NcParsers_Keywords_FanucWhileDo_Term">Term</a>:</p>
|
|
<ul><li><code>WHILE [..] DO m</code> — entry: reads the resolved condition
|
|
via <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucConditionReader.html">FanucConditionReader</a>, manages the per-LoopId
|
|
frame in the top-level <code>WhileFrames</code> dict, and either falls
|
|
through (truthy) or forward-jumps past the matching END m
|
|
(falsy / unresolved).</li><li><code>END m</code> — terminator: unconditionally reverse-jumps to
|
|
the WHILE block recorded in <code>WhileFrames[LoopId].BeginLineNo</code>
|
|
so the next iteration re-evaluates the entry condition. Increments
|
|
the per-loop iteration counter on
|
|
<a class="xref" href="Hi.NcParsers.Dependencys.Fanuc.FanucWhileDoIterationDependency.html">FanucWhileDoIterationDependency</a>; suppresses the
|
|
redirect above <a class="xref" href="Hi.NcParsers.Dependencys.Fanuc.FanucWhileDoIterationDependency.html#Hi_NcParsers_Dependencys_Fanuc_FanucWhileDoIterationDependency_MaxIterationsPerLoopId">MaxIterationsPerLoopId</a>.</li></ul>
|
|
<p>
|
|
<b>WhileFrames carrier.</b> The top-level <code>WhileFrames</code> JSON
|
|
section is a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.text.json.nodes.jsonobject">JsonObject</a> keyed by LoopId-as-string
|
|
whose values are <code>{ BeginLineNo: int }</code>. Frames are pushed when
|
|
a WHILE block first encounters a truthy condition with no existing
|
|
frame for that LoopId; popped when the condition becomes falsy or
|
|
unresolved; otherwise carried forward unchanged by
|
|
<a class="xref" href="Hi.NcParsers.PostLogicSyntaxs.ModalCarrySyntax.html">ModalCarrySyntax</a>'s
|
|
<a class="xref" href="Hi.NcParsers.PostLogicSyntaxs.ModalCarrySyntax.html#Hi_NcParsers_PostLogicSyntaxs_ModalCarrySyntax_Logic">Logic</a> tracked-key
|
|
list. Nested loops with distinct LoopIds coexist in the same dict;
|
|
same-LoopId nesting (spec-undefined) overwrites and is not given
|
|
special handling.
|
|
</p>
|
|
<p>
|
|
<b>Pipeline placement.</b> Evaluation bundle, after the variable
|
|
readers (defensive — WHILE/END blocks per spec do not carry
|
|
assignments, but the placement is consistent with GOTO). Must run
|
|
after <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html">VariableEvaluatorSyntax</a> so the condition string
|
|
has been substituted to numeric.
|
|
</p>
|
|
<p>
|
|
<b>Forward scan to matching END m</b> uses the
|
|
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.LabelScanUtil.html">LabelScanUtil</a> predicate overload — probe runs the
|
|
brand-default <a class="xref" href="Hi.NcParsers.ParsingSyntaxs.Fanuc.FanucWhileDoParsingSyntax.html">FanucWhileDoParsingSyntax</a> on each
|
|
candidate, predicate matches on
|
|
<code>Parsing.FanucWhileDo.Term == "END" && LoopId == target</code>.
|
|
</p>
|
|
<p>
|
|
<b>Reverse scan to WHILE BeginLineNo</b> does not need a label
|
|
predicate — the BeginLineNo is a known file-line index recorded in
|
|
the active frame, so the END side re-segments the file from the top
|
|
and returns the slice starting at the first piece whose
|
|
<a class="xref" href="Hi.NcParsers.Sentence.html#Hi_NcParsers_Sentence_CharIndexSegment">CharIndexSegment</a>.<code>Begin.LineIndex</code>
|
|
matches.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
<h3 id="enums">
|
|
Enums
|
|
</h3>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Fanuc.FanucModalMacroSyntax.SyntaxPhase.html">FanucModalMacroSyntax.SyntaxPhase</a></dt>
|
|
<dd><p>Identifies which pipeline phase the instance runs in. The two
|
|
values correspond to the Evaluation-bundle and PostLogic-bundle
|
|
registrations of this same syntax class.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
</article>
|
|
|
|
<div class="contribution d-print-none">
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="affix">
|
|
<nav id="affix"></nav>
|
|
</div>
|
|
</main>
|
|
|
|
<div class="container-xxl search-results" id="search-results"></div>
|
|
|
|
<footer class="border-top text-secondary">
|
|
<div class="container-xxl">
|
|
<div class="flex-fill">
|
|
<span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>
|