Table of Contents

Class NumberedFlagSyntax

Namespace
Hi.NcParsers.ParsingSyntaxs
Assembly
HiMech.dll

Syntax for numbered flags (prefix + number) with optional decimal support. NumberedFlagSyntax often should place after something like ParameterizedFlagSyntax. Since NumberedFlagSyntax is easy to eat those kind of flags.

public class NumberedFlagSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
Inheritance
NumberedFlagSyntax
Implements
Inherited Members
Extension Methods

Remarks

Examples:

  • Integer codes: G0, G1, G54, M3, M30, T5, S1000
  • Decimal codes: G54.1 (Fanuc extended work coordinates)
Note: Parameters like P2 in G54.1P2 should be handled by TagSetupSyntax separately.

Constructors

NumberedFlagSyntax(IEnumerable<string>, IEnumerable<string>, bool)

Creates a new NumberedFlagSyntax instance.

public NumberedFlagSyntax(IEnumerable<string> categoryPath, IEnumerable<string> codePrefixes, bool allowDecimal = true)

Parameters

categoryPath IEnumerable<string>

JSON path for storing matched codes.

codePrefixes IEnumerable<string>

Code prefixes to match (e.g., [“G”, “M”]).

allowDecimal bool

Whether to allow decimal numbers.

NumberedFlagSyntax(XElement)

public NumberedFlagSyntax(XElement src)

Parameters

src XElement

Properties

AllowDecimal

Whether to allow decimal numbers (e.g., G54.1).

public bool AllowDecimal { get; set; }

Property Value

bool

CategoryPath

Category path for storing matched codes in JSON.

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

Property Value

List<string>

CodePrefixes

Code prefixes to match (e.g., [“G”, “M”]).

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

Property Value

List<string>

Name

public string Name { get; }

Property Value

string

XName

public static string XName { get; }

Property Value

string

Methods

Build(LazyLinkedListNode<SyntaxPiece>, List<INcDependency>)

Build syntax arrangement into the syntaxPieceNode in-place.

public void Build(LazyLinkedListNode<SyntaxPiece> syntaxPieceNode, List<INcDependency> ncDependencyList)

Parameters

syntaxPieceNode LazyLinkedListNode<SyntaxPiece>
ncDependencyList List<INcDependency>

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

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.