Archived
deploy webservice static-file routing for docsite folder URLs, per-instance step-cache db, and constant-height panel title bars.
This commit is contained in:
+51
-7
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="title" content="Class VariableEvaluatorSyntax | HiAPI-C# 2025 ">
|
||||
|
||||
<meta name="description" content="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 not write to any specific store. Routing &ldquo;where the resolved literal lands&rdquo; stays in the brand-specific reader syntaxes (, 's reader, , …) which run after this syntax on the same block. Two passes per block: Assignments normalize — Parsing.Assignments.#nnn entries whose RHS is non-literal (e.g. "#500+1", "SQRT[#100]") are evaluated via the and the RHS string is replaced with the resolved literal (round-trip-safe "R"-format). The entry stays in Parsing.Assignments so downstream reader syntaxes consume it as a pure-literal assignment. Iteration follows source order (Parsing.Assignments insertion order). Parsing tree substitution — every string-typed value reachable from Parsing.&lt;tag&gt; (axis tags, canned-cycle sub-objects) is parsed; on a successful evaluation the string is replaced with a numeric . Failures silently leave the original string and rely on downstream at consumer sites to surface VariableExpression--Unevaluated only if the tag is actually read. Lookup chain (first non-null wins, configured per brand preset via + instances on NcDependencyList): Current block's own resolved assignments — built-in to ; covers same-block forward references in source order (an earlier #nnn=literal is visible to a later RHS that mentions #nnn).Each in , in list order. Typical contents for a Fanuc-family preset: (#1-#33), (#100-#499), (#5001-#5043).Each on the runner's NcDependencyList, in registration order (, , ). Each lookup self-gates its id range; the evaluator stays brand- and range-agnostic. Adding a new variable surface is additive: register an on a dependency or push an onto the per-preset list. Same-block forward reference — when an Assignment RHS references a #nnn that is also being assigned later in the same block (i.e. listed in Parsing.Assignments after the RHS being evaluated), the cannot pick up the not-yet-resolved value and falls back to traceback / dependency-table reads — effectively the pre-block value. A VariableEvaluator--SameBlockForwardReference 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). Formula mirror tree — when either pass actually performs a non-trivial expression evaluation (i.e. the RHS / tag value was not already a pure literal and the evaluator returned a finite value), the original expression string is mirrored to a parallel Formula.&lt;same path&gt; entry at the root of the block JSON. The Parsing.* subtree carries the resolved value (R-format string for Assignments; numeric for tags); the Formula.* subtree preserves the source-text expression for diagnostics, round-trip reconstruction, and downstream inspection. Pure-literal RHS / tag values produce no Formula entry — the Parsing value is already the original text. Evaluation failures (parse error, vacant variable, non-finite result) also produce no Formula entry — the original string is still in Parsing.* untouched, no preservation needed.">
|
||||
<meta name="description" content="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 not write to any specific store. Routing &ldquo;where the resolved literal lands&rdquo; stays in the brand-specific reader syntaxes (, 's reader, , …) which run after this syntax on the same block. Two passes per block: Assignments normalize — Parsing.Assignments.#nnn entries whose RHS is non-literal (e.g. "#500+1", "SQRT[#100]") are evaluated via the and the RHS string is replaced with the resolved literal (round-trip-safe "R"-format). The entry stays in Parsing.Assignments so downstream reader syntaxes consume it as a pure-literal assignment. Iteration follows source order (Parsing.Assignments insertion order). Parsing tree substitution — every string-typed value reachable from Parsing.&lt;tag&gt; (axis tags, canned-cycle sub-objects) is parsed; on a successful evaluation the string is replaced with a numeric . Failures silently leave the original string and rely on downstream at consumer sites to surface VariableExpression--Unevaluated only if the tag is actually read. Lookup chain (first non-null wins, configured per brand preset via + instances on NcDependencyList): Current block's own resolved assignments — built-in to ; covers same-block forward references in source order (an earlier #nnn=literal is visible to a later RHS that mentions #nnn).Each in , in list order. Typical contents for a Fanuc-family preset: (#1-#33), (#100-#499), (#5001-#5043).Each on the runner's NcDependencyList, in registration order (, , ). Each lookup self-gates its id range; the evaluator stays brand- and range-agnostic. Adding a new variable surface is additive: register an on a dependency or push an onto the per-preset list. Same-block forward reference — when an Assignment RHS references a #nnn that is also being assigned later in the same block (i.e. listed in Parsing.Assignments after the RHS being evaluated), the cannot pick up the not-yet-resolved value and falls back to traceback / dependency-table reads — effectively the pre-block value. A VariableEvaluator--SameBlockForwardReference 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). Formula mirror tree — when either pass actually performs a non-trivial expression evaluation (i.e. the RHS / tag value was not already a pure literal and the evaluator returned a finite value), the original expression string is mirrored to a parallel Formula.&lt;same path&gt; entry at the root of the block JSON. The Parsing.* subtree carries the resolved value (R-format string for Assignments; numeric for tags); the Formula.* subtree preserves the source-text expression for diagnostics, round-trip reconstruction, and downstream inspection. Pure-literal RHS values produce no Formula entry — the Parsing value is already the original text. In the tag pass the same holds for the Heidenhain dialect only (literal strings short-circuit there because klartext readers consume them as strings); Fanuc / Siemens literal-string tags are numeric-ified as they always were (int-typed capture fallbacks and constant conditions depend on it) and thus carry a Formula entry. Evaluation failures (parse error, vacant variable, non-finite result) produce no Formula entry — the original string is still in Parsing.* untouched, no preservation needed.">
|
||||
<link rel="icon" href="../img/HiAPI.favicon.ico">
|
||||
<link rel="stylesheet" href="../public/docfx.min.css">
|
||||
<link rel="stylesheet" href="../public/main.css">
|
||||
@@ -173,11 +173,16 @@ The <code>Parsing.*</code> subtree carries the resolved value (R-format
|
||||
string for Assignments; numeric <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.text.json.nodes.jsonvalue">JsonValue</a> for tags);
|
||||
the <code>Formula.*</code> subtree preserves the source-text expression
|
||||
for diagnostics, round-trip reconstruction, and downstream
|
||||
inspection. Pure-literal RHS / tag values produce no Formula entry —
|
||||
the Parsing value is already the original text. Evaluation failures
|
||||
(parse error, vacant variable, non-finite result) also produce no
|
||||
Formula entry — the original string is still in <code>Parsing.*</code>
|
||||
untouched, no preservation needed.
|
||||
inspection. Pure-literal RHS values produce no Formula entry — the
|
||||
Parsing value is already the original text. In the tag pass the same
|
||||
holds for the Heidenhain dialect only (literal strings short-circuit
|
||||
there because klartext readers consume them as strings); Fanuc /
|
||||
Siemens literal-string tags are numeric-ified as they always were
|
||||
(int-typed capture fallbacks and constant conditions depend on it)
|
||||
and thus carry a Formula entry. Evaluation failures (parse error,
|
||||
vacant variable, non-finite result) produce no Formula entry — the
|
||||
original string is still in <code>Parsing.*</code> untouched, no
|
||||
preservation needed.
|
||||
</p>
|
||||
</div>
|
||||
<div class="markdown conceptual"></div>
|
||||
@@ -301,7 +306,7 @@ untouched, no preservation needed.
|
||||
|
||||
</h3>
|
||||
|
||||
<div class="markdown level1 summary"><p>Loads from an XML element produced by <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html#Hi_NcParsers_EvaluationSyntaxs_VariableEvaluatorSyntax_MakeXmlSource_System_String_System_String_System_Boolean_">MakeXmlSource(string, string, bool)</a>; restores <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html#Hi_NcParsers_EvaluationSyntaxs_VariableEvaluatorSyntax_RuntimeVariableLookups">RuntimeVariableLookups</a> via XFactory dispatch.</p>
|
||||
<div class="markdown level1 summary"><p>Loads from an XML element produced by <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html#Hi_NcParsers_EvaluationSyntaxs_VariableEvaluatorSyntax_MakeXmlSource_System_String_System_String_System_Boolean_">MakeXmlSource(string, string, bool)</a>; restores <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.html#Hi_NcParsers_EvaluationSyntaxs_VariableEvaluatorSyntax_RuntimeVariableLookups">RuntimeVariableLookups</a> via XFactory dispatch. A missing <code><Dialect></code> element falls back to <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Evaluation.NcExpressionDialect.html#Hi_NcParsers_EvaluationSyntaxs_Evaluation_NcExpressionDialect_Fanuc">Fanuc</a> (legacy files).</p>
|
||||
</div>
|
||||
<div class="markdown level1 conceptual"></div>
|
||||
|
||||
@@ -365,6 +370,45 @@ untouched, no preservation needed.
|
||||
</h2>
|
||||
|
||||
|
||||
<a id="Hi_NcParsers_EvaluationSyntaxs_VariableEvaluatorSyntax_Dialect_" data-uid="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.Dialect*"></a>
|
||||
|
||||
<h3 id="Hi_NcParsers_EvaluationSyntaxs_VariableEvaluatorSyntax_Dialect" data-uid="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.Dialect">
|
||||
Dialect
|
||||
|
||||
</h3>
|
||||
|
||||
<div class="markdown level1 summary"><p>Expression grammar this evaluator parses with. Default
|
||||
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Evaluation.NcExpressionDialect.html#Hi_NcParsers_EvaluationSyntaxs_Evaluation_NcExpressionDialect_Fanuc">Fanuc</a> keeps the legacy behavior
|
||||
byte-identical (Custom Macro B <code>#nnn</code> + brackets); the Siemens
|
||||
preset sets <a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Evaluation.NcExpressionDialect.html#Hi_NcParsers_EvaluationSyntaxs_Evaluation_NcExpressionDialect_Siemens">Siemens</a> for
|
||||
<code>Rn</code>/named/<code>$</code> keys and parenthesised grammar. The
|
||||
evaluation machinery (lookup chain, Formula mirror, diagnostics) is
|
||||
dialect-independent — only tokenization routes through
|
||||
<a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Evaluation.NcExpressionDialectUtil.html">NcExpressionDialectUtil</a>.</p>
|
||||
</div>
|
||||
<div class="markdown level1 conceptual"></div>
|
||||
|
||||
<div class="codewrapper">
|
||||
<pre><code class="lang-csharp hljs">public NcExpressionDialect Dialect { get; set; }</code></pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="section">Property Value</h4>
|
||||
<dl class="parameters">
|
||||
<dt><a class="xref" href="Hi.NcParsers.EvaluationSyntaxs.Evaluation.NcExpressionDialect.html">NcExpressionDialect</a></dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a id="Hi_NcParsers_EvaluationSyntaxs_VariableEvaluatorSyntax_Name_" data-uid="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.Name*"></a>
|
||||
|
||||
<h3 id="Hi_NcParsers_EvaluationSyntaxs_VariableEvaluatorSyntax_Name" data-uid="Hi.NcParsers.EvaluationSyntaxs.VariableEvaluatorSyntax.Name">
|
||||
|
||||
Reference in New Issue
Block a user