Table of Contents

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
Wraps GrabTagAssignment(ref string, IEnumerable<string>, string, IEnumerable<string>) as an INcSyntax.

Constructors

TagAssignmentSyntax(IEnumerable<string>, IEnumerable<string>, string, IEnumerable<string>)

public TagAssignmentSyntax(IEnumerable<string> categoryPath, IEnumerable<string> tags, string varPrefix, IEnumerable<string> terminateWords = null)

Parameters

categoryPath IEnumerable<string>
tags IEnumerable<string>
varPrefix string
terminateWords IEnumerable<string>

TagAssignmentSyntax(XElement)

public TagAssignmentSyntax(XElement src)

Parameters

src XElement

Properties

CategoryPath

public List<string> CategoryPath { get; set; }

Property Value

List<string>

Name

Syntax kind name (typically the concrete type name).

public string Name { get; }

Property Value

string

TagList

public List<string> TagList { get; set; }

Property Value

List<string>

TerminateWords

public List<string> TerminateWords { get; set; }

Property Value

List<string>

VarPrefix

public string VarPrefix { get; set; }

Property Value

string

XName

public static string XName { get; }

Property Value

string

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

syntaxPieceNode LazyLinkedListNode<SyntaxPiece>
ncDependencyList List<INcDependency>
ncDiagnosticProgress NcDiagnosticProgress

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

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

exhibitionOnly bool

if 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

setup string

Returns

JsonNode

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

unparsedText string

Returns

bool