Class ProgramEndCleanSyntax
- Namespace
- Hi.NcParsers.LogicSyntaxs
- Assembly
- HiMech.dll
Clears the per-block Vars.Volatile dictionary on blocks that
triggered program end (M02 / M30, identified by the
ProgramEnd section written by ProgramEndSyntax).
Real Fanuc clears non-retained common variables (#100-#499) on program end + reset; this syntax models that behaviour at the simulator level. The clear happens on the same block that carried M02/M30 — the next block's VolatileVariableReadingSyntax carry then sees an empty dictionary on the predecessor and starts fresh.
Pipeline placement: must run after both ProgramEndSyntax (which writes the ProgramEnd section this syntax checks) and VolatileVariableReadingSyntax (so the carry has already happened on this block; this syntax overwrites the result).
Retained common variables (#500-#999, owned by
RetainedCommonVariableTable) are
untouched — they survive program end on real hardware (NV-RAM).
Local variables (#1-#33, scope: macro call frame) are also
untouched here; their lifecycle belongs to G65/G66/M99 push/pop, not
program end.
public class ProgramEndCleanSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
ProgramEndCleanSyntax
- Implements
- Inherited Members
- Extension Methods
Constructors
ProgramEndCleanSyntax()
Default constructor.
public ProgramEndCleanSyntax()
ProgramEndCleanSyntax(XElement)
Loads from XML produced by MakeXmlSource(string, string, bool); no state.
public ProgramEndCleanSyntax(XElement src)
Parameters
srcXElement
Properties
Name
Syntax kind name (typically the concrete type name).
public string Name { get; }
Property Value
XName
XML element name for Regs 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.