Class FanucLocalVariableReadingSyntax
- Namespace
- Hi.NcParsers.EvaluationSyntaxs.Fanuc
- Assembly
- HiMech.dll
Routes literal-RHS assignments to Fanuc-style local macro variables
(#1-#33) from Parsing.Assignments into Vars.Local
on the current block, carrying the previous block's Vars.Local
dict forward when both blocks share the same
MacroFrame id. Mirrors
VolatileVariableReadingSyntax for the
#100-#499 range, with two differences:
- Carry is gated by MacroFrame equality, so a caller block after a G65 return does not inherit the macro body's final locals.
- Writes outside a macro frame (a main-program block doing
#11 = 5) emitLocalVariable--MainFrameWriteUnsupportedand 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 UnconsumedCheckSyntax hit.
Pipeline placement: Evaluation bundle, after
VariableEvaluatorSyntax (so any expression RHS such as
#11 = #1 + 1 has already been normalised to a literal by the
time this reader runs) and after the other range readers
(RetainedCommonVariableReadingSyntax,
VolatileVariableReadingSyntax) so they all share a
similar Reader-stage shape.
Only literal numeric RHS values are consumed here; non-literal
entries (which can only persist if
VariableEvaluatorSyntax failed to resolve them) are
left untouched and surface via the evaluator's own
VariableExpression--Unevaluated diagnostic plus
UnconsumedCheckSyntax.
public class FanucLocalVariableReadingSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
FanucLocalVariableReadingSyntax
- Implements
- Inherited Members
- Extension Methods
Constructors
FanucLocalVariableReadingSyntax()
Default constructor.
public FanucLocalVariableReadingSyntax()
FanucLocalVariableReadingSyntax(XElement)
Loads from XML produced by MakeXmlSource(string, string, bool); no state.
public FanucLocalVariableReadingSyntax(XElement src)
Parameters
srcXElement
Fields
LocalMax
Inclusive upper bound of the local range (#33).
public const int LocalMax = 33
Field Value
LocalMin
Inclusive lower bound of the local range (#1).
public const int LocalMin = 1
Field Value
Properties
Name
Syntax kind name (typically the concrete type name).
public string Name { get; }
Property Value
XName
XML element name for Generators registration.
public static string XName { get; }
Property Value
Methods
Build(LazyLinkedListNode<SyntaxPiece>, List<INcDependency>, NcDiagnosticProgress)
Build syntax arrangement into the
syntaxPieceNode in-place.
public void Build(LazyLinkedListNode<SyntaxPiece> syntaxPieceNode, List<INcDependency> ncDependencyList, NcDiagnosticProgress ncDiagnosticProgress)
Parameters
syntaxPieceNodeLazyLinkedListNode<SyntaxPiece>ncDependencyListList<INcDependency>ncDiagnosticProgressNcDiagnosticProgress
MakeXmlSource(string, string, bool)
Creates an XML representation of the object. This method may also generate additional resources such as related files.
public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)
Parameters
baseDirectorystringThe base directory for resolving relative paths
relFilestringThe relative file path for the XML source
exhibitionOnlyboolif true, the extended file creation is suppressed.
Returns
- XElement
An XML element representing the object's state
Remarks
For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied.
The baseDirectory is typically the folder at the nearest configuration file folder.
Since the folder can be moving with the configuration file.
Reg(XFactory)
Registers this type's deserializer with the given XFactory
(or Default when factory is
null). Idempotent.
public static void Reg(XFactory factory = null)
Parameters
factoryXFactory