fix SoftNcRunner GM code normalization.
This commit is contained in:
@@ -0,0 +1,369 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Namespace Hi.NcParsers.EvaluationSyntaxs | HiAPI-C# 2025 </title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="title" content="Namespace Hi.NcParsers.EvaluationSyntaxs | 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">
|
||||
|
||||
<h1 id="Hi_NcParsers_EvaluationSyntaxs" data-uid="Hi.NcParsers.EvaluationSyntaxs" class="text-break">Namespace Hi.NcParsers.EvaluationSyntaxs</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.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_Sentence_System_String_System_String_System_Object_">UnsupportedMessage(Sentence, 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.RetainedCommonVariableReadingSyntax.html">RetainedCommonVariableReadingSyntax</a></dt>
|
||||
<dd><p>Obtains values for Fanuc-style retained common variables (<code>#500-#999</code>)
|
||||
by consuming literal numeric assignments from <code>Parsing.Assignments.#nnn</code>
|
||||
and writing them straight to a registered
|
||||
<a class="xref" href="Hi.NcParsers.Dependencys.Fanuc.RetainedCommonVariableTable.html">RetainedCommonVariableTable</a>.</p>
|
||||
<p>
|
||||
No SyntaxPiece JSON mirror is created — the table is the single source of
|
||||
truth for retained values, and <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html">VariableEvaluatorSyntax</a> reads
|
||||
from the table directly. The hincproj round-trip preserves writes across
|
||||
project sessions.
|
||||
</p>
|
||||
<p>
|
||||
Only literal numeric RHS values are consumed by this syntax
|
||||
(<code>#500 = 1.234</code> ✓; <code>#600 = #500 + 1</code> ✗). Non-literal RHS entries
|
||||
are left untouched in <code>Parsing.Assignments</code>; <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html">VariableEvaluatorSyntax</a>
|
||||
resolves them and writes the result through the same table. The two
|
||||
syntaxes are decoupled.
|
||||
</p>
|
||||
<p>
|
||||
If no <a class="xref" href="Hi.NcParsers.Dependencys.Fanuc.RetainedCommonVariableTable.html">RetainedCommonVariableTable</a> is registered on the
|
||||
runner's <code>NcDependencyList</code>, this syntax is a no-op.
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="jumplist">
|
||||
<dt><a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.SubProgramCallSyntax.html">SubProgramCallSyntax</a></dt>
|
||||
<dd><p>Inlines a Fanuc-style subprogram into the source layer when an M98 or
|
||||
M198 host block is reached. <code>M98 P_ L_</code> reads the matching
|
||||
<code>O<P></code> file from <a class="xref" href="Hi.NcParsers.Dependencys.Generic.SubProgramFolderConfig.html#Hi_NcParsers_Dependencys_Generic_SubProgramFolderConfig_InternalFolder">InternalFolder</a>;
|
||||
<code>M198 P_</code> reads from <a class="xref" href="Hi.NcParsers.Dependencys.Generic.SubProgramFolderConfig.html#Hi_NcParsers_Dependencys_Generic_SubProgramFolderConfig_ExternalFolder">ExternalFolder</a>
|
||||
(Fanuc external-storage call — same mechanism as M98, different lookup
|
||||
root). The file is segmented through the host runner's segmenter
|
||||
(<a class="xref" href="Hi.NcParsers.Dependencys.SystemWired.SegmenterDependency.html">SegmenterDependency</a>) and the resulting
|
||||
<a class="xref" href="Hi.NcParsers.Syntaxs.SyntaxPiece.html">SyntaxPiece</a>s are prepended into <code>layers[0]</code> via
|
||||
<a class="xref" href="Hi.Common.Collections.LazyLinkedList-1.html#Hi_Common_Collections_LazyLinkedList_1_PrependSource_System_Collections_Generic_IEnumerable__0__">PrependSource(IEnumerable<T>)</a>; the rest of the
|
||||
pipeline picks them up through ordinary <code>walkNode.Next</code>
|
||||
traversal as if they had always been part of the host file.</p>
|
||||
<p>
|
||||
Pipeline placement: first child of the Fanuc <code>Evaluation</code>
|
||||
<a class="xref" href="Hi.NcParsers.Syntaxs.BundleSyntax.html">BundleSyntax</a>. By the time this runs,
|
||||
<a class="xref" href="Hi.NcParsers.Syntaxs.FanucSyntaxUtil.html#Hi_NcParsers_Syntaxs_FanucSyntaxUtil_M98Syntax">M98Syntax</a> /
|
||||
<a class="xref" href="Hi.NcParsers.Syntaxs.FanucSyntaxUtil.html#Hi_NcParsers_Syntaxs_FanucSyntaxUtil_M198Syntax">M198Syntax</a>
|
||||
(each a <a class="xref" href="Hi.NcParsers.ParsingSyntaxs.ParameterizedFlagSyntax.html">ParameterizedFlagSyntax</a>) have written a
|
||||
<code>Parsing.M98</code> / <code>Parsing.M198</code> sub-object carrying the
|
||||
captured <code>P</code> / <code>L</code> parameters. Note: those sub-objects
|
||||
are this syntax's only trigger — <code>"M98"</code> / <code>"M198"</code>
|
||||
never reach <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>
|
||||
<p>
|
||||
Filename lookup uses a fallback chain:
|
||||
<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. Case-insensitive
|
||||
match is delegated to the host filesystem (Windows is, Linux is not).
|
||||
</p>
|
||||
<p>
|
||||
L > 1 inlines the same subprogram <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> with an independent JSON object — the
|
||||
downstream pipeline mutates JSON in place and would clobber sibling
|
||||
repetitions if instances were shared.
|
||||
</p>
|
||||
<p>
|
||||
Not yet supported: <code>M99 P{seq}</code> early return inside a
|
||||
subprogram, partial-program calls (<code>M98 P{seq}{prog}</code> split
|
||||
encoding), and arg binding (G65 macro is a separate syntax).
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="jumplist">
|
||||
<dt><a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.SubProgramReturnSyntax.html">SubProgramReturnSyntax</a></dt>
|
||||
<dd><p>Consumes Fanuc-style <code>M99</code> subprogram-return blocks.</p>
|
||||
<p>
|
||||
In the inline model used by <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.SubProgramCallSyntax.html">SubProgramCallSyntax</a>, a
|
||||
plain <code>M99</code> at the end of a subprogram is implicit: the
|
||||
inlined blocks are followed in <code>layers[0]</code> by the caller's
|
||||
next block, so the natural pipeline traversal already does the
|
||||
"return". This syntax therefore only consumes the M99 flag (so
|
||||
<a class="xref" href="Hi.NcParsers.InspectionSyntaxs.UnconsumedCheckSyntax.html">UnconsumedCheckSyntax</a> doesn't warn)
|
||||
and records a <a class="xref" href="Hi.NcParsers.Keywords.SubProgramReturn.html">SubProgramReturn</a> section for cache-dump
|
||||
visibility.
|
||||
</p>
|
||||
<p>
|
||||
<code>M99 P{seq}</code> (return to caller's <code>N{seq}</code> sequence
|
||||
number) is captured in <a class="xref" href="Hi.NcParsers.Keywords.SubProgramReturn.html#Hi_NcParsers_Keywords_SubProgramReturn_P">P</a> but not yet
|
||||
honoured — the subprogram tail still proceeds straight into the
|
||||
caller's next block. Implementing the jump requires a forward scan
|
||||
of the post-host caller blocks for a matching <code>N{seq}</code> head
|
||||
index, then dropping the intervening blocks; deferred until the
|
||||
caller-side walk semantics are designed.
|
||||
</p>
|
||||
<p>
|
||||
Pipeline placement: anywhere after Parsing has populated
|
||||
<code>Parsing.M99</code>. Conventionally placed alongside
|
||||
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.SubProgramCallSyntax.html">SubProgramCallSyntax</a> at the head of the Evaluation
|
||||
bundle so call/return live next to each other.
|
||||
</p>
|
||||
<p>
|
||||
Detection is on the <code>Parsing.M99</code> sub-object written by
|
||||
<a class="xref" href="Hi.NcParsers.Syntaxs.FanucSyntaxUtil.html#Hi_NcParsers_Syntaxs_FanucSyntaxUtil_M99Syntax">M99Syntax</a>
|
||||
(a <a class="xref" href="Hi.NcParsers.ParsingSyntaxs.ParameterizedFlagSyntax.html">ParameterizedFlagSyntax</a>) — the keyword
|
||||
<code>"M99"</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.VariableEvaluatorSyntax.html">VariableEvaluatorSyntax</a></dt>
|
||||
<dd><p>Pure expression normalizer for Custom Macro B syntax. Walks the
|
||||
parser-stage residue on a single block and inlines numeric values
|
||||
wherever a Fanuc-style variable reference or bracket expression
|
||||
appears — but does <b>not</b> write to any specific store. Routing
|
||||
“where the resolved literal lands” stays in the brand-specific
|
||||
reader syntaxes (<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VolatileVariableReadingSyntax.html">VolatileVariableReadingSyntax</a>,
|
||||
<a class="xref" href="Hi.NcParsers.Dependencys.Fanuc.RetainedCommonVariableTable.html">RetainedCommonVariableTable</a>'s reader,
|
||||
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.FanucSystemControlVariableSyntax.html">FanucSystemControlVariableSyntax</a>, …) which run
|
||||
<i>after</i> this syntax on the same block.</p>
|
||||
<p>
|
||||
Two passes per block:
|
||||
</p>
|
||||
<ol><li>
|
||||
<b>Assignments normalize</b> — <code>Parsing.Assignments.#nnn</code> entries
|
||||
whose RHS is non-literal (e.g. <code>"#500+1"</code>, <code>"SQRT[#100]"</code>)
|
||||
are evaluated via the <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html">VariableEvaluatorSyntax.ChainLookup</a> and the RHS string is
|
||||
replaced with the resolved literal (round-trip-safe
|
||||
<code>"R"</code>-format). The entry stays in <code>Parsing.Assignments</code> so
|
||||
downstream reader syntaxes consume it as a pure-literal assignment.
|
||||
Iteration follows source order (Parsing.Assignments insertion order).
|
||||
</li><li>
|
||||
<b>Parsing tree substitution</b> — every string-typed value reachable
|
||||
from <code>Parsing.<tag></code> (axis tags, canned-cycle sub-objects)
|
||||
is parsed; on a successful evaluation the string is replaced with a
|
||||
numeric <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.text.json.nodes.jsonvalue">JsonValue</a>. Failures silently leave the original
|
||||
string and rely on downstream
|
||||
<a class="xref" href="Hi.NcParsers.SoftNcUtil.html#Hi_NcParsers_SoftNcUtil_GetParsedDouble_System_Text_Json_Nodes_JsonObject_System_String_Hi_NcParsers_Sentence_Hi_NcParsers_NcDiagnosticProgress_">GetParsedDouble(JsonObject, string, Sentence, NcDiagnosticProgress)</a> at consumer sites to surface
|
||||
<code>VariableExpression--Unevaluated</code> only if the tag is actually read.
|
||||
</li></ol>
|
||||
<p>
|
||||
Lookup chain (first non-null wins, configured per brand preset via
|
||||
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html#Hi_NcParsers_EvaluationSyntaxs_VariableEvaluatorSyntax_RuntimeVariableLookups">RuntimeVariableLookups</a> + <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Evaluation.IVariableLookup.html">IVariableLookup</a>
|
||||
instances on <code>NcDependencyList</code>):
|
||||
</p>
|
||||
<ol><li><b>Current block's own resolved assignments</b> — built-in to
|
||||
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html">VariableEvaluatorSyntax.ChainLookup</a>; covers same-block forward references in
|
||||
source order (an earlier <code>#nnn=literal</code> is visible to a later
|
||||
RHS that mentions <code>#nnn</code>).</li><li>Each <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Evaluation.IRuntimeVariableLookup.html">IRuntimeVariableLookup</a> in
|
||||
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html#Hi_NcParsers_EvaluationSyntaxs_VariableEvaluatorSyntax_RuntimeVariableLookups">RuntimeVariableLookups</a>, in list order. Typical contents
|
||||
for a Fanuc-family preset:
|
||||
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Evaluation.LocalVariableLookup.html">LocalVariableLookup</a> (<code>#1-#33</code>),
|
||||
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Evaluation.VolatileVariableLookup.html">VolatileVariableLookup</a> (<code>#100-#499</code>),
|
||||
<a class="xref" href="Hi.NcParsers.Dependencys.Fanuc.FanucPositionVariableLookup.html">FanucPositionVariableLookup</a>
|
||||
(<code>#5001-#5043</code>).</li><li>Each <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Evaluation.IVariableLookup.html">IVariableLookup</a> on the runner's
|
||||
<code>NcDependencyList</code>, in registration order
|
||||
(<a class="xref" href="Hi.NcParsers.Dependencys.Fanuc.RetainedCommonVariableTable.html">RetainedCommonVariableTable</a>,
|
||||
<a class="xref" href="Hi.NcParsers.Dependencys.Fanuc.FanucParameterTable.html">FanucParameterTable</a>,
|
||||
<a class="xref" href="Hi.NcParsers.Dependencys.Fanuc.FanucToolOffsetVariableLookup.html">FanucToolOffsetVariableLookup</a>).</li></ol>
|
||||
<p>
|
||||
Each lookup self-gates its id range; the evaluator stays brand- and
|
||||
range-agnostic. Adding a new variable surface is additive: register
|
||||
an <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Evaluation.IVariableLookup.html">IVariableLookup</a> on a dependency or push an
|
||||
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Evaluation.IRuntimeVariableLookup.html">IRuntimeVariableLookup</a> onto the per-preset list.
|
||||
</p>
|
||||
<p>
|
||||
<b>Same-block forward reference</b> — when an Assignment RHS
|
||||
references a <code>#nnn</code> that is <i>also</i> being assigned later in
|
||||
the same block (i.e. listed in <code>Parsing.Assignments</code> after the
|
||||
RHS being evaluated), the <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html">VariableEvaluatorSyntax.ChainLookup</a> cannot pick up
|
||||
the not-yet-resolved value and falls back to traceback /
|
||||
dependency-table reads — effectively the pre-block value. A
|
||||
<code>VariableEvaluator--SameBlockForwardReference</code> warning is
|
||||
emitted per such RHS so the user is told the source-order semantics
|
||||
were not honoured. Practical impact is near-zero for typical
|
||||
CAM-emitted NC (one assignment per line).
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="jumplist">
|
||||
<dt><a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VolatileVariableReadingSyntax.html">VolatileVariableReadingSyntax</a></dt>
|
||||
<dd><p>Obtains values for Fanuc-style non-retained common variables
|
||||
(<code>#100-#499</code>). Reads literal numeric assignments from
|
||||
<code>Parsing.Assignments.#nnn</code>, dict-merges them with the previous block's
|
||||
volatile state, and writes the resulting per-block dictionary into
|
||||
<code>Vars.Volatile</code>.</p>
|
||||
<p>
|
||||
Lifetime is bounded by <code>MachiningSession</code>: within one session the
|
||||
dictionary carries forward block-by-block via this syntax; session restart
|
||||
abandons the SyntaxPiece JSON dataflow and starts fresh. Program-end
|
||||
(M02/M30) clearing is handled by <a class="xref" href="Hi.NcParsers.LogicSyntaxs.ProgramEndCleanSyntax.html">ProgramEndCleanSyntax</a>.
|
||||
</p>
|
||||
<p>
|
||||
Only literal numeric RHS values are consumed by this syntax
|
||||
(<code>#124 = 15.</code> ✓; <code>#100 = #1 + 5</code> ✗). Non-literal RHS entries
|
||||
are left untouched in <code>Parsing.Assignments</code>; <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html">VariableEvaluatorSyntax</a>
|
||||
resolves them and writes the result into the same per-block dictionary.
|
||||
The two syntaxes are decoupled — the evaluator's lookup tracebacks via
|
||||
<code>SyntaxPiece</code> linkage so it does not depend on having run before
|
||||
or after this syntax.
|
||||
</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>
|
||||
Reference in New Issue
Block a user