Class TagAssignmentSyntax
- Namespace
- Hi.NcParsers.ParsingSyntaxs
- Assembly
- HiMech.dll
Assignment syntax with = sign. Unlike TagValueSyntax which handles concatenated tag-value pairs (no = sign), this class handles explicit assignment statements.
public class TagAssignmentSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
TagAssignmentSyntax
- Implements
- Derived
- Inherited Members
- Extension Methods
Remarks
- Fanuc: #1 = 100, #100 = [#1 + #2]
- Siemens: R1 = 100, R1 = R2 + R3
- Heidenhain: via derived HeidenhainFnAssignmentSyntax which adds FN prefix handling
Constructors
TagAssignmentSyntax(IEnumerable<string>, IEnumerable<string>, string, IEnumerable<string>)
public TagAssignmentSyntax(IEnumerable<string> categoryPath, IEnumerable<string> tags, string varPrefix, IEnumerable<string> terminateWords = null)
Parameters
categoryPathIEnumerable<string>tagsIEnumerable<string>varPrefixstringterminateWordsIEnumerable<string>
TagAssignmentSyntax(XElement)
public TagAssignmentSyntax(XElement src)
Parameters
srcXElement
Properties
CategoryPath
public List<string> CategoryPath { get; set; }
Property Value
Name
Syntax kind name (typically the concrete type name).
public string Name { get; }
Property Value
TagList
public List<string> TagList { get; set; }
Property Value
TerminateWords
public List<string> TerminateWords { get; set; }
Property Value
VarPrefix
public string VarPrefix { get; set; }
Property Value
XName
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 virtual 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.
ToAssignmentJsonNode(string)
Converts an assignment expression string to a JsonNode. Override in derived classes for typed parsing.
protected virtual JsonNode ToAssignmentJsonNode(string setup)
Parameters
setupstring
Returns
TryStripPrefix(ref string)
Strips a brand-specific prefix from unparsedText
before assignment parsing.
Returns false to signal no match (skip this syntax).
Base implementation does nothing (no prefix required).
protected virtual bool TryStripPrefix(ref string unparsedText)
Parameters
unparsedTextstring